public ActionResult TransferSavingToChecking(TransferSToCModel tcs) { IBusinessBanking ibank = GenericFactory <Business, IBusinessBanking> .GetInstance(); UserInfo ui = CookieFacade.USERINFO; try { if (ModelState.IsValid) { bool ret = ibank.TransferSavingToChecking(ui.CheckingAcccountNumber, ui.SavingAccountNumber, tcs.Amount); if (ret == true) { ViewBag.Message = "Transfer successful.."; ModelState.Clear(); // otherwise, textbox will display the old amount tcs.Amount = 0; } } } catch (Exception ex) { ViewBag.Message = ex.Message; } tcs.CheckingBalance = ibank.GetCheckingBalance(ui.CheckingAcccountNumber); tcs.SavingBalance = ibank.GetSavingBalance(ui.SavingAccountNumber); return(View(tcs)); }
public ActionResult TransferSavingToChecking() { TransferSToCModel tcs = new TransferSToCModel(); UserInfo ui = CookieFacade.USERINFO; IBusinessBanking ibank = GenericFactory <Business, IBusinessBanking> .GetInstance(); tcs.CheckingBalance = ibank.GetCheckingBalance(ui.CheckingAcccountNumber); tcs.SavingBalance = ibank.GetSavingBalance(ui.SavingAccountNumber); tcs.Amount = 5; ViewBag.Message = "There is a $5 fee to transfer from Saving Account To Checking Account"; return(View(tcs)); }