Ejemplo n.º 1
0
        public ActionResult DataLoad()
        {
            try
            {
                string TTypeID  = Request.Form["TTypeID"].ToString();
                int    pageSize = int.Parse(Request.Form["rows"]);
                //获取请求的页码
                int pageIndex = int.Parse(Request.Form["page"]);
                int rowCount  = 0;

                // 查询分页数据
                var list = new M_DictionaryBLL().GetPagedList(pageIndex, pageSize, ref rowCount, p => p.TypeID == TTypeID, p => p.SN).Select(p => p.ToPOCO());
                Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel()
                {
                    total  = rowCount,
                    rows   = list,
                    footer = null
                };
                return(Json(dgModel));
            }
            catch
            {
                return(this.Json(""));
            }
        }
        //根据父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);
        }
Ejemplo n.º 3
0
        //根据父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));
        }
Ejemplo n.º 4
0
        public ActionResult DataLoad()
        {
            try
            {
                string TTypeID = Request.Form["TTypeID"].ToString();
                int pageSize = int.Parse(Request.Form["rows"]);
                //获取请求的页码
                int pageIndex = int.Parse(Request.Form["page"]);
                int rowCount = 0;

                // 查询分页数据
                var list = new M_DictionaryBLL().GetPagedList(pageIndex, pageSize, ref rowCount, p => p.TypeID == TTypeID, p => p.SN).Select(p => p.ToPOCO());
                Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel()
                {
                    total = rowCount,
                    rows = list,
                    footer = null
                };
                return Json(dgModel);
            }
            catch
            {
                return this.Json("");
            }
        }
Ejemplo n.º 5
0
        public ActionResult LoadDictionaryType()
        {
            int pageSize = int.Parse(Request.Form["rows"]);
            //获取请求的页码
            int pageIndex            = int.Parse(Request.Form["page"]);
            int rowCount             = 0;
            TDictionaryTypeBLL dtbll = new TDictionaryTypeBLL();

            // 查询分页数据
            var list = dtbll.GetPagedList(pageIndex, pageSize, ref rowCount, p => p.TypeID.Length > 0, p => p.ID).Select(p => p.ToPOCO());

            // 生成规定格式的 json字符串发回 给异步对象
            Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel()
            {
                total  = rowCount,
                rows   = list,
                footer = null
            };
            return(Json(dgModel));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 查询子权限列表数据
        /// </summary>
        /// <returns></returns>
        public ActionResult PermissionSon(FormCollection form)
        {
            //获取页容量
            int pageSize = int.Parse(form["rows"]);
            //获取请求的页码
            int pageIndex = int.Parse(form["page"]);
            //获取父权限id
            int pid      = int.Parse(Request.QueryString["pid"]);
            int rowCount = 0;
            // 查询分页数据
            var list = new P_PermissionBLL().GetPagedList(pageIndex, pageSize, ref rowCount, p => p.ParentID == pid && p.IsActive == true, p => p.SN).Select(p => p.ToPOCO());

            //2 生成规定格式的 json字符串发回 给 异步对象
            Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel()
            {
                total  = rowCount,
                rows   = list,
                footer = null
            };
            return(Json(dgModel));
        }
Ejemplo n.º 7
0
        /// <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));
        }
Ejemplo n.º 8
0
        public ActionResult LoadDictionaryType()
        {
            int pageSize = int.Parse(Request.Form["rows"]);
            //获取请求的页码
            int pageIndex = int.Parse(Request.Form["page"]);
            int rowCount = 0;
            TDictionaryTypeBLL dtbll = new TDictionaryTypeBLL();

            // 查询分页数据
            var list = dtbll.GetPagedList(pageIndex, pageSize, ref rowCount, p => p.TypeID.Length > 0, p => p.ID).Select(p => p.ToPOCO());
            // 生成规定格式的 json字符串发回 给异步对象
            Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel()
            {
                total = rowCount,
                rows = list,
                footer = null
            };
            return Json(dgModel);
        }
Ejemplo n.º 9
0
 public ActionResult PermissionSon(FormCollection form)
 {
     //获取页容量
     int pageSize = int.Parse(form["rows"]);
     //获取请求的页码
     int pageIndex = int.Parse(form["page"]);
     //获取父权限id
     int pid = int.Parse(Request.QueryString["pid"]);
     int rowCount = 0;
     // 查询分页数据
     var list = new P_PermissionBLL().GetPagedList(pageIndex, pageSize, ref rowCount, p => p.ParentID == pid && p.IsActive == true, p => p.SN).Select(p => p.ToPOCO());
     //2 生成规定格式的 json字符串发回 给 异步对象
     Model.EasyUIModel.DataGridModel dgModel = new Model.EasyUIModel.DataGridModel()
     {
         total = rowCount,
         rows = list,
         footer = null
     };
     return Json(dgModel);
 }
Ejemplo n.º 10
0
        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);
        }