какая то суета

This commit is contained in:
kamilia 2024-05-06 00:02:06 +04:00
parent 6a1e7adc40
commit c54abfcd3d

View File

@ -24,10 +24,17 @@ namespace AircraftPlantFileImplement.Implements
}
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
{
if (!model.Id.HasValue)
if (!model.Id.HasValue || !model.DateFrom.HasValue || !model.DateTo.HasValue)
{
return new();
}
if (model.DateFrom.HasValue)
{
return _source.Orders
.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
.Select(x => GetViewModel(x))
.ToList();
}
return _source.Orders.Where(x => x.Id.Equals(model.Id)).Select(x => GetViewModel(x)).ToList();
}
public OrderViewModel? GetElement(OrderSearchModel model)