final commit

This commit is contained in:
Salikh 2024-04-28 19:02:17 +04:00
parent c18421c599
commit f21c618272
2 changed files with 5 additions and 5 deletions

View File

@ -82,11 +82,11 @@ namespace MotorPlantDatabaseImplement.Implements
if (model == null) if (model == null)
return null; return null;
using var context = new MotorPlantDatabase(); 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; break;
} }
} }

View File

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