use of com.marshalchen.common.usefulModule.standuptimer.model.Meeting in project UltimateAndroid by cymcsg.
the class MeetingDAO method createNewMeeting.
private Meeting createNewMeeting(SQLiteDatabase db, Meeting meeting) {
Logger.d("Creating new meeting for " + meeting.getTeam().getName() + " with a date/time of '" + meeting.getDateTime() + "'");
ContentValues values = createContentValues(meeting);
long id = db.insertOrThrow(MEETINGS_TABLE_NAME, null, values);
return new Meeting(id, meeting);
}
use of com.marshalchen.common.usefulModule.standuptimer.model.Meeting in project UltimateAndroid by cymcsg.
the class MeetingDAO method findByTeamAndDate.
public Meeting findByTeamAndDate(Team team, Date date) {
Cursor cursor = null;
Meeting meeting = null;
try {
long startTime = date.getTime();
Date endDate = new Date(date.getTime());
endDate.setSeconds(endDate.getSeconds() + 1);
long endTime = endDate.getTime();
SQLiteDatabase db = getReadableDatabase();
cursor = db.query(MEETINGS_TABLE_NAME, MEETINGS_ALL_COLUMS, MEETINGS_TEAM_NAME + " = ? and " + MEETINGS_MEETING_TIME + " >= ? and " + MEETINGS_MEETING_TIME + " < ?", new String[] { team.getName(), Long.toString(startTime), Long.toString(endTime) }, null, null, null);
if (cursor.getCount() == 1) {
if (cursor.moveToFirst()) {
meeting = createMeetingFromCursorData(cursor);
}
}
} finally {
closeCursor(cursor);
}
return meeting;
}
use of com.marshalchen.common.usefulModule.standuptimer.model.Meeting in project UltimateAndroid by cymcsg.
the class TeamDetails method createMeetingListAdapter.
private ArrayAdapter<String> createMeetingListAdapter() {
List<String> meetingDescriptions = new ArrayList<String>();
if (team != null) {
List<Meeting> meetings = team.findAllMeetings(TeamDetails.this);
for (Meeting meeting : meetings) {
meetingDescriptions.add(meeting.getDescription());
}
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(TeamDetails.this, android.R.layout.simple_list_item_1, meetingDescriptions);
return adapter;
}
use of com.marshalchen.common.usefulModule.standuptimer.model.Meeting in project UltimateAndroid by cymcsg.
the class MeetingDAO method findById.
public Meeting findById(Long id) {
Cursor cursor = null;
Meeting meeting = null;
try {
SQLiteDatabase db = getReadableDatabase();
cursor = db.query(MEETINGS_TABLE_NAME, MEETINGS_ALL_COLUMS, _ID + " = ?", new String[] { id.toString() }, null, null, null);
if (cursor.getCount() == 1) {
if (cursor.moveToFirst()) {
meeting = createMeetingFromCursorData(cursor);
}
}
} finally {
closeCursor(cursor);
}
return meeting;
}
use of com.marshalchen.common.usefulModule.standuptimer.model.Meeting in project UltimateAndroid by cymcsg.
the class MeetingDAO method findAllByTeam.
public List<Meeting> findAllByTeam(Team team) {
List<Meeting> meetings = new ArrayList<Meeting>();
Cursor cursor = null;
try {
SQLiteDatabase db = getReadableDatabase();
cursor = db.query(MEETINGS_TABLE_NAME, MEETINGS_ALL_COLUMS, MEETINGS_TEAM_NAME + " = ?", new String[] { team.getName() }, null, null, MEETINGS_MEETING_TIME);
while (cursor.moveToNext()) {
meetings.add(createMeetingFromCursorData(cursor));
}
} finally {
closeCursor(cursor);
}
Logger.d("Found " + meetings.size() + " meetings");
Collections.reverse(meetings);
return meetings;
}
Aggregations