diff --git a/CarShowroom/CarShowroom.sln b/CarShowroom/CarShowroom.sln index 898499f..c8e5b51 100644 --- a/CarShowroom/CarShowroom.sln +++ b/CarShowroom/CarShowroom.sln @@ -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 diff --git a/CarShowroom/CarShowroomContracts/CarShowroomContracts.csproj b/CarShowroom/CarShowroomContracts/CarShowroomContracts.csproj new file mode 100644 index 0000000..8dc98eb --- /dev/null +++ b/CarShowroom/CarShowroomContracts/CarShowroomContracts.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/CarShowroom/CarShowroomContracts/Class1.cs b/CarShowroom/CarShowroomContracts/Class1.cs new file mode 100644 index 0000000..e19f2cd --- /dev/null +++ b/CarShowroom/CarShowroomContracts/Class1.cs @@ -0,0 +1,7 @@ +namespace CarShowroomContracts +{ + public class Class1 + { + + } +} diff --git a/CarShowroom/CarShowroomDataModels/Views/CarView.cs b/CarShowroom/CarShowroomDataModels/Views/CarView.cs index 79024e2..e771c3f 100644 --- a/CarShowroom/CarShowroomDataModels/Views/CarView.cs +++ b/CarShowroom/CarShowroomDataModels/Views/CarView.cs @@ -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) diff --git a/CarShowroom/CarShowroomDataModels/Views/SaleView.cs b/CarShowroom/CarShowroomDataModels/Views/SaleView.cs index b08c9f1..f97c2b0 100644 --- a/CarShowroom/CarShowroomDataModels/Views/SaleView.cs +++ b/CarShowroom/CarShowroomDataModels/Views/SaleView.cs @@ -23,9 +23,21 @@ namespace CarShowroomDataModels.Dtos public int EmployeeId { get; set; } [DisplayName("Сотрудник")] public string EmployeeName { get; set; } = string.Empty; - public List CarIds { get; set; } = new(); + public List CarIds + { + get + { + return Cars.Select(c => c.Id).ToList(); + } + } public List Cars { get; set; } = new(); - public List ServiseIds { get; set; } = new(); + public List ServiseIds + { + get + { + return Servises.Select(s => s.Id).ToList(); + } + } public List 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; } } } diff --git a/CarShowroom/CarShowroomDatabaseStorage/CarShowroomDatabaseStorage.csproj b/CarShowroom/CarShowroomDatabaseStorage/CarShowroomDatabaseStorage.csproj new file mode 100644 index 0000000..44ff353 --- /dev/null +++ b/CarShowroom/CarShowroomDatabaseStorage/CarShowroomDatabaseStorage.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/CarShowroom/CarShowroomDatabaseStorage/Class1.cs b/CarShowroom/CarShowroomDatabaseStorage/Class1.cs new file mode 100644 index 0000000..43b60ec --- /dev/null +++ b/CarShowroom/CarShowroomDatabaseStorage/Class1.cs @@ -0,0 +1,7 @@ +namespace CarShowroomDatabaseStorage +{ + public class Class1 + { + + } +}