This commit is contained in:
AnnZhimol 2023-03-27 22:49:48 +04:00
parent d4b7ee2b1f
commit d3c3940083
3 changed files with 23 additions and 16 deletions

View File

@ -29,7 +29,7 @@
Номер Номер
</th> </th>
<th> <th>
Изделие Название изделия
</th> </th>
<th> <th>
Дата создания Дата создания

View File

@ -66,13 +66,18 @@ namespace SoftwareInstallationDataBaseImplement.Models
DateImplement = model.DateImplement; DateImplement = model.DateImplement;
} }
public OrderViewModel GetViewModel => new() public OrderViewModel GetViewModel
{
get
{
using var context = new SoftwareInstallationDataBase();
return new OrderViewModel
{ {
Id = Id, Id = Id,
PackageId = PackageId, PackageId = PackageId,
ClientId = ClientId, ClientId = ClientId,
ClientFIO = Client.ClientFIO, ClientFIO = context.Clients.FirstOrDefault(x => x.Id == ClientId)?.ClientFIO ?? string.Empty,
PackageName = PackageName, PackageName = context.Packages.FirstOrDefault(x => x.Id == PackageId)?.PackageName ?? string.Empty,
Count = Count, Count = Count,
Sum = Sum, Sum = Sum,
Status = Status, Status = Status,
@ -81,3 +86,5 @@ namespace SoftwareInstallationDataBaseImplement.Models
}; };
} }
} }
}
}