Пример #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
        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));
            }
        }