Beispiel #1
0
        public async Task <IActionResult> All(int pageIndex = 1)
        {
            pageIndex = Math.Max(1, pageIndex);

            var userId = await this.userService.GetUserIdByUsernameAsync(this.User.Identity.Name);

            var allTransactions =
                (await this.transactionService.GetTransactionsAsync <TransactionListingServiceModel>(userId, pageIndex, PaymentsCountPerPage))
                .Select(Mapper.Map <TransactionListingDto>)
                .ToPaginatedList(await this.transactionService.GetCountOfAllTransactionsForUserAsync(userId), pageIndex, PaymentsCountPerPage);

            var transactions = new TransactionListingViewModel
            {
                Transactions = allTransactions
            };

            return(this.View(transactions));
        }
Beispiel #2
0
        public async Task <IActionResult> Result(string referenceNumber)
        {
            if (referenceNumber == null)
            {
                return(this.NotFound());
            }

            var moneyTransfers = (await this.moneyTransfer
                                  .GetMoneyTransferAsync <MoneyTransferListingServiceModel>(referenceNumber))
                                 .Select(this.mapper.Map <MoneyTransferListingDto>);

            var viewModel = new TransactionListingViewModel
            {
                MoneyTransfers  = moneyTransfers,
                ReferenceNumber = referenceNumber
            };

            return(this.View(viewModel));
        }