fix views

This commit is contained in:
Zakharov_Rostislav 2024-05-03 11:10:36 +04:00
parent cdff9cd481
commit 3dc7f5186d
7 changed files with 68 additions and 4 deletions

View File

@ -5,6 +5,10 @@ VisualStudioVersion = 17.9.34723.18
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CarShowroomDataModels", "CarShowroomDataModels\CarShowroomDataModels.csproj", "{7EECD77A-5D26-4093-85B0-F2D33C6F0C2C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarShowroomContracts", "CarShowroomContracts\CarShowroomContracts.csproj", "{6274B5CD-C339-4FD3-AC45-DE8384AD4CB7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarShowroomDatabaseStorage", "CarShowroomDatabaseStorage\CarShowroomDatabaseStorage.csproj", "{7F0A0E4D-6EFD-459D-AFFF-99F3185243F8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -15,6 +19,14 @@ Global
{7EECD77A-5D26-4093-85B0-F2D33C6F0C2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7EECD77A-5D26-4093-85B0-F2D33C6F0C2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7EECD77A-5D26-4093-85B0-F2D33C6F0C2C}.Release|Any CPU.Build.0 = Release|Any CPU
{6274B5CD-C339-4FD3-AC45-DE8384AD4CB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6274B5CD-C339-4FD3-AC45-DE8384AD4CB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6274B5CD-C339-4FD3-AC45-DE8384AD4CB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6274B5CD-C339-4FD3-AC45-DE8384AD4CB7}.Release|Any CPU.Build.0 = Release|Any CPU
{7F0A0E4D-6EFD-459D-AFFF-99F3185243F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F0A0E4D-6EFD-459D-AFFF-99F3185243F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F0A0E4D-6EFD-459D-AFFF-99F3185243F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F0A0E4D-6EFD-459D-AFFF-99F3185243F8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\CarShowroomDataModels\CarShowroomDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,7 @@
namespace CarShowroomContracts
{
public class Class1
{
}
}

View File

@ -19,6 +19,8 @@ namespace CarShowroomContracts.Dtos
public int ModelId { get; set; }
[DisplayName("Модель")]
public string ModelName { get; set; } = string.Empty;
[DisplayName("Цена")]
public int ModelPrice { get; set; }
[DisplayName("Марка")]
public string MakeName { get; set; } = string.Empty;
public CarView(ICar model)

View File

@ -23,9 +23,21 @@ namespace CarShowroomDataModels.Dtos
public int EmployeeId { get; set; }
[DisplayName("Сотрудник")]
public string EmployeeName { get; set; } = string.Empty;
public List<int> CarIds { get; set; } = new();
public List<int> CarIds
{
get
{
return Cars.Select(c => c.Id).ToList();
}
}
public List<CarView> Cars { get; set; } = new();
public List<int> ServiseIds { get; set; } = new();
public List<int> ServiseIds
{
get
{
return Servises.Select(s => s.Id).ToList();
}
}
public List<ServiceView> Servises { get; set; } = new();
public SaleView(ISale model)
{
@ -34,8 +46,6 @@ namespace CarShowroomDataModels.Dtos
Cost = model.Cost;
ClientId = model.ClientId;
EmployeeId = model.EmployeeId;
CarIds = model.CarIds;
ServiseIds = model.ServiseIds;
}
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\CarShowroomContracts\CarShowroomContracts.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,7 @@
namespace CarShowroomDatabaseStorage
{
public class Class1
{
}
}