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,8 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Billing.Languages;
using Billing.Models;
using Billing.Store;
using Billing.UI;
using Xamarin.Forms;
@ -120,25 +120,27 @@ namespace Billing.Views
if (group == null)
{
Helper.Error("account.delete", "unexpected deleting account, cannot find the current category");
return;
}
group.Remove(account);
if (group.Count == 0)
}
else
{
accounts.Remove(group);
group.Remove(account);
if (group.Count == 0)
{
accounts.Remove(group);
}
}
RefreshBalance();
groupLayout.Refresh(accounts);
RankPage.Instance?.SetNeedRefresh();
_ = Task.Run(App.WriteAccounts);
await StoreHelper.DeleteAccountItemAsync(account);
}
}
}
}
private void AccountChecked(object sender, AccountEventArgs e)
private async void AccountChecked(object sender, AccountEventArgs e)
{
var add = e.Account.Id < 0;
if (add)
@ -151,7 +153,7 @@ namespace Billing.Views
RankPage.Instance?.SetNeedRefresh();
Task.Run(App.WriteAccounts);
await StoreHelper.SaveAccountItemAsync(e.Account);
}
}