public OacyResultDTO GetOACYListWithPaging(string PipelineDuns, string keyword, DateTime?postStartDate, DateTime?effectiveGasDate, string cycle, SortingPagingInfo sortingPagingInfo) { OacyResultDTO oacyResultDTO = new OacyResultDTO(); //Get oacy list using above parameters IQueryable <OACYPerTransaction> result; IQueryable <OACYPerTransactionDTO> OacyDTO = null; try { result = GetByPostDateEffDate(PipelineDuns, postStartDate, effectiveGasDate, keyword, cycle); if (result.Count() > 0) { OacyDTO = GetOacyData(result).AsQueryable(); } var dataQueryWithOrder = SortByColumnWithOrder(OacyDTO, sortingPagingInfo); oacyResultDTO.RecordCount = dataQueryWithOrder.Count(); var resultData = dataQueryWithOrder.Skip((sortingPagingInfo.CurrentPageIndex - 1) * sortingPagingInfo.PageSize).Take(sortingPagingInfo.PageSize).ToList(); if (resultData.Count() > 0) { var oacyResult = resultData.Select(a => modalFactory.ParseDTO(a)).ToList(); oacyResultDTO.oacyPerTransactionDTO = oacyResult; return(oacyResultDTO); } return(new OacyResultDTO()); } catch (Exception ex) { return(null); } }
public UnscResultDTO GetUnscListWithPaging(string PipelineDuns, string keyword, DateTime?postStartDate, DateTime?effectiveStartDate, DateTime?effectiveEndDate, SortingPagingInfo sortingPagingInfo) { UnscResultDTO unscResult = new UnscResultDTO(); //Get unsc list using above parameters IQueryable <UnscPerTransaction> result; IQueryable <UnscPerTransactionDTO> UnscDTO = null; try { result = GetAllUNSCOnPipelineId(PipelineDuns, keyword, postStartDate, effectiveStartDate, effectiveEndDate); if (result.Count() > 0) { UnscDTO = GetUnscData(result).AsQueryable(); } var dataQueryWithOrder = SortByColumnWithOrder(UnscDTO, sortingPagingInfo); unscResult.RecordCount = dataQueryWithOrder.Count(); var resultData = dataQueryWithOrder.Skip((sortingPagingInfo.CurrentPageIndex - 1) * sortingPagingInfo.PageSize).Take(sortingPagingInfo.PageSize).ToList(); if (resultData.Count() > 0) { unscResult.unscPerTransactionDTO = resultData.Select(a => modalFactory.ParseDTO(a)).ToList(); return(unscResult); } return(new UnscResultDTO()); } catch (Exception ex) { return(null); } }