public BillRecordDetail(BillRecord billRecord) { Id = billRecord.Id; Type = BillTypeDict[billRecord.BillType]; Date = billRecord.Time.Date; Time = billRecord.Time; Amount = billRecord.Amount; Remark = billRecord.Remark; RemarkVisible = !string.IsNullOrEmpty(Remark); switch (Type.IoType) { case IoType.Income: Color = Color.Green; break; case IoType.Outcome: Color = Color.Orange; break; case IoType.Other: Color = Color.Gray; break; } }
private async void DeleteRecord_OnClicked(object sender, EventArgs e) { BillRecord record = new BillRecord { Id = Detail.Id }; await App.Database.DeleteBillRecordAsync(record); _listener.Invoke(); await Navigation.PopPopupAsync(); }
private async void EditRecord_OnClicked(object sender, EventArgs e) { //通过BillRecordDetail构造BillRecord BillRecord record = new BillRecord { Id = Detail.Id, BillType = Detail.Type.Id, Amount = Detail.Amount, Remark = Detail.Remark, Time = Detail.Time }; await Navigation.PushModalAsync(new AddBillPage(record)); _listener.Invoke(); if (PopupNavigation.Instance.PopupStack.Count > 0) { await Navigation.PopPopupAsync(); } }
public Task <int> SaveBillRecordAsync(BillRecord billRecord) { return(_database.InsertAsync(billRecord)); }
public Task <int> DeleteBillRecordAsync(BillRecord record) { return(_database.DeleteAsync(record)); }
public Task <int> UpdateBillRecordAsync(BillRecord record) { return(_database.UpdateAsync(record, typeof(BillRecord))); }