OrderCheck

This commit is contained in:
Sergey Kozyrev 2024-02-20 19:33:08 +04:00
parent 58ffae6460
commit eb19e42237

View File

@ -19,7 +19,7 @@ namespace SewingDressesListImplement.Implements
var result = new List<OrderViewModel>();
foreach (var order in _source.Orders)
{
result.Add(order.GetViewModel);
result.Add(AcessDressesStorage(order.GetViewModel));
}
return result;
}
@ -31,7 +31,7 @@ namespace SewingDressesListImplement.Implements
{
if (order.Id == model.Id)
{
result.Add(order.GetViewModel);
result.Add(AcessDressesStorage(order.GetViewModel));
}
}
return result;
@ -94,5 +94,17 @@ namespace SewingDressesListImplement.Implements
}
return null;
}
public OrderViewModel AcessDressesStorage(OrderViewModel model)
{
foreach (var dress in _source.Dresses)
{
if (dress.Id == model.DressId)
{
model.DressName = dress.DressName;
break;
}
}
return model;
}
}
}