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