From 5342ad96638e2ecba9c90ca3e4e907656c927059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BE=D0=BB=D0=BE=D0=B4=D1=8F?= Date: Wed, 19 Apr 2023 18:11:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BE=D1=82=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=81=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=20=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractAutoListImplement/Implements/OrderStorage.cs | 4 ++-- .../Implements/OrderStorage.cs | 4 ++-- .../AutomomilePlantFileImplement/Implements/OrderStorage.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AutomobilePlant/AbstractAutoListImplement/Implements/OrderStorage.cs b/AutomobilePlant/AbstractAutoListImplement/Implements/OrderStorage.cs index d285c75..a0463a6 100644 --- a/AutomobilePlant/AbstractAutoListImplement/Implements/OrderStorage.cs +++ b/AutomobilePlant/AbstractAutoListImplement/Implements/OrderStorage.cs @@ -35,14 +35,14 @@ namespace AutomobilePlantListImplement.Implements { var result = new List(); - if (!model.Id.HasValue) + if (model is null) { return result; } foreach (var order in _source.Orders) { - if (model.Id.HasValue && order.Id == model.Id) + if (order.DateCreate > model.DateFrom && order.DateCreate < model.DateTo) { result.Add(order.GetViewModel); } diff --git a/AutomobilePlant/AutomobilePlantDataBaseImplements/Implements/OrderStorage.cs b/AutomobilePlant/AutomobilePlantDataBaseImplements/Implements/OrderStorage.cs index 0c29eba..88914ce 100644 --- a/AutomobilePlant/AutomobilePlantDataBaseImplements/Implements/OrderStorage.cs +++ b/AutomobilePlant/AutomobilePlantDataBaseImplements/Implements/OrderStorage.cs @@ -24,13 +24,13 @@ namespace AutomobilePlantDataBaseImplements.Implements public List GetFilteredList(OrderSearchModel model) { - if (model.Id.HasValue) + if (model is null) { return new(); } using var context = new AutoPlantDataBase(); return context.Orders - .Where(x => x.Id == model.Id) + .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) .ToList() .Select(x => x.GetViewModel) .ToList(); diff --git a/AutomobilePlant/AutomomilePlantFileImplement/Implements/OrderStorage.cs b/AutomobilePlant/AutomomilePlantFileImplement/Implements/OrderStorage.cs index e54c17a..d811829 100644 --- a/AutomobilePlant/AutomomilePlantFileImplement/Implements/OrderStorage.cs +++ b/AutomobilePlant/AutomomilePlantFileImplement/Implements/OrderStorage.cs @@ -45,12 +45,12 @@ namespace AutomomilePlantFileImplement.Implements public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue) + if (model is null) { return new(); } return source.Orders - .Where(x => x.Id == model.Id) + .Where(x => x.DateCreate > model.DateFrom && x.DateCreate < model.DateTo) .Select(x => x.GetViewModel) .ToList(); }