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) ||