private org.ei.telemedicine.view.contract.TimelineEvent eventFor( TimelineEvent pregnancyEvent, String expectedRelativeTime) { return new org.ei.telemedicine.view.contract.TimelineEvent( pregnancyEvent.type(), pregnancyEvent.title(), new String[] {pregnancyEvent.detail1(), pregnancyEvent.detail2()}, expectedRelativeTime); }
private ContentValues createValuesFor(TimelineEvent timelineEvent) { ContentValues values = new ContentValues(); values.put(CASEID_COLUMN, timelineEvent.caseId()); values.put(TYPE_COLUMN, timelineEvent.type()); values.put(REF_DATE_COLUMN, timelineEvent.referenceDate().toString()); values.put(TITLE_COLUMN, timelineEvent.title()); values.put(DETAIL1_COLUMN, timelineEvent.detail1()); values.put(DETAIL2_COLUMN, timelineEvent.detail2()); return values; }
public void add(TimelineEvent timelineEvent) { Log.e("Timeline", " Created " + timelineEvent.caseId() + "--" + timelineEvent.title()); SQLiteDatabase database = masterRepository.getWritableDatabase(); database.insert(TIMELINEEVENT_TABLE_NAME, null, createValuesFor(timelineEvent)); }