コード例 #1
0
        public async Task <ActionResult> ReplenishBankAccount(ReplenishBankAccountModel model)
        {
            try
            {
                await bankAccountService.CheckBankAccount(model.NumberBankAccount);
            }
            catch (ValidationBusinessLogicException exception)
            {
                ModelState.AddModelError(exception.Property, exception.Message);
            }
            if (ModelState.IsValid)
            {
                var mapper = new MapperConfiguration(cfg => cfg.CreateMap <ReplenishBankAccountModel,
                                                                           ReplenishBankAccountDTO>()).CreateMapper();
                var paymentsCurrentBankAccount = mapper.Map <ReplenishBankAccountModel,
                                                             ReplenishBankAccountDTO>(model);
                await paymentService.ReplenishBankAccount(paymentsCurrentBankAccount);

                logger.Info("Клиент подготовил пополнение с помощью банковского счета id = {0} " +
                            "банковский счет с NumberBankAccount = {1}", model.BankAccountId, model.NumberBankAccount);

                return(RedirectToAction("PreparedPaymentsData"));
            }
            return(View(model));
        }
コード例 #2
0
        public ActionResult ReplenishBankAccount(int id)
        {
            ReplenishBankAccountModel replenishBankAccountModel = new ReplenishBankAccountModel();

            replenishBankAccountModel.BankAccountId = id;
            return(View(replenishBankAccountModel));
        }