Фикс фильтрации процедур по датам

This commit is contained in:
Никита Потапов 2024-05-01 11:53:43 +04:00
parent e0ff2d9057
commit 4377f8e5ae

View File

@ -41,11 +41,18 @@ namespace PolyclinicDatabaseImplement.Implements
}
if (model.To != null)
{
elements = elements
.Where(x => x.DateStartProcedure <= model.To.Value)
elements = elements.Where(x => x.DateStartProcedure <= model.To.Value).ToList();
var elemWithDateStop = elements
.Where(x => x.DateStopProcedure != null)
.Where(x => x.DateStopProcedure <= model.To.Value)
.ToList();
var elemWithoutDateStop = elements.Where(x => x.DateStopProcedure == null).ToList();
elemWithDateStop.AddRange(elemWithoutDateStop);
elements = elemWithDateStop;
}
return elements;
}