コード例 #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);
 }