From bcd8b8f156fde9138b43526857cf72041de477d3 Mon Sep 17 00:00:00 2001 From: dex_moth Date: Mon, 27 May 2024 20:30:16 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=D0=BE=D0=B2=20=D0=B8?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BA=D1=83=D0=BF=D0=BE=D0=BA=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D1=8E=D0=B7=D0=B5=D1=80=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/ComponentStorage.cs | 3 ++- .../Implements/PurchaseStorage.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ComponentStorage.cs b/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ComponentStorage.cs index cb2d4ff..9b7e4bd 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ComponentStorage.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ComponentStorage.cs @@ -24,7 +24,8 @@ namespace ComputerHardwareStoreDatabaseImplement.Implements } using var context = new ComputerHardwareStoreDBContext(); return context.Components - .Where(c => c.Name.Contains(model.Name)) + .Where(c => c.Name.Contains(model.Name) || + (c.StoreKeeper.Id == model.StoreKeeperId)) .Select(c => c.GetViewModel) .ToList(); } diff --git a/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/PurchaseStorage.cs b/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/PurchaseStorage.cs index bbce924..ee32cac 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/PurchaseStorage.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/PurchaseStorage.cs @@ -30,6 +30,7 @@ namespace ComputerHardwareStoreDatabaseImplement.Implements .Include(p => p.Products) .ThenInclude(p => p.Product) .Where(p => + (model.VendorId.HasValue && model.VendorId == p.VendorId) || (model.Id.HasValue && p.Id == model.Id) || ((model.DateFrom.HasValue && model.DateTo.HasValue) && ((model.DateFrom <= p.DateCreate && p.DateCreate <= model.DateTo) ||