From 18908c82eeb08b56b7443cca91a382871b8f04f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BA=20=D0=98=D0=B3=D0=BE=D1=80=D1=8C?= Date: Sun, 26 Mar 2023 20:39:28 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B4=D0=B5=D0=BB=D0=BA=D0=B8=20?= =?UTF-8?q?=D1=81=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=BE=D0=B2=20=D0=B2=20?= =?UTF-8?q?=D0=B4=D1=80=D1=83=D0=B3=D0=B8=D1=85=20=D1=80=D0=B5=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/OrderStorage.cs | 4 ++-- .../Implements/OrderStorage.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs index b0d6550..4715a2d 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs @@ -27,12 +27,12 @@ namespace BlacksmithWorkshopFileImplement.Implements } public List GetFilteredList(OrderSearchModel model) { - if (model.Id == null) + if (!model.DateFrom.HasValue || !model.DateTo.HasValue) { return new(); } return source.Orders - .Where(x => x.Id == model.Id) + .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) .Select(x => AddManufactureName(x.GetViewModel)) .ToList(); } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/OrderStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/OrderStorage.cs index c57ce1d..1753e42 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/OrderStorage.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/OrderStorage.cs @@ -28,13 +28,13 @@ namespace BlacksmithWorkshopListImplement.Implements public List GetFilteredList(OrderSearchModel model) { var result = new List(); - if (model.Id == null) + if (!model.DateFrom.HasValue || !model.DateTo.HasValue) { return result; } foreach (var order in _source.Orders) { - if (model.Id.HasValue && order.Id == model.Id) + if (model.Id.HasValue && order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo) { OrderViewModel vm = order.GetViewModel; var manufacture = _source.Manufactures.Find(x => x.Id == order.ManufactureId);