Example #1
0
        public async Task <IActionResult> Index(SortModel model)
        {
            int pageSize = 15;

            var incomeTransactions = await _transactionsRepository.GetPagedIncomeTransactions(model.Page, pageSize);

            var usersCount = await _transactionsRepository.GetCountOfIncomeTransactions();

            IncomeTransactionsViewModel viewModel = new IncomeTransactionsViewModel()
            {
                PageViewModel      = new PageViewModel(usersCount, model.Page, pageSize),
                IncomeTransactions = incomeTransactions ?? new List <IncomeTransactionTableModel>()
            };

            return(View("Views/Admin/IncomeTransactions.cshtml", viewModel));
        }
Example #2
0
        public async Task <ActionResult> IncomeTransactions(SortModel model)
        {
            int pageSize = 15;

            var incomeTransactions = await _transactionsRepository.GetPagedIncomeTransactions(model.Page, pageSize);

            var itemsCount = await _transactionsRepository.GetCountOfIncomeTransactions();



            IncomeTransactionsViewModel viewModel = new IncomeTransactionsViewModel()
            {
                PageViewModel      = new PageViewModel(itemsCount, model.Page, pageSize),
                IncomeTransactions = incomeTransactions ?? new List <IncomeTransactionTableModel>()
            };

            return(View(viewModel));
        }