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"); }
partial void UpdateUser(User instance);
partial void DeleteUser(User instance);
partial void InsertUser(User instance);