Пример #1
0
        public async Task OnGetAsync(int id)
        {
            var account = await _accountQueries.GetById(id);

            await PrepareModelsAsync(account.Id);

            Account = account.ToEditAccount();
        }
Пример #2
0
        private async Task PrepareModelsAsync(TransactionFilterViewModel filterViewModel)
        {
            Account = await _accountQueries.GetById(filterViewModel.AccountId);

            Transactions = await _transactionQueries.GetAllTransactions(Filter.ToFilter(), new PaginationArgs
            {
                PageNumber   = filterViewModel.PageNumber,
                ItemsPerPage = _userSettings.ItemsPerPage
            });
        }
Пример #3
0
        public async Task OnGetAsync(int billId)
        {
            Bill = await _expensesBillQueries.GetById(billId);

            ExpenseFlow = await _expenseFlowQueries.GetById(Bill.ExpenseFlowId);

            Account = Bill.AccountId != null ? await _accountQueries.GetById(Bill.AccountId.Value) : null;

            Day    = Bill.DateTime.Date.ToStandardString();
            BillId = Bill.Id;
        }
Пример #4
0
        private async Task <EditIncome> GetEditIncomeAsync(int id)
        {
            var incomeItem = await _incomesQueries.GetById(id);

            Income = incomeItem.ToViewModel();
            var account = await _accountQueries.GetById(Income.AccountId);

            Income.Account = account?.Name;
            var incomeType = await _incomeTypeQueries.GetById(Income.IncomeTypeId);

            Income.IncomeType = incomeType?.Name;
            return(Income);
        }
Пример #5
0
        public async Task OnGetAsync(int id, bool correcting = false, string returnPage = "./AccountsList")
        {
            var account = correcting ? null : await _accountQueries.GetById(id);

            Topup = new TopupAccount
            {
                Id          = id,
                Correcting  = correcting,
                AccountName = account?.Name,
                TopupDate   = _timeService.ClientLocalNow.ToStandardString(false),
                ReturnPage  = returnPage,
            };
            IncomeTypes = await _incomeTypeQueries.GetAll();

            Accounts = await _accountQueries.GetAll();

            if (correcting)
            {
                var balanceState = await _inventorizationQueries.GetBalanceState();

                Topup.Amount = balanceState.Balance.ToStandardString();
            }
        }