public PaginationList <DepartmentContract> Get(string createdBy, string searchString, string[] properties, int page, int pageSize, string sort, string orderBy = "desc") { Expression <Func <V_DEPT_DEPT, bool> > condition = p => p.DEPT_INFO_ISDEL == 0 && p.DEPT_INFO_ISSUP == 0; if (!string.IsNullOrEmpty(searchString)) { condition = (p => p.DEPT_INFO_ISDEL == 0 && p.DEPT_INFO_ISSUP == 0 && (p.DEPT_INFO_NAME.Contains(searchString) || p.DEPT_INFO_PARENTNAME.Contains(searchString) || p.DEPT_INFO_ADDRESS.Contains(searchString) || p.GEO_INFO_NAME.Contains(searchString))); } var sortMap = QueryableBuilderExtensions.GetMappingPropertyName <DepartmentContract, V_DEPT_DEPT>(sort); if (properties != null && properties.Length > 0) { var selector = QueryableBuilderExtensions.BuildSelectorClause <V_DEPT_DEPT, DepartmentContract>(properties); return(_depDepAuthorizeRepository.GetPagerByUser(createdBy, selector, condition, sortMap ?? "DEPT_INFO_CREATEDDATE", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize)); } var pager = _depDepAuthorizeRepository.GetPagerByUser(createdBy, condition, sortMap ?? "DEPT_INFO_CREATEDDATE", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize); return(new PaginationList <DepartmentContract>(pager.Items.ConvertAll(p => p.ToContract())) { TotalCount = pager.TotalCount, PageSize = pageSize }); }
/// <summary> /// 供应商账号分页列表 /// </summary> /// <param name="searchString"></param> /// <param name="properties"></param> /// <param name="page"></param> /// <param name="pageSize"></param> /// <param name="sort"></param> /// <param name="orderBy"></param> /// <returns></returns> public PaginationList <UserContract> GetSup(string searchString, string[] properties, int page, int pageSize, string sort, string orderBy = "desc") { Expression <Func <V_USER_ROLE_DEPT, bool> > condition = p => p.USER_INFO_ISDEL == 0 && p.DEPT_INFO_ISDEL == 0 && p.DEPT_INFO_ISSUP == 1 && p.USER_INFO_ISSUP == 1 && p.USER_INFO_STATE == "0"; if (!string.IsNullOrEmpty(searchString)) { condition = (p => p.USER_INFO_ISDEL == 0 && p.DEPT_INFO_ISSUP == 1 && p.USER_INFO_ISSUP == 1 && p.DEPT_INFO_ISDEL == 0 && p.USER_INFO_STATE == "0" && (p.USER_INFO_NICKNAME.Contains(searchString) || p.DEPT_INFO_NAME.Contains(searchString))); } var sortMap = QueryableBuilderExtensions.GetMappingPropertyName <UserContract, V_USER_ROLE_DEPT>(sort); if (properties != null && properties.Length > 0) { var selector = QueryableBuilderExtensions.BuildSelectorClause <V_USER_ROLE_DEPT, UserContract>(properties); return(_userRoleDepartmentViewRepository.GetPager(selector, condition, sortMap ?? "USER_INFO_CREATEDDATE", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize)); } var pager = _userRoleDepartmentViewRepository.GetPager(condition, sortMap ?? "USER_INFO_CREATEDDATE", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize); return(new PaginationList <UserContract>(pager.Items.ConvertAll(p => p.ToUserContract())) { TotalCount = pager.TotalCount, PageSize = pageSize }); }
public PaginationList <UserContract> Get(ExpressionCriteriaBase[] criteria, int page, int pageSize, string sort, string orderBy = "desc") { Expression <Func <V_USER_ROLE_DEPT, bool> > condition = ExpressionUtils.BuildCondition <V_USER_ROLE_DEPT>(criteria); var sortMap = QueryableBuilderExtensions.GetMappingPropertyName <UserContract, V_USER_ROLE_DEPT>(sort); var pager = _userRoleDepartmentViewRepository.GetPager(condition, sortMap ?? "USER_INFO_CREATEDDATE", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize); return(new PaginationList <UserContract>(pager.Items.ConvertAll(p => p.ToUserContract())) { TotalCount = pager.TotalCount, PageSize = pageSize }); }
public PaginationList <AreaContract> Get(ExpressionCriteriaBase[] criteria, int page, int pageSize, string sort, string orderBy = "desc") { Expression <Func <BASE_GEO_INFO, bool> > condition = ExpressionUtils.BuildCondition <BASE_GEO_INFO>(criteria); var sortMap = QueryableBuilderExtensions.GetMappingPropertyName <AreaContract, BASE_GEO_INFO>(sort); var pager = _areaRepository.GetPager(condition, sortMap ?? "GEO_INFO_ORDER", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize); return(new PaginationList <AreaContract>(pager.Items.ConvertAll(p => p.ToContract())) { TotalCount = pager.TotalCount, PageSize = pageSize }); }
public PaginationList <DepartmentContract> Get(string createdBy, ExpressionCriteriaBase[] criteria, string[] properties, int page, int pageSize, string sort, string orderBy = "desc") { Expression <Func <V_DEPT_DEPT, bool> > condition = ExpressionUtils.BuildCondition <V_DEPT_DEPT>(criteria); var sortMap = QueryableBuilderExtensions.GetMappingPropertyName <DepartmentContract, V_DEPT_DEPT>(sort); if (properties != null && properties.Length > 0) { Expression <Func <V_DEPT_DEPT, DepartmentContract> > selector = QueryableBuilderExtensions.BuildSelectorClause <V_DEPT_DEPT, DepartmentContract>(properties); return(_depDepAuthorizeRepository.GetPagerByUser(createdBy, selector, condition, sortMap ?? "DEPT_INFO_CREATEDDATE", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize)); } var pager = _depDepAuthorizeRepository.GetPagerByUser(createdBy, condition, sortMap ?? "DEPT_INFO_CREATEDDATE", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize); return(new PaginationList <DepartmentContract>(pager.Items.ConvertAll(p => p.ToContract())) { TotalCount = pager.TotalCount, PageSize = pageSize }); }
public PaginationList <SelectValueContract> Get(string searchString, int page, int pageSize, string sort, string orderBy = "desc") { Expression <Func <BASE_SELECTE_VALUE_INFO, bool> > condition = p => true; if (!string.IsNullOrEmpty(searchString)) { condition = (p => true && (p.Name.Contains(searchString) || p.Belong.Contains(searchString))); } var sortMap = QueryableBuilderExtensions.GetMappingPropertyName <SelectValueContract, BASE_SELECTE_VALUE_INFO>(sort); var pager = _selectBaseRepository.GetPager(condition, sortMap ?? "Belong", orderBy ?? "asc", Math.Max(page - 1, 0) * pageSize, pageSize); return(new PaginationList <SelectValueContract>(pager.Items.ConvertAll(p => p.ToContract())) { TotalCount = pager.TotalCount, PageSize = pageSize }); }
public PaginationList <AreaContract> Get(string searchString, int page, int pageSize, string sort, string orderBy = "desc") { Expression <Func <BASE_GEO_INFO, bool> > condition = p => p.GEO_INFO_ISDEL == 0; if (!string.IsNullOrEmpty(searchString)) { condition = (p => p.GEO_INFO_ISDEL == 0 && (p.GEO_INFO_NAME.Contains(searchString) || p.GEO_INFO_CODE.Contains(searchString))); } var sortMap = QueryableBuilderExtensions.GetMappingPropertyName <AreaContract, BASE_GEO_INFO>(sort); var pager = _areaRepository.GetPager(condition, sortMap ?? "GEO_INFO_ORDER", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize); return(new PaginationList <AreaContract>(pager.Items.ConvertAll(p => p.ToContract())) { TotalCount = pager.TotalCount, PageSize = pageSize }); }
public PaginationList <RoleContract> GetByUser(string createdBy, string searchString, int page, int pageSize, string sort, string orderBy = "desc") { Expression <Func <BASE_ROLE_INFO, bool> > condition = p => p.IsDel == 0; if (!string.IsNullOrEmpty(searchString)) { condition = (p => p.IsDel == 0 && (p.ROLE_INFO_NAME.Contains(searchString))); } var sortMap = QueryableBuilderExtensions.GetMappingPropertyName <RoleContract, BASE_ROLE_INFO>(sort); var pager = _roleAuthorizeRepository.GetPagerByUser(createdBy, condition, sortMap ?? "ROLE_INFO_CREATEDDATE", orderBy ?? "desc", Math.Max(page - 1, 0) * pageSize, pageSize); return(new PaginationList <RoleContract>(pager.Items.ConvertAll(p => p.ToContract())) { TotalCount = pager.TotalCount, PageSize = pageSize }); }