예제 #1
0
        public ActionResult Index(tblUser user)
        {
            if (ModelState.IsValid)
            {
                using (WooFurnitureKartDbEntities oWooFurnitureKartDbEntities = new WooFurnitureKartDbEntities())
                {
                    var users = (from i in oWooFurnitureKartDbEntities.tblUsers
                                 where i.EmailId == user.EmailId && i.Password == user.Password
                                 select i).FirstOrDefault();


                    if (users != null)
                    {
                        Session["UserName"]  = users.UserName;
                        Session["UserID"]    = users.UserId;
                        Session["FirstName"] = users.FirstName;
                        Session["LastName"]  = users.LastName;
                        Session["SurName"]   = users.SurName;
                        FormsAuthentication.SetAuthCookie(user.EmailId, false);
                        return(RedirectToAction("Index", "Kart"));
                    }
                }
            }
            ModelState.AddModelError("", "invalid Username or Password");
            return(View());
        }
예제 #2
0
        public IEnumerable <PageVM> GetPages()
        {
            List <PageVM> listPages      = new List <ViewModels.PageVM>();
            WooFurnitureKartDbEntities o = new WooFurnitureKartDbEntities();


            return(listPages);
        }