public ActionResult GetAllUserInfos(string SLoginName, string SShowName) { //拿到前台发送来的是当前页面和页的大小 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 分页查询 string strCondLoginName = SLoginName ?? ""; string strCondShowName = SShowName ?? ""; var userList = UserInfoService.LoadPageEntities(pageSize, pageIndex, out total, d => d.DelFlag == delNormal && d.Code.Contains(strCondLoginName) && d.Name.Contains(strCondShowName), d => d.UserGroupID, true); var userGroupList = UserGroupService.LoadEntities(d => 1 == 1); var data = new { total = total, rows = (from u in userList join ug in userGroupList on u.UserGroupID equals ug.ID orderby ug.Code, u.Code select new { u.ID, u.Code, u.Name, TakeEffect = u.TakeEffect == true ? "是" : "否", u.DelFlag, u.SubTime, u.SubBy }).ToList() }; return(Json(data, JsonRequestBehavior.AllowGet)); #endregion }