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