From 4377f8e5ae7081f7f67b6f4a42a64138dd8af735 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Wed, 1 May 2024 11:53:43 +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=BF=D1=80=D0=BE?= =?UTF-8?q?=D1=86=D0=B5=D0=B4=D1=83=D1=80=20=D0=BF=D0=BE=20=D0=B4=D0=B0?= =?UTF-8?q?=D1=82=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/ProcedureStorage.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Polyclinic/PolyclinicDatabaseImplement/Implements/ProcedureStorage.cs b/Polyclinic/PolyclinicDatabaseImplement/Implements/ProcedureStorage.cs index 0194d9d..e172d21 100644 --- a/Polyclinic/PolyclinicDatabaseImplement/Implements/ProcedureStorage.cs +++ b/Polyclinic/PolyclinicDatabaseImplement/Implements/ProcedureStorage.cs @@ -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; }