конец
This commit is contained in:
parent
09dd8c0577
commit
5c366274cd
@ -47,12 +47,18 @@ namespace PrecastConcretePlantFileImplement.Implements
|
||||
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
if (!model.Id.HasValue)
|
||||
if (!model.Id.HasValue && (model.DateFrom == null || model.DateTo == null))
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
return source.Orders.Where(x => x.Id == model.Id).Select(x => GetViewModel(x)).ToList();
|
||||
if (model.Id.HasValue)
|
||||
{
|
||||
return source.Orders.Where(x => x.Id == model.Id).Select(x => GetViewModel(x)).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return source.Orders.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public List<OrderViewModel> GetFullList()
|
||||
|
@ -56,7 +56,7 @@ namespace PrecastConcretePlantListImplement.Implements
|
||||
{
|
||||
var result = new List<OrderViewModel>();
|
||||
|
||||
if (!model.Id.HasValue)
|
||||
if (!model.Id.HasValue && (model.DateFrom == null || model.DateTo == null))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@ -68,6 +68,16 @@ namespace PrecastConcretePlantListImplement.Implements
|
||||
result.Add(order.GetViewModel);
|
||||
}
|
||||
}
|
||||
if (!model.Id.HasValue)
|
||||
{
|
||||
foreach(var order in _source.Orders)
|
||||
{
|
||||
if (order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo)
|
||||
{
|
||||
result.Add(order.GetViewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user