order + client (list)
This commit is contained in:
parent
6716b74d72
commit
dc2492a0e1
@ -51,15 +51,34 @@ namespace JewelryStoreListImplement.Implements
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
var result = new List<OrderViewModel>();
|
||||
if (!model.DateFrom.HasValue || !model.DateTo.HasValue)
|
||||
if (model.DateFrom.HasValue)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo)
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
result.Add(order.GetViewModel);
|
||||
if (order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo)
|
||||
{
|
||||
result.Add(order.GetViewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (model.ClientId.HasValue && !model.Id.HasValue)
|
||||
{
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.ClientId == model.ClientId)
|
||||
{
|
||||
result.Add(order.GetViewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (model.Id.HasValue)
|
||||
{
|
||||
foreach (var order in _source.Orders)
|
||||
{
|
||||
if (order.Id == model.Id)
|
||||
{
|
||||
result.Add(order.GetViewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@ -15,8 +15,6 @@ namespace JewelryStoreListImplement.Models
|
||||
public int JewelId { get; private set; }
|
||||
public string JewelName { get; private set; }
|
||||
public int ClientId { get; private set; }
|
||||
|
||||
|
||||
public int Count { get; private set; }
|
||||
|
||||
public double Sum { get; private set; }
|
||||
@ -38,6 +36,7 @@ namespace JewelryStoreListImplement.Models
|
||||
{
|
||||
Id = model.Id,
|
||||
JewelId = model.JewelId,
|
||||
ClientId = model.ClientId,
|
||||
JewelName = model.JewelName,
|
||||
Count = model.Count,
|
||||
Sum = model.Sum,
|
||||
@ -64,6 +63,7 @@ namespace JewelryStoreListImplement.Models
|
||||
{
|
||||
Id = Id,
|
||||
JewelId = JewelId,
|
||||
ClientId = ClientId,
|
||||
JewelName = JewelName,
|
||||
Count = Count,
|
||||
Sum = Sum,
|
||||
|
Loading…
Reference in New Issue
Block a user