Правка1

This commit is contained in:
[USERNAME] 2024-03-20 22:28:23 +04:00
parent bfb91e7f4c
commit d20628d88b
2 changed files with 2 additions and 12 deletions

View File

@ -71,14 +71,8 @@ namespace MotorPlantFileImplement.Implements
private OrderViewModel GetViewModel(Order order)
{
var viewModel = order.GetViewModel;
foreach (var comp in source.Engines)
{
if (comp.Id == order.EngineId)
{
viewModel.EngineName = comp.EngineName;
break;
}
}
var engine = source.Engines.FirstOrDefault(x => x.Id == order.EngineId);
viewModel.EngineName = engine?.EngineName;
return viewModel;
}
}

View File

@ -37,11 +37,7 @@ namespace MotorPlantListImplement.Models
{
return;
}
EngineId = model.EngineId;
Count = model.Count;
Sum = model.Sum;
Status = model.Status;
DateCreate = model.DateCreate;
DateImplement = model.DateImplement;
}
public OrderViewModel GetViewModel => new()