доделки составления фильтрованного списка заказов в других реализациях
This commit is contained in:
parent
50fcb82aa9
commit
18908c82ee
@ -27,12 +27,12 @@ namespace BlacksmithWorkshopFileImplement.Implements
|
||||
}
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
if (model.Id == null)
|
||||
if (!model.DateFrom.HasValue || !model.DateTo.HasValue)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
return source.Orders
|
||||
.Where(x => x.Id == model.Id)
|
||||
.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
|
||||
.Select(x => AddManufactureName(x.GetViewModel))
|
||||
.ToList();
|
||||
}
|
||||
|
@ -28,13 +28,13 @@ namespace BlacksmithWorkshopListImplement.Implements
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
var result = new List<OrderViewModel>();
|
||||
if (model.Id == null)
|
||||
if (!model.DateFrom.HasValue || !model.DateTo.HasValue)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (model.Id.HasValue && order.Id == model.Id)
|
||||
if (model.Id.HasValue && order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo)
|
||||
{
|
||||
OrderViewModel vm = order.GetViewModel;
|
||||
var manufacture = _source.Manufactures.Find(x => x.Id == order.ManufactureId);
|
||||
|
Loading…
Reference in New Issue
Block a user