gabella
This commit is contained in:
parent
21fdf29cd6
commit
e04cb36da6
@ -34,9 +34,14 @@ model)
|
|||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
return source.Orders
|
return source.Orders
|
||||||
.Where(x => x.Id == model.Id)
|
.Where(x => (
|
||||||
.Select( x => AccessIceCreamStorage( x.GetViewModel))
|
(!model.Id.HasValue || x.Id == model.Id) &&
|
||||||
.ToList();
|
(!model.DateFrom.HasValue || x.DateCreate >= model.DateFrom) &&
|
||||||
|
(!model.DateTo.HasValue || x.DateCreate <= model.DateTo)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.Select(x => x.GetViewModel)
|
||||||
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrderViewModel? GetElement(OrderSearchModel model)
|
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||||
|
@ -37,7 +37,7 @@ namespace IceCreamShopListImplement.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 && model.DateTo.HasValue && (order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo)))
|
||||||
{
|
{
|
||||||
result.Add(AccessIceCreamStorage(order.GetViewModel));
|
result.Add(AccessIceCreamStorage(order.GetViewModel));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user