Search in sources :

Example 6 with Meeting

use of com.marshalchen.common.usefulModule.standuptimer.model.Meeting in project UltimateAndroid by cymcsg.

the class MeetingDAO method createMeetingFromCursorData.

private Meeting createMeetingFromCursorData(Cursor cursor) {
    long id = cursor.getLong(0);
    String teamName = cursor.getString(1);
    Date meetingTime = new Date(cursor.getLong(2));
    int numParticipants = cursor.getInt(3);
    int individualStatusLength = cursor.getInt(4);
    int meetingLength = cursor.getInt(5);
    int quickestStatus = cursor.getInt(6);
    int longestStatus = cursor.getInt(7);
    return new Meeting(id, new Team(teamName), meetingTime, numParticipants, individualStatusLength, meetingLength, quickestStatus, longestStatus);
}
Also used : Meeting(com.marshalchen.common.usefulModule.standuptimer.model.Meeting) Team(com.marshalchen.common.usefulModule.standuptimer.model.Team) Date(java.util.Date)

Example 7 with Meeting

use of com.marshalchen.common.usefulModule.standuptimer.model.Meeting in project UltimateAndroid by cymcsg.

the class StandupTimer method storeMeetingStats.

private void storeMeetingStats() {
    if (team != null) {
        long meetingEndTime = System.currentTimeMillis();
        if (individualStatusEndTime == 0) {
            individualStatusEndTime = meetingEndTime;
        }
        try {
            Meeting meeting = new Meeting(team, new Date(meetingStartTime), completedParticipants, (int) ((individualStatusEndTime - individualStatusStartTime) / 1000), (int) ((meetingEndTime - meetingStartTime) / 1000), quickestStatus, longestStatus);
            persistMeeting(meeting);
        } catch (IllegalArgumentException e) {
            Logger.e("Could not store the meeting in the database.  " + e);
        }
    }
}
Also used : Meeting(com.marshalchen.common.usefulModule.standuptimer.model.Meeting) Date(java.util.Date)

Example 8 with Meeting

use of com.marshalchen.common.usefulModule.standuptimer.model.Meeting in project UltimateAndroid by cymcsg.

the class TeamDetails method deleteMeeting.

private void deleteMeeting(String dateString) {
    try {
        Date date = new SimpleDateFormat(Meeting.DESCRIPTION_FORMAT).parse(dateString);
        Meeting meeting = Meeting.findByTeamAndDate(team, date, this);
        meeting.delete(this);
    } catch (ParseException e) {
        Logger.e(e.getMessage());
        Logger.e("Could not parse the date string '" + dateString + "'.  Will not attempt to delete the meeting.");
    }
}
Also used : Meeting(com.marshalchen.common.usefulModule.standuptimer.model.Meeting) ParseException(java.text.ParseException) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Aggregations

Meeting (com.marshalchen.common.usefulModule.standuptimer.model.Meeting)8 Date (java.util.Date)4 Cursor (android.database.Cursor)3 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)3 ArrayList (java.util.ArrayList)2 ContentValues (android.content.ContentValues)1 Team (com.marshalchen.common.usefulModule.standuptimer.model.Team)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1