From 7d5c2e2cf5a47d87b548d07dfb18be9001f1fa19 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Wed, 1 May 2024 11:58:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=84=D0=B8=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20=D0=B4=D0=B8=D0=B0?= =?UTF-8?q?=D0=B3=D0=BD=D0=BE=D0=B7=D0=BE=D0=B2=20=D0=BF=D0=BE=20=D0=B4?= =?UTF-8?q?=D0=B0=D1=82=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/DiagnoseStorage.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Polyclinic/PolyclinicDatabaseImplement/Implements/DiagnoseStorage.cs b/Polyclinic/PolyclinicDatabaseImplement/Implements/DiagnoseStorage.cs index bf0c673..b094092 100644 --- a/Polyclinic/PolyclinicDatabaseImplement/Implements/DiagnoseStorage.cs +++ b/Polyclinic/PolyclinicDatabaseImplement/Implements/DiagnoseStorage.cs @@ -50,11 +50,18 @@ namespace PolyclinicDatabaseImplement.Implements } if (model.To != null) { - elements = elements - .Where(x => x.DateStartDiagnose <= model.To.Value) + elements = elements.Where(x => x.DateStartDiagnose <= model.To.Value).ToList(); + + var elemWithDateStop = elements .Where(x => x.DateStopDiagnose != null) .Where(x => x.DateStopDiagnose <= model.To.Value) .ToList(); + + var elemWithoutDateStop = elements.Where(x => x.DateStopDiagnose == null).ToList(); + + elemWithDateStop.AddRange(elemWithoutDateStop); + + elements = elemWithDateStop; } return elements; }