diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs index 944ae2eed..76d075abc 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs @@ -154,7 +154,7 @@ namespace IRaCIS.Application.Services .WhereIf(dto.SubjectCode != null && dto.SubjectCode != String.Empty, x => x.SubjectCode == dto.SubjectCode) .WhereIf(dto.ModuleType != null, x => x.ModuleType == dto.ModuleType) .WhereIf(dto.Status != null, x => x.Status == dto.Status) - .WhereIf(dto.Name != null, x => x.Name.Contains(x.Name)).OrderBy(x => x.SiteCode); + .WhereIf(dto.Name != null, x => x.Name.Contains(dto.Name)).OrderBy(x => x.SiteCode); var subjectIds = await subjectQuery.Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync(); List ReadModuleViewList = await subjectQuery.Where(x => subjectIds.Contains(x.SubjectId)).ToListAsync(); @@ -407,8 +407,9 @@ namespace IRaCIS.Application.Services { var visitQuery = _subjectVisitRepository.Where(x => x.SubjectId == dto.SubjectId); - visitQuery = visitQuery.WhereIf(dto.ExpirationDate != null, x => x.LatestScanDate <= dto.ExpirationDate.Value) - .WhereIf(dto.ExpirationVisitNum != null, x => x.VisitNum <= dto.ExpirationVisitNum.Value); + visitQuery = visitQuery + //.WhereIf(dto.ExpirationDate != null, x => x.LatestScanDate <= dto.ExpirationDate.Value) + .WhereIf(dto.ExpirationVisitNum != null, x => x.VisitNum == dto.ExpirationVisitNum.Value); var visit = visitQuery.OrderByDescending(x => x.VisitNum).FirstOrDefault(); if (visit != null)