예제 #1
0
        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);
        }
예제 #2
0
 public async Task <List <AccountItem> > GetAllAccounts()
 {
     return(await AccountItemDao.GetAccounts());
 }