Beispiel #1
0
        //权限角色管理页面查询(分页查询)
        public ActionResult PowerSelectFen(int currentPage, string name)
        {
            var pageSize = 3;
            int rows;

            List <info_Role> dt;

            if (name == "" && name == null)
            {
                //普通查询
                dt = irb.FenYe(e => e.RoleID, e => e.RoleID > 0, out rows, currentPage, pageSize);
            }
            else
            {
                //带条件查询
                dt = irb.FenYe(e => e.RoleID, e => e.RoleName.Contains(name), out rows, currentPage, pageSize);
            }
            Dictionary <string, object> dir = new Dictionary <string, object>();

            dir.Add("data", dt);
            dir.Add("rows", rows);
            dir.Add("currentpage", rows % 2 > 0 ? (rows / 2) + 1 : (rows / 2));
            dir.Add("pages", (rows - 1) / pageSize + 1);
            return(Content(JsonConvert.SerializeObject(dir)));
        }