public ActionResult LoginCheck(User us )
        {
            var type= Request["optradio"];
            //User us = new User();
            //us.UserName=Request["email"];
            //us.Password=Request["password"];
            //var usr=db.Users.First(x=>x.UserName==us.UserName && x.Password==us.Password);
            var usr = from x in db.Users
                      where (x.UserName == us.UserName && x.Password == us.Password)
                      select x;

            if (usr != null )
            {
                if (type.ToString() == "User")
                {
                    return RedirectToAction("Successful");
                }
                else if(type.ToString() =="Admin")
                {
                    return RedirectToAction("SuccessfulAdmin");
                }
            }
            return RedirectToAction("Login");
        }
Esempio n. 2
0
 partial void UpdateUser(User instance);
Esempio n. 3
0
 partial void DeleteUser(User instance);
Esempio n. 4
0
 partial void InsertUser(User instance);