public ActionResult ProductList() { BestStoreEntities db = new BestStoreEntities(); return(View(db.PRODUCT)); }
public ActionResult Register([Bind(Include = "USERID,EMAIL,ADRESS,PASSWORD")] USER user) { if (ModelState.IsValid) { using (BestStoreEntities db = new BestStoreEntities()) { db.USER.Add(user); db.SaveChanges(); return(RedirectToAction("Index")); } } return(View(user)); }
public ActionResult Login(USER objUser) { if (ModelState.IsValid) { using (BestStoreEntities db = new BestStoreEntities()) { var obj = db.USER.FirstOrDefault(a => a.EMAIL.Equals(objUser.EMAIL) && a.PASSWORD.Equals(objUser.PASSWORD)); if (obj != null) { Session["UserID"] = obj.USERID.ToString(); Session["UserName"] = obj.EMAIL.ToString(); return(RedirectToAction("Index")); } } } return(View(objUser)); }