コード例 #1
0
        public bool Update(ClientBankAccountDetailsVM account)
        {
            var  clientRepo    = new ClientRepo(_context);
            bool clientSuccess = clientRepo.Update(account.ClientID, account.FirstName, account.LastName);

            var  bankAccountRepo    = new BankAccountRepo(_context);
            bool bankAccountSuccess = bankAccountRepo.Update(account.AccountNum, account.Balance);

            return(clientSuccess && bankAccountSuccess);
        }
コード例 #2
0
ファイル: AccountsController.cs プロジェクト: dl90/CSharp
        public IActionResult Edit(ClientBankAccountDetailsVM account)
        {
            if (ModelState.IsValid)
            {
                bool success = _clientBankAccountRepo.Update(account);
                if (!success)
                {
                    return(View(account));
                }
            }

            try
            {
                return(RedirectToAction("Details", "Accounts", account));
            }
            catch
            {
                return(View(account));
            }
        }