Готовая 3 лаба

This commit is contained in:
platoff aeeee 2024-04-28 14:57:10 +04:00
parent 02ff5049ff
commit 390b0d1012

View File

@ -45,17 +45,13 @@ namespace FurnitureAssemblyFileImplement.Implements
return source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
// Для загрузки названий изделия в заказе
private OrderViewModel GetViewModel(Order order)
{
var viewModel = order.GetViewModel;
var furniture = source.Furnitures.FirstOrDefault(x => x.Id == order.FurnitureId);
if (furniture != null)
{
viewModel.FurnitureName = furniture.FurnitureName;
}
viewModel.FurnitureName = furniture?.FurnitureName;
return viewModel;
}