файлики не ссорьтесь больше пжпж
This commit is contained in:
parent
b41ff6cc25
commit
597153e01c
@ -49,11 +49,24 @@ namespace AircraftPlantListImplement.Implements
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
var result = new List<OrderViewModel>();
|
||||
if (!model.Id.HasValue)
|
||||
if (!model.Id.HasValue || !model.DateFrom.HasValue || !model.DateTo.HasValue)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
if (model.DateFrom.HasValue)
|
||||
{
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo)
|
||||
{
|
||||
result.Add(GetViewModel(order));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.Id == model.Id)
|
||||
|
@ -28,6 +28,15 @@ namespace AircraftPlantFileImplement.Implements
|
||||
{
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user