switch to sqlite

This commit is contained in:
2022-03-11 16:10:11 +08:00
parent f5f16d43f4
commit 5ec4119025
25 changed files with 286 additions and 435 deletions

View File

@ -1,4 +1,5 @@
using Billing.Models;
using Billing.Store;
using Billing.UI;
using System;
using System.Collections.Generic;
@ -84,7 +85,7 @@ namespace Billing.Views
private void UpdateBill(UIBill bill)
{
bill.Icon = App.Categories.FirstOrDefault(c => c.Id == bill.Bill.CategoryId)?.Icon ?? BaseModel.ICON_DEFAULT;
bill.Icon = App.Categories.FirstOrDefault(c => c.Id == bill.Bill.CategoryId)?.Icon ?? Definition.DefaultIcon;
bill.Name = bill.Bill.Name;
bill.DateCreation = bill.Bill.CreateTime;
bill.Amount = bill.Bill.Amount;
@ -158,13 +159,13 @@ namespace Billing.Views
RankPage.Instance?.SetNeedRefresh();
_ = Task.Run(App.WriteBills);
await StoreHelper.DeleteBillItemAsync(bill.Bill);
}
}
}
}
private void OnBillChecked(object sender, Bill e)
private async void OnBillChecked(object sender, Bill e)
{
if (e.Id < 0)
{
@ -195,7 +196,7 @@ namespace Billing.Views
RankPage.Instance?.SetNeedRefresh();
Task.Run(App.WriteBills);
await StoreHelper.SaveBillItemAsync(e);
}
}