Ejemplo n.º 1
0
        public async Task <IActionResult> CreditAccount(string id)
        {
            //needs to implement update function

            var decryptedId = GuidEncoder.Decode(id);
            var account     = await _accountRepository.FindAsync(decryptedId.ToString());

            if (!account.IsBlocked)
            {
                ViewBag.AccountTypesLeftForfundTransfer = await _accountTypeRepository.FindAllAccountTypesByAccountTypeIdAsync(account.AccountTypeId);

                ViewBag.OrderByTypes = await GetOrderByTypesAsync();

                ViewBag.TransactionTypes = await GetTransactionTypeAsync();

                var newTransaction = new AccountTransactionViewModel()
                {
                    AccUriKey           = GuidEncoder.Encode(account.AccountId),
                    AppUserUriKey       = GuidEncoder.Encode(account.AppUserId),
                    IdUriKey            = GuidEncoder.Encode(account.Id),
                    AccountTypeIdUriKey = GuidEncoder.Encode(account.AccountTypeId),
                    UiControl           = "Credit"
                };



                return(View("TransferFund", newTransaction));
            }
            //Todo: more informative view
            return(View());
        }