Beispiel #1
0
        public BatchImportSearchResponse GetImports(Models.RequestModels.BatchImportSearchRequest searchRequest)
        {
            bool flag = false;

            if (searchRequest.InProcess == 1)
            {
                flag = true;
            }
            int success     = 0;
            int batchNumber = 0;

            if (!int.TryParse(string.IsNullOrEmpty(searchRequest.BatchNumber)? "0" : searchRequest.BatchNumber, out success))
            {
                success = -1;
            }

            int fromRow = (searchRequest.PageNo - 1) * searchRequest.PageSize;
            int toRow   = searchRequest.PageSize;
            Expression <Func <StagingEbayBatchImport, bool> > query =
                s => (
                    (searchRequest.InProcess == 0 || s.InProcess.Equals(flag)) && (success == 0 || s.EbayBatchImportId == success)


                    );
            IEnumerable <StagingEbayBatchImport> oList =
                searchRequest.IsAsc
                    ? DbSet.Where(query)
                .OrderBy(batchClause[searchRequest.BatchImportOrderBy])
                .Skip(fromRow)
                .Take(toRow)
                .ToList()
                    : DbSet.Where(query)
                .OrderByDescending(batchClause[searchRequest.BatchImportOrderBy])
                .Skip(fromRow)
                .Take(toRow)
                .ToList();

            return(new BatchImportSearchResponse {
                EbayBatchImports = oList, TotalCount = DbSet.Count(), FilteredCount = DbSet.Count(query)
            });
        }
Beispiel #2
0
 public Models.ResponseModels.BatchImportSearchResponse GetImports(Models.RequestModels.BatchImportSearchRequest oReq)
 {
     return(istgEbayBatchImportsRepository.GetImports(oReq));
     //return orep
 }
 public BatchImportSearchResponse GetImports(Models.RequestModels.BatchImportSearchRequest oReq)
 {
     return(oRepository.GetImports(oReq));
     //throw new NotImplementedException();
 }