Example #1
0
        //管理员登录页面
        public ActionResult AdminLogin(string name, string pass)
        {
            Admin admin = new Admin();

            admin.name = name;
            admin.pass = pass;
            Admin loginadmin = dbDrive.AdminLogin(admin);

            if (loginadmin != null)
            {
                if (loginadmin.state.Equals("禁用"))
                {
                    return(Json(false));
                }
                int  roleid = loginadmin.role;
                Role role   = dbDrive.FindRole(roleid);
                Session["limit"]      = role.limit;
                Session["Admin"]      = loginadmin;
                LangleyPublic.adminId = loginadmin.id;
                return(Json(true));
            }
            return(Json(false));
        }