Exemple #1
0
        public ActionResult ProductList()
        {
            BestStoreEntities db = new BestStoreEntities();


            return(View(db.PRODUCT));
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        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));
        }