public ActionResult List(int page, int rows, string sidx, string sord) { var roles = new RoleService().List(); bool searchOn = bool.Parse(Request.Form["_search"]); string searchExp = ""; if (searchOn) { searchExp = string.Format("{0}.ToString().Contains(@0)", getFormValue("searchField")); roles = roles.Where(searchExp, new string[] { getFormValue("searchString") }); } var model = from entity in roles.OrderBy(sidx + " " + sord) select new { Id = entity.Id, RoleName = entity.RoleName, IsFullPermission = entity.IsFullPermission, AllowManageContent = entity.AllowManageAllContent, AllowManageUser = entity.AllowManageUser, AllowManageBanner = entity.AllowManageBanner, AllowManageContact = entity.AllowManageContact, AllowManageLink = entity.AllowManageLink, AllowManageMenu = entity.AllowManageMenu, AllowManageOnlineSupporter = entity.AllowManageOnlineSupporter, AllowManagePoll = entity.AllowManagePoll, AllowManageRole = entity.AllowManageRole, }; return Json(model.ToJqGridData(page, rows, null, "", new[] { "RoleName" }), JsonRequestBehavior.AllowGet); }
public ActionResult FullList(int page, int rows, string sidx, string sord) { var roles = new RoleService().List(); bool searchOn = bool.Parse(Request.Form["_search"]); string searchExp = ""; var model = from entity in roles.OrderBy(sidx + " " + sord) select new { Id = entity.Id, RoleName = entity.RoleName, IsFullPermission = entity.IsFullPermission, AllowManageContent = entity.AllowManageAllContent, AllowManageUser = entity.AllowManageUser, AllowManageBanner = entity.AllowManageBanner, AllowManageContact = entity.AllowManageContact, AllowManageLink = entity.AllowManageLink, AllowManageMenu = entity.AllowManageMenu, AllowManageOnlineSupporter = entity.AllowManageOnlineSupporter, AllowManagePoll = entity.AllowManagePoll, AllowManageRole = entity.AllowManageRole, Permission = "roleid_" + entity.Id.ToString() }; return Json(model.ToJqGridData(page, rows, null, "", new[] { "Name"}), JsonRequestBehavior.AllowGet); }