public ActionResult Index(string loginname, string password) { var res = new UsersBLL().SelectWhere(u => u.U_Password == password && u.U_LoginName == loginname && u.U_Role != 3 && u.U_Role != 4); if (res.Any()) { Session["user"] = res.FirstOrDefault(); return Content("ok"); } return Content("erro"); }