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); }
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)); } }