コード例 #1
0
        public async Task <ActionResult> CreateBankAccount()
        {
            string nameCurrentUser = User.Identity.Name;
            string idCurrentUser   = await UserService.FindUserIdAsync(nameCurrentUser);

            CreatureBankAccountModel model = new CreatureBankAccountModel
            {
                ApplicationUserId = idCurrentUser
            };

            return(View(model));
        }
コード例 #2
0
        public async Task <ActionResult> CreateBankAccount(CreatureBankAccountModel model)
        {
            if (ModelState.IsValid)
            {
                CreatureBankAccountDTO creatureBankAccountDTO = new CreatureBankAccountDTO(model.ApplicationUserId,
                                                                                           model.NumberCard, model.Name);

                await bankAccountService.CreateBankAccount(creatureBankAccountDTO);

                logger.Info("Клиент {0} создал новый банковский счет", model.ApplicationUserId);

                return(RedirectToAction("BankAccountsData", "BankAccount"));
            }
            return(View(model));
        }