From 47a1f54b4a2775421446a6b5f29b8e502eb7e9eb Mon Sep 17 00:00:00 2001 From: "a.puchkina" Date: Wed, 1 May 2024 18:54:24 +0400 Subject: [PATCH] =?UTF-8?q?getfilteredlist=20=D0=BA=D0=BE=D0=BD=D1=81?= =?UTF-8?q?=D1=83=D0=BB=D1=8C=D1=82=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/ConsultationStorage.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/LawFim/LawFirmDatabaseImplement/Implements/ConsultationStorage.cs b/LawFim/LawFirmDatabaseImplement/Implements/ConsultationStorage.cs index 38c3667..0666703 100644 --- a/LawFim/LawFirmDatabaseImplement/Implements/ConsultationStorage.cs +++ b/LawFim/LawFirmDatabaseImplement/Implements/ConsultationStorage.cs @@ -21,12 +21,12 @@ namespace LawFirmDatabaseImplement.Implements } public List GetFilteredList(ConsultationSearchModel model) { - if (!model.Id.HasValue && !model.GuarantorId.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue - && !model.ConsultationDate.HasValue) + if (!model.Id.HasValue && !model.GuarantorId.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue + && !model.ConsultationDate.HasValue && !model.CaseId.HasValue) { return new(); } - if (!model.GuarantorId.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue) + if (model.GuarantorId.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue) { using var context = new LawFirmDatabase(); return context.Consultations @@ -38,14 +38,13 @@ namespace LawFirmDatabaseImplement.Implements .Select(x => x.GetViewModel) .ToList(); } - if (!model.GuarantorId.HasValue) + else if (model.GuarantorId.HasValue) { using var context = new LawFirmDatabase(); return context.Consultations .Include(x => x.Lawyers) .ThenInclude(x => x.Lawyer) .Where(x => x.GuarantorId == model.GuarantorId) - .ToList() .Select(x => x.GetViewModel) .ToList(); }