Готовая 3 лаба
This commit is contained in:
parent
02ff5049ff
commit
390b0d1012
@ -45,17 +45,13 @@ namespace FurnitureAssemblyFileImplement.Implements
|
|||||||
return source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
|
return source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Для загрузки названий изделия в заказе
|
|
||||||
private OrderViewModel GetViewModel(Order order)
|
private OrderViewModel GetViewModel(Order order)
|
||||||
{
|
{
|
||||||
var viewModel = order.GetViewModel;
|
var viewModel = order.GetViewModel;
|
||||||
|
|
||||||
var furniture = source.Furnitures.FirstOrDefault(x => x.Id == order.FurnitureId);
|
var furniture = source.Furnitures.FirstOrDefault(x => x.Id == order.FurnitureId);
|
||||||
|
|
||||||
if (furniture != null)
|
viewModel.FurnitureName = furniture?.FurnitureName;
|
||||||
{
|
|
||||||
viewModel.FurnitureName = furniture.FurnitureName;
|
|
||||||
}
|
|
||||||
|
|
||||||
return viewModel;
|
return viewModel;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user