public int Save(Record item) { var data = new RecordDao { Id = item.Id, CreatedDate = item.CreatedDate }; lock (locker) { if (data.Id != 0) { Update(data); return data.Id; } else { return Insert(data); } } }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); if (currentRecord == null) { currentRecord = new Record(); } lblCreatedDate.Text = currentRecord.FormattedCreatedDate; var threeThings = currentRecord.ThreeThings.ToArray(); if (threeThings.Length > 0) { txtFirstThing.Text = threeThings[0]; txtSecondThing.Text = threeThings[1]; txtThirdThing.Text = threeThings[2]; } }
public void DeleteTask(Record record) { AppDelegate.Database.Delete(record.Id); NavigationController.PopViewController(true); }
public void SaveRecord(Record record) { AppDelegate.Database.Save(record); NavigationController.PopViewController(true); }
// this will be called before the view is displayed public void SetRecord(RecordsTableViewController d, Record record) { Delegate = d; currentRecord = record; }
// set in the Storyboard public RootTableSource(Record[] items) { tableItems = items; }
public int Delete(Record item) { lock (locker) { return Delete<RecordDao>(item.Id); } }