public ActionResult TransactionByNumber(TransactionDetails_3 t) { int a = Convert.ToInt32(Session["AccountID"]); int n = Convert.ToInt32(Session["TransactionNumber"]); return(View(db.transaction_by_number(a, n).ToList())); }
public ActionResult transfer(TransactionDetails_3 c, FormCollection f) { Session["Account_ID"] = f["txtAccountID1"]; long acc1 = Convert.ToInt64(f["txtAccountID1"]); long acc2 = Convert.ToInt64(f["txtAccountID2"]); int amount = Convert.ToInt32(f["txtAmount"]); AccountDetails_3 p1 = new AccountDetails_3(); AccountDetails_3 p2 = new AccountDetails_3(); p1 = db.AccountDetails_3.Find(acc1); p2 = db.AccountDetails_3.Find(acc2); if (p1 == null || p2 == null) { Response.Write("<script>alert('Account ID does not exist')</script>"); } else { ObjectParameter o = new ObjectParameter("flag", 0); db.sp_transfer(acc1, acc2, amount, o); if (Convert.ToInt32(o.Value) == 0) { TempData["AlertMessage"] = 1; return(RedirectToAction("transfer")); } else { TempData["AlertMessage"] = 2; return(RedirectToAction("Viewaftertrans")); } } return(View()); }