public ActionResult LoanApproval(LoanApprovalModel lam) { IBusinessBanking ibank = GenericFactory <Business, IBusinessBanking> .GetInstance(); UserInfo ui = CookieFacade.USERINFO; if (ui.Username != "mark") { ViewBag.Message = "Only manager is available to change the loan status.."; } try { if (ModelState.IsValid && ui.Username == "mark") { bool ret = ibank.LoanApproval(ui.CheckingAcccountNumber, ui.SavingAccountNumber, lam.Amount, lam.UserName); if (ret == true) { ViewBag.Message = "Loan status changed successfully.."; ModelState.Clear(); // otherwise, textbox will display the old amount lam.Status = "Approved"; } } } catch (Exception ex) { ViewBag.Message = ex.Message; } //alm.Amount = ibank.GetAmountDue(ui.CheckingAcccountNumber); return(View(lam)); }