Beispiel #1
0
        // 登录
        public ActionResult Logins(string userName, string pwd)
        {
            MPMSEntities mpms = new MPMSEntities();
            Users        us   = mpms.Users.FirstOrDefault(x => x.U_LoginName == userName && x.U_Password == pwd);

            if (us != null)
            {
                Session["Users"] = us;
                FormsAuthentication.SetAuthCookie((Session["Users"] as Users).U_LoginName, false);
                return(Json(true, JsonRequestBehavior.AllowGet));
            }

            return(Json(false, JsonRequestBehavior.AllowGet));
        }