public PageResultDTO <AbstractUnitIndexDTOWithActions> GetAllUnitIndexCategoriesWithPagination(int pageSize, int pageIndex, QueryStringConditions queryStringConditions) { var fs = new ListFetchStrategy <UnitIndexCategory>(Enums.FetchInUnitOfWorkOption.NoTracking); var sortBy = QueryConditionHelper.GetSortByDictionary(queryStringConditions.SortBy); foreach (var item in sortBy) { fs.SortCriterias.Add(new StringSortCriteria <UnitIndexCategory>(item.Key, (item.Value.ToUpper() == "ASC") ? Enums.SortOrder.Ascending : Enums.SortOrder.Descending)); } fs.OrderBy(x => x.Id); fs.WithPaging(pageSize, pageIndex); unitIndexRep.GetAllUnitIndexCategory(fs); var res = new PageResultDTO <AbstractUnitIndexDTOWithActions>(); res.InjectFrom(fs.PageCriteria.PageResult); res.Result = fs.PageCriteria.PageResult.Result.Select(r => unitIndexWithActionsMapper.MapToModel(r)); return(res); }
public PageResultDTO <ClaimDTOWithAction> GetClaimsWithActions(long periodId, string employeeNo, int pageSize, int pageIndex, QueryStringConditions queryStringConditions) { var fs = new ListFetchStrategy <Claim>(Enums.FetchInUnitOfWorkOption.NoTracking); var sortBy = QueryConditionHelper.GetSortByDictionary(queryStringConditions.SortBy); foreach (var item in sortBy) { fs.SortCriterias.Add(new StringSortCriteria <Claim>(item.Key, (item.Value.ToUpper() == "ASC") ? Enums.SortOrder.Ascending : Enums.SortOrder.Descending)); } fs.OrderBy(x => x.Id); fs.WithPaging(pageSize, pageIndex); claimRep.FindBy(fs, employeeNo, new PeriodId(periodId)); var res = new PageResultDTO <ClaimDTOWithAction>(); res.InjectFrom(fs.PageCriteria.PageResult); res.Result = fs.PageCriteria.PageResult.Result.Select(r => claimDTOWithActionsMapper.MapToModel(r)).ToList(); return(res); }
public PageResultDTO <JobInPeriodDTOWithActions> GetAllJobs(long periodId, int pageSize, int pageIndex, QueryStringConditions queryStringConditions, string selectedColumns) { var fs = new ListFetchStrategy <Job>(Enums.FetchInUnitOfWorkOption.NoTracking); var sortBy = QueryConditionHelper.GetSortByDictionary(queryStringConditions.SortBy); foreach (var item in sortBy) { fs.SortCriterias.Add(new StringSortCriteria <Job>(item.Key, (item.Value.ToUpper() == "ASC") ? Enums.SortOrder.Ascending : Enums.SortOrder.Descending)); } fs.OrderBy(x => x.Id); fs.WithPaging(pageSize, pageIndex); jobRep.Find(e => e.Id.PeriodId == new PeriodId(periodId), fs); var res = new PageResultDTO <JobInPeriodDTOWithActions>(); res.InjectFrom(fs.PageCriteria.PageResult); res.Result = fs.PageCriteria.PageResult.Result.Select(r => jobInPeriodDTOWithActionsMapper.MapToModel(r, selectedColumns.Split(','))).ToList(); return(res); }
public PageResultDTO <CustomFieldDTOWithActions> GetAllCustomFieldes(int pageSize, int pageIndex, QueryStringConditions queryStringConditions) { var fs = new ListFetchStrategy <CustomFieldType>(Enums.FetchInUnitOfWorkOption.NoTracking); var sortBy = QueryConditionHelper.GetSortByDictionary(queryStringConditions.SortBy); foreach (var item in sortBy) { fs.SortCriterias.Add(new StringSortCriteria <CustomFieldType>(item.Key, (item.Value.ToUpper() == "ASC") ? Enums.SortOrder.Ascending : Enums.SortOrder.Descending)); } fs.OrderBy(x => x.Id); fs.WithPaging(pageSize, pageIndex); var entityId = getEntityIdFromQueryString(queryStringConditions.Filter); customFieldRep.GetAll( entityId != null ? Enumeration.FromValue <EntityTypeEnum>(entityId.ToString()) : null, fs); var res = new PageResultDTO <CustomFieldDTOWithActions>(); res.InjectFrom(fs.PageCriteria.PageResult); res.Result = fs.PageCriteria.PageResult.Result.Select(r => customFieldWithActionMapper.MapToModel(r)).ToList(); return(res); }