Merge branch 'LabWork07' into LabWork08
This commit is contained in:
commit
6e0a287f25
@ -27,11 +27,24 @@ namespace DressAtelierFileImplement.Implements
|
||||
}
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
if (!model.ID.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
|
||||
if (!model.ID.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue && !model.ClientID.HasValue && !model.Status.HasValue)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
return _source.Orders.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo).Select(x => ReceiveDressName(x)).ToList();
|
||||
if (model.ClientID.HasValue)
|
||||
{
|
||||
return _source.Orders.Where(x => x.ClientID == model.ClientID).Select(x => ReceiveDressName(x)).ToList();
|
||||
}
|
||||
if (model.ID.HasValue)
|
||||
{
|
||||
return _source.Orders.Where(x => x.ID == model.ID).Select(x => ReceiveDressName(x)).ToList();
|
||||
}
|
||||
|
||||
if (model.DateFrom.HasValue && model.DateTo.HasValue)
|
||||
{
|
||||
return _source.Orders.Where(x => model.DateFrom >= x.DateCreate && model.DateTo <= x.DateCreate).Select(x => ReceiveDressName(x)).ToList();
|
||||
}
|
||||
return _source.Orders.Where(x => x.Status.Equals(model.Status)).ToList().Select(x => ReceiveDressName(x)).ToList();
|
||||
}
|
||||
|
||||
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||
|
@ -32,10 +32,37 @@ namespace DressAtelierListImplement.Implements
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
var result = new List<OrderViewModel>();
|
||||
if (!model.ID.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
|
||||
if (!model.ID.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue && !model.ClientID.HasValue && !model.Status.HasValue)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
if (model.ClientID.HasValue)
|
||||
{
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.ClientID == model.ClientID)
|
||||
{
|
||||
result.Add(ReceiveDressName(order.GetViewModel));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (model.ID.HasValue)
|
||||
{
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.ID == model.ID)
|
||||
{
|
||||
result.Add(ReceiveDressName(order.GetViewModel));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (model.DateFrom.HasValue && model.DateTo.HasValue)
|
||||
{
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo)
|
||||
@ -46,6 +73,17 @@ namespace DressAtelierListImplement.Implements
|
||||
return result;
|
||||
}
|
||||
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.Status == model.Status)
|
||||
{
|
||||
result.Add(ReceiveDressName(order.GetViewModel));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||
{
|
||||
if (!model.ID.HasValue)
|
||||
|
Loading…
Reference in New Issue
Block a user