public IActionResult Deposit(int id, BankAccountDepositViewModel bankAccountDepositViewModel) { if (ModelState.IsValid) { try { bool depositOperationResult = bankAccountRepository.DepositAmountIntoBankAccount(id, bankAccountDepositViewModel.AmountCurrent, bankAccountDepositViewModel.AmountToDeposit, bankAccountDepositViewModel.ModifiedDate); if (depositOperationResult) { return(RedirectToAction("Index", "BankAccount", new { @id = id })); } } catch (InvalidBankAccountModifiedTimeStamp ex) { //ViewData["AmountToDepositError"] = "The Amount of the Bank account has been modified Please, refresh the page and try to deposit again!"; return(RedirectToAction("Deposit", "BankAccount", new { @id = id })); } catch (Exception ex) { ModelState.AddModelError(string.Empty, "Something wen wrong! Please retry the operation!"); } } return(View(bankAccountDepositViewModel)); }