public async Task <double[, ]> GetAccounts(int year, int month) { var days = DateTime.DaysInMonth(year, month); var ans = new double[days, 2]; var accountLists = await AccountItemDao.GetAccounts(year, month); accountLists.ForEach(item => { var index = item.Day - 1; if (item.Category.Type == ItemType.Income) { ans[index, 0] += item.Money; } else { ans[index, 1] += item.Money; } }); return(ans); }
public async Task <List <AccountItem> > GetAllAccounts() { return(await AccountItemDao.GetAccounts()); }