PIbd-21 Yaruskin S.A. LabWork05_Base #9

Closed
Salikh wants to merge 3 commits from laba5 into lab4
2 changed files with 5 additions and 5 deletions
Showing only changes of commit f21c618272 - Show all commits

View File

@ -82,11 +82,11 @@ namespace MotorPlantDatabaseImplement.Implements
if (model == null)
return null;
using var context = new MotorPlantDatabase();
foreach (var Flower in context.Engines)
foreach (var Engine in context.Engines)
{
if (Flower.Id == model.EngineId)
if (Engine.Id == model.EngineId)
{
model.EngineName = Flower.EngineName;
model.EngineName = Engine.EngineName;
break;
}
}

View File

@ -78,9 +78,9 @@ namespace MotorPlantFileImplement.Implements
private OrderViewModel GetViewModel(Order order)
{
var viewModel = order.GetViewModel;
var flower = source.Engines.FirstOrDefault(x => x.Id == order.EngineId);
var engine = source.Engines.FirstOrDefault(x => x.Id == order.EngineId);
var client = source.Clients.FirstOrDefault(x => x.Id == order.ClientId);
viewModel.EngineName = flower?.EngineName;
viewModel.EngineName = engine?.EngineName;
viewModel.ClientFIO = client?.ClientFIO;
return viewModel;
}