Ejemplo n.º 1
0
        public ActionResult GetAllUserGroup(string SName)
        {
            //拿到前台发送来的是当前页面和页的大小
            int pageSize  = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            int total     = 0;

            short delNormal = (short)Model.Enum.DelFlagEnum.Normal;

            #region 分页查询
            var userGroupList = UserGroupService.LoadPageEntities(pageSize, pageIndex, out total, d => d.DelFlag == delNormal && d.Name.Contains(SName), d => d.Code,
                                                                  true);

            var data = new
            {
                total = total,
                rows  = (from u in userGroupList
                         select
                         new { u.ID, u.Code, u.Name }).ToList()
            };

            return(Json(data, JsonRequestBehavior.AllowGet));

            #endregion
        }