Пример #1
0
        public ActionResult GetRoleList(string rolename, int page = 1, int limit = 10)
        {
            var result = ResModelFactory.ResDefaultData <SystemRole>();
            SystemRoleService service = new SystemRoleService();
            int count = 0;

            Expression <Func <SystemRole, bool> > where = p => true;
            if (!string.IsNullOrEmpty(rolename))
            {
                where = p => p.RoleName == rolename;
            }
            var list = service.GetPages(limit, page, out count, where, o => o.RoleName, false);

            result.count = count;
            result.data  = list.ToArray();
            return(Json(result, JsonRequestBehavior.AllowGet));
        }