예제 #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());
 }
예제 #3
0
 public Task <bool> ExistByCategoryId(int categoryId)
 {
     return(AccountItemDao.ExistByCategoryId(categoryId));
 }
예제 #4
0
 public async Task <AccountItem> GetItemById(int accountItemId)
 {
     return(await AccountItemDao.GetAccountItemById(accountItemId));
 }
예제 #5
0
 public void DeleteById(int accountItemId)
 {
     AccountItemDao.DeleteById(accountItemId);
 }
예제 #6
0
 public void Update(AccountItem item)
 {
     AccountItemDao.Update(item);
 }
예제 #7
0
 public async Task <List <AccountItem> > GetAccountOrderByDate(int year, int month)
 {
     return(await AccountItemDao.GetAccountItemOrderByDate(year, month));
 }
예제 #8
0
 public void AddAccount(AccountItem item)
 {
     AccountItemDao.AddAccount(item);
 }