issue fix

This commit is contained in:
2022-03-11 17:16:49 +08:00
parent 5ec4119025
commit 28897c96ea
11 changed files with 66 additions and 74 deletions

View File

@ -64,17 +64,6 @@ namespace Billing.Views
private void AddToAccountGroup(Account account)
{
int maxId;
if (accounts.Count > 0)
{
maxId = accounts.Max(g => g.Max(a => a.Id));
}
else
{
maxId = -1;
}
account.Id = maxId + 1;
var group = accounts.FirstOrDefault(g => g.Key == account.Category);
if (group == null)
{
@ -142,7 +131,7 @@ namespace Billing.Views
private async void AccountChecked(object sender, AccountEventArgs e)
{
var add = e.Account.Id < 0;
var add = e.Account.Id <= 0;
if (add)
{
App.Accounts.Add(e.Account);