diff --git a/SoftwareInstallation/SoftwareInstallation.sln b/SoftwareInstallation/SoftwareInstallation.sln index 8f15e24..99f66d9 100644 --- a/SoftwareInstallation/SoftwareInstallation.sln +++ b/SoftwareInstallation/SoftwareInstallation.sln @@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationDatabas EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftwareInstallationRestApi", "SoftwareInstallationRestApi\SoftwareInstallationRestApi.csproj", "{68CE709E-067B-4745-8893-B082C86A1FAB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftwareInstallationClientApp", "SoftwareInstallationClientApp\SoftwareInstallationClientApp.csproj", "{69FE812F-D1F0-4A4F-9844-C1E0212AC607}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -57,6 +59,10 @@ Global {68CE709E-067B-4745-8893-B082C86A1FAB}.Debug|Any CPU.Build.0 = Debug|Any CPU {68CE709E-067B-4745-8893-B082C86A1FAB}.Release|Any CPU.ActiveCfg = Release|Any CPU {68CE709E-067B-4745-8893-B082C86A1FAB}.Release|Any CPU.Build.0 = Release|Any CPU + {69FE812F-D1F0-4A4F-9844-C1E0212AC607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69FE812F-D1F0-4A4F-9844-C1E0212AC607}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69FE812F-D1F0-4A4F-9844-C1E0212AC607}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69FE812F-D1F0-4A4F-9844-C1E0212AC607}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SoftwareInstallation/SoftwareInstallationClientApp/APIClient.cs b/SoftwareInstallation/SoftwareInstallationClientApp/APIClient.cs index b1a7524..2db9108 100644 --- a/SoftwareInstallation/SoftwareInstallationClientApp/APIClient.cs +++ b/SoftwareInstallation/SoftwareInstallationClientApp/APIClient.cs @@ -28,9 +28,9 @@ namespace SoftwareInstallationClientApp } else { - throw new Exception(result); - } - } + throw new Exception(result); + } + } public static void PostRequest(string requestUrl, T model) { diff --git a/SoftwareInstallation/SoftwareInstallationClientApp/Controllers/HomeController.cs b/SoftwareInstallation/SoftwareInstallationClientApp/Controllers/HomeController.cs index ae91535..e0730de 100644 --- a/SoftwareInstallation/SoftwareInstallationClientApp/Controllers/HomeController.cs +++ b/SoftwareInstallation/SoftwareInstallationClientApp/Controllers/HomeController.cs @@ -113,7 +113,7 @@ namespace SoftwareInstallationClientApp.Controllers [HttpGet] public IActionResult Create() { - ViewBag.Pastries = APIClient.GetRequest>("api/main/getpackagelist"); + ViewBag.Packages = APIClient.GetRequest>("api/main/getpackagelist"); return View(); } diff --git a/SoftwareInstallation/SoftwareInstallationClientApp/SoftwareInstallationClientApp.csproj b/SoftwareInstallation/SoftwareInstallationClientApp/SoftwareInstallationClientApp.csproj index c78c9c7..784752f 100644 --- a/SoftwareInstallation/SoftwareInstallationClientApp/SoftwareInstallationClientApp.csproj +++ b/SoftwareInstallation/SoftwareInstallationClientApp/SoftwareInstallationClientApp.csproj @@ -6,4 +6,12 @@ enable + + + + + + + + diff --git a/SoftwareInstallation/SoftwareInstallationClientApp/Views/Home/Create.cshtml b/SoftwareInstallation/SoftwareInstallationClientApp/Views/Home/Create.cshtml index 7faa94c..e08e538 100644 --- a/SoftwareInstallation/SoftwareInstallationClientApp/Views/Home/Create.cshtml +++ b/SoftwareInstallation/SoftwareInstallationClientApp/Views/Home/Create.cshtml @@ -8,7 +8,7 @@
Изделие:
- +
diff --git a/SoftwareInstallation/SoftwareInstallationClientApp/appsettings.json b/SoftwareInstallation/SoftwareInstallationClientApp/appsettings.json index a6acd6b..6b6bab0 100644 --- a/SoftwareInstallation/SoftwareInstallationClientApp/appsettings.json +++ b/SoftwareInstallation/SoftwareInstallationClientApp/appsettings.json @@ -6,5 +6,5 @@ } }, "AllowedHosts": "*", - "IPAddress": "http://localhost:5011" + "IPAddress": "http://localhost:5044" } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallationDatabaseImplement/OrderStorage.cs b/SoftwareInstallation/SoftwareInstallationDatabaseImplement/OrderStorage.cs index dd0360c..ca26f74 100644 --- a/SoftwareInstallation/SoftwareInstallationDatabaseImplement/OrderStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationDatabaseImplement/OrderStorage.cs @@ -12,7 +12,7 @@ namespace SoftwareInstallationDatabaseImplement.Implements public OrderViewModel? Delete(OrderBindingModel model) { using var context = new SoftwareInstallationDatabase(); - var element = context.Orders.FirstOrDefault(x => x.Id == model.Id); + var element = context.Orders.Include(x => x.Client).FirstOrDefault(x => x.Id == model.Id); if (element != null) { context.Orders.Remove(element); @@ -30,7 +30,8 @@ namespace SoftwareInstallationDatabaseImplement.Implements return null; } return context.Orders - .Include(x => x.Package) + .Include(x => x.Client) + .Include(x => x.Package) .FirstOrDefault(x => model.Id.HasValue && x.Id == model.Id)?.GetViewModel; } @@ -65,7 +66,8 @@ namespace SoftwareInstallationDatabaseImplement.Implements { using var context = new SoftwareInstallationDatabase(); return context.Orders - .Include(x => x.Package) + .Include(x => x.Client) + .Include(x => x.Package) .Select(x => x.GetViewModel) .ToList(); } @@ -86,7 +88,7 @@ namespace SoftwareInstallationDatabaseImplement.Implements public OrderViewModel? Update(OrderBindingModel model) { using var context = new SoftwareInstallationDatabase(); - var order = context.Orders.Include(x => x.Package).FirstOrDefault(x => x.Id == model.Id); + var order = context.Orders.Include(x => x.Client).Include(x => x.Package).FirstOrDefault(x => x.Id == model.Id); if (order == null) { return null; diff --git a/SoftwareInstallation/SoftwareInstallationRestApi/Program.cs b/SoftwareInstallation/SoftwareInstallationRestApi/Program.cs index 979fb13..6696f9a 100644 --- a/SoftwareInstallation/SoftwareInstallationRestApi/Program.cs +++ b/SoftwareInstallation/SoftwareInstallationRestApi/Program.cs @@ -16,7 +16,7 @@ builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient(); -builder.Services.AddTransient(); +builder.Services.AddTransient(); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at diff --git a/SoftwareInstallation/SoftwareInstallationRestApi/log4net.config b/SoftwareInstallation/SoftwareInstallationRestApi/log4net.config index 43b77f9..70e33b9 100644 --- a/SoftwareInstallation/SoftwareInstallationRestApi/log4net.config +++ b/SoftwareInstallation/SoftwareInstallationRestApi/log4net.config @@ -1,7 +1,7 @@  - +