This commit is contained in:
DeerElk 2024-05-05 05:34:17 +04:00
parent d62db28640
commit e62bd8a33c
2 changed files with 11 additions and 4 deletions

View File

@ -25,7 +25,12 @@ namespace ConfectioneryFileImplement.Implements
return new(); return new();
} }
return source.Orders return source.Orders
.Where(x => x.Id == model.Id) .Where(x => (
(!model.Id.HasValue || x.Id == model.Id) &&
(!model.DateFrom.HasValue || x.DateCreate >= model.DateFrom) &&
(!model.DateTo.HasValue || x.DateCreate <= model.DateTo)
)
)
.Select(x => AccessPastryStorage(x.GetViewModel)) .Select(x => AccessPastryStorage(x.GetViewModel))
.ToList(); .ToList();
} }

View File

@ -30,7 +30,9 @@ namespace ConfectioneryListImplement.Implements
} }
foreach (var order in _source.Orders) foreach (var order in _source.Orders)
{ {
if (order.Id == model.Id) if ((!model.Id.HasValue || order.Id == model.Id) &&
(!model.DateFrom.HasValue || order.DateCreate >= model.DateFrom) &&
(!model.DateTo.HasValue || order.DateCreate <= model.DateTo))
{ {
result.Add(AccessPastryStorage(order.GetViewModel)); result.Add(AccessPastryStorage(order.GetViewModel));
} }