public ActionResult Login(LoginDetails_3 l) { if (ModelState.IsValid) { DB03TMS155_1718Entities db = new DB03TMS155_1718Entities(); ObjectParameter or = new ObjectParameter("LoginID_3", 0); db.sp_LoginDetails_3(or, l.UserName_3, l.UserPassword_3); if (Convert.ToInt32(or.Value) > 0) { ObjectParameter tt = new ObjectParameter("UserRole_3", typeof(string)); db.sp_LoginDetails_003(l.UserName_3, tt); string r = tt.Value.ToString(); if (r == "CAE") { return(RedirectToAction("CreateCustomer", "Customer")); } else { return(RedirectToAction("CreateAccount", "Account")); } } else { Response.Write("<script>alert('invalid credentials')</script>"); } ModelState.Clear(); } return(View()); }
public ActionResult withdrawmoney(FormCollection f, AccountDetails_3 c) { DB03TMS155_1718Entities db = new DB03TMS155_1718Entities(); ObjectParameter o = new ObjectParameter("flag", 0); int amount = Convert.ToInt32(f["txtWithdraw"]); AccountDetails_3 p2 = new AccountDetails_3(); p2 = db.AccountDetails_3.Find(Convert.ToInt64(Session["Account_ID"])); if (p2 == null) { Response.Write("<script>alert('Account ID does not exist')</script>"); } else { db.sp_withdraw(Convert.ToInt64(Session["Account_ID"]), amount, o); if (Convert.ToInt32(o.Value) == 0) { TempData["AlertMessage"] = 10; return(RedirectToAction("withdrawmoney")); } else { TempData["AlertMessage"] = 1; return(RedirectToAction("Viewaftertrans")); } } return(View()); }
public ActionResult withdrawmoney() { DB03TMS155_1718Entities db = new DB03TMS155_1718Entities(); long id = Convert.ToInt64(Session["Account_ID"]); AccountDetails_3 abc = db.AccountDetails_3.Find(id); return(View(abc)); }
public ActionResult depositmoney() { DB03TMS155_1718Entities db = new DB03TMS155_1718Entities(); long id = Convert.ToInt64(Session["Account_ID"]); AccountDetails_3 abc = db.AccountDetails_3.Find(id); if (abc == null) { TempData["AlertMessage"] = 18; return(RedirectToAction("searchdeposit")); } else { return(View(abc)); } return(View()); }
public ActionResult depositmoney(FormCollection f) { DB03TMS155_1718Entities db = new DB03TMS155_1718Entities(); ObjectParameter o = new ObjectParameter("flag", 0); int amount = Convert.ToInt32(f["txtDeposit"]); AccountDetails_3 p2 = new AccountDetails_3(); p2 = db.AccountDetails_3.Find(Convert.ToInt64(Session["Account_ID"])); db.sp_deposit1(Convert.ToInt64(Session["Account_ID"]), amount, o); if (Convert.ToInt32(o.Value) == 0) { TempData["AlertMessage"] = 13; return(RedirectToAction("depositmoney")); } else { TempData["AlertMessage"] = 1; return(RedirectToAction("Viewaftertrans")); } return(View()); }