//根据父ID查询 public ActionResult DataLoad(int parentID) { int pageSize = int.Parse(Request.Form["rows"]); //获取请求的页码 int pageIndex = int.Parse(Request.Form["page"]); int rowCount = 0; P_PermissionBLL bll = new P_PermissionBLL(); //取权限list<Model>,new list<ID> 使用循环,将List<Model>中的ID 取出ADD进list<ID>中 再查询时,where 添加List<ID> contains(p.id) List <Model.P_Permission> mlist = UserOperateContext.Current.Session_UsrPermission.ToList(); List <int> listid = new List <int>(); for (int i = 0; i < mlist.Count; i++) { Model.P_Permission m = (Model.P_Permission)mlist[i]; listid.Add(m.ID); } // 查询分页数据 var list = bll.GetPagedList(pageIndex, pageSize, ref rowCount, p => p.ParentID == parentID && p.IsActive == true && listid.Contains(p.ID), p => p.SN).Select(p => p.ToPOCO()); // 生成规定格式的 json字符串发回 给异步对象 Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel() { total = rowCount, rows = list, footer = null }; return(Json(dgModel)); }
//根据父ID查询 public ActionResult DataLoad(int parentID) { int pageSize = int.Parse(Request.Form["rows"]); //获取请求的页码 int pageIndex = int.Parse(Request.Form["page"]); int rowCount = 0; P_PermissionBLL bll = new P_PermissionBLL(); //取权限list<Model>,new list<ID> 使用循环,将List<Model>中的ID 取出ADD进list<ID>中 再查询时,where 添加List<ID> contains(p.id) List<Model.P_Permission> mlist = UserOperateContext.Current.Session_UsrPermission.ToList(); List<int> listid = new List<int>(); for (int i = 0; i < mlist.Count; i++) { Model.P_Permission m = (Model.P_Permission)mlist[i]; listid.Add(m.ID); } // 查询分页数据 var list = bll.GetPagedList(pageIndex, pageSize, ref rowCount, p => p.ParentID == parentID && p.IsActive == true && listid.Contains(p.ID), p => p.SN).Select(p => p.ToPOCO()); // 生成规定格式的 json字符串发回 给异步对象 Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel() { total = rowCount, rows = list, footer = null }; return Json(dgModel); }
/// <summary> /// 权限列表 视图 /// </summary> /// <returns></returns> public ActionResult GetPermData() { //获取页容量 int pageSize = int.Parse(Request.Form["rows"]); //获取请求的页码 int pageIndex = int.Parse(Request.Form["page"]); int rowCount = 0; P_PermissionBLL bll = new P_PermissionBLL(); // 查询分页数据 var list = bll.GetPagedList(pageIndex, pageSize, ref rowCount, p => p.ParentID == 0 && p.IsActive == true, p => p.SN).Select(p => p.ToPOCO()); // 生成规定格式的 json字符串发回 给异步对象 Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel() { total = rowCount, rows = list, footer = null }; return(Json(dgModel)); }
public ActionResult GetPermData() { //获取页容量 int pageSize = int.Parse(Request.Form["rows"]); //获取请求的页码 int pageIndex = int.Parse(Request.Form["page"]); int rowCount = 0; P_PermissionBLL bll = new P_PermissionBLL(); // 查询分页数据 var list = bll.GetPagedList(pageIndex, pageSize, ref rowCount, p => p.ParentID == 0 && p.IsActive == true, p => p.SN).Select(p => p.ToPOCO()); // 生成规定格式的 json字符串发回 给异步对象 Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel() { total = rowCount, rows = list, footer = null }; return Json(dgModel); }