public Task <int> SaveAnxityRecordAsync(AnxityRecords record) { if (record._id != 0) { return(_database.UpdateAsync(record)); } else { return(_database.InsertAsync(record)); } }
public void DoSmthNew(object sender, EventArgs e) { var formLocation = Activity.FindViewById <EditText>(Resource.Id.formLocation).Text; var formDate = Activity.FindViewById <EditText>(Resource.Id.formDate).Text; var formNote = Activity.FindViewById <EditText>(Resource.Id.formNote).Text; var record = new AnxityRecords(formLocation, formDate, 3, formNote, "art"); var db = new AnxityDatabase(); db.SaveAnxityRecordAsync(record); Android.App.AlertDialog cat = new Android.App.AlertDialog.Builder(Activity).Create(); cat.SetMessage("Location : " + formLocation + " || Date :" + formDate + " || Note : " + formNote); var trans = Activity.SupportFragmentManager.BeginTransaction(); trans.Replace(Resource.Id.fragmentLayout, new Journal(), "Main_Page"); trans.Commit(); cat.SetTitle("message title"); cat.SetButton("OK", delegate { }); cat.Show(); }
public Task <int> DeleteAnxityRecordAsync(AnxityRecords record) { return(_database.DeleteAsync(record)); }
public void getAnxRecord() { anx = new AnxityDatabase().GetAnxityRecordAsync(Arguments.GetInt("recordId")).Result; }