public UserInfoSearchDTO GetUserInfoSearchDTO() { UserInfoSearchDTO dto = new UserInfoSearchDTO(); dto.PurviewMap = GetPurviewMap(); return(dto); }
public ActionResult AjaxGetList(UserInfoSearchDTO searchDTO) { var listDTO = _userInfoService.GetUserInfoList(searchDTO); return(Json(new { sEcho = searchDTO.sEcho, iTotalRecords = listDTO.TotalRecords, iTotalDisplayRecords = listDTO.TotalRecords, aaData = listDTO.List }, JsonRequestBehavior.AllowGet)); }
public UserInfoListDTO GetUserInfoList(UserInfoSearchDTO searchDTO) { UserInfoListDTO result = new UserInfoListDTO(); searchDTO.UserStatus = UserStatusEnum.Valid; long totalCount = 0; var entityList = this._userInfoRepository.GetUserInfoList(searchDTO, out totalCount); result.TotalRecords = totalCount; var purviewMap = GetPurviewMap(); result.List = entityList.Select(m => CreateUserInfoListItemDTO(m, purviewMap)).ToList(); return(result); }
public List <UserInfoEntity> GetUserInfoList(UserInfoSearchDTO searchDTO, out long totalCount) { var sqlExp = db.From <UserInfoEntity>(); if (searchDTO.UserID.HasValue) { sqlExp.Where(m => m.UserID == searchDTO.UserID); } if (!string.IsNullOrEmpty(searchDTO.LoginName)) { sqlExp.Where(m => m.LoginName == searchDTO.LoginName); } if (!string.IsNullOrEmpty(searchDTO.RealName)) { sqlExp.Where(m => m.RealName == searchDTO.RealName); } if (searchDTO.PurviewID > 0) { sqlExp.Where(m => m.PurviewID == searchDTO.PurviewID); } if (searchDTO.UserStatus.HasValue) { sqlExp.Where(m => m.UserStatus == searchDTO.UserStatus); } totalCount = base.Count(sqlExp); sqlExp.Limit((searchDTO.PageIndex - 1) * searchDTO.iDisplayLength, searchDTO.iDisplayLength); var list = base.QueryWhere(sqlExp); return(list); }