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;
            }
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
 public Task <int> SaveBillRecordAsync(BillRecord billRecord)
 {
     return(_database.InsertAsync(billRecord));
 }
Exemple #5
0
 public Task <int> DeleteBillRecordAsync(BillRecord record)
 {
     return(_database.DeleteAsync(record));
 }
Exemple #6
0
 public Task <int> UpdateBillRecordAsync(BillRecord record)
 {
     return(_database.UpdateAsync(record, typeof(BillRecord)));
 }