From fe90954785d6f4f8c6cc807a5b6f367a122cb06d Mon Sep 17 00:00:00 2001 From: Safgerd Date: Sun, 23 Apr 2023 15:53:26 +0400 Subject: [PATCH] =?UTF-8?q?LabWork05=5FHard:=20=D0=A4=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ShopController.cs | 2 +- .../Controllers/HomeController.cs | 7 ++++--- .../Views/Home/Update.cshtml | 15 +++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/AutomobilePlant/AutomobilePlantRestApi/Controllers/ShopController.cs b/AutomobilePlant/AutomobilePlantRestApi/Controllers/ShopController.cs index 5a75afc..de9ae6b 100644 --- a/AutomobilePlant/AutomobilePlantRestApi/Controllers/ShopController.cs +++ b/AutomobilePlant/AutomobilePlantRestApi/Controllers/ShopController.cs @@ -51,7 +51,7 @@ namespace AutomobilePlantRestApi.Controllers carCount.Add(new Tuple(car.Value.Item1.CarName, car.Value.Item2)); } - shop = new ShopViewModel() + shop = new() { Id = shop.Id, Name = shop.Name, diff --git a/AutomobilePlant/AutomobilePlantShopApp/Controllers/HomeController.cs b/AutomobilePlant/AutomobilePlantShopApp/Controllers/HomeController.cs index b3b67e3..84f146e 100644 --- a/AutomobilePlant/AutomobilePlantShopApp/Controllers/HomeController.cs +++ b/AutomobilePlant/AutomobilePlantShopApp/Controllers/HomeController.cs @@ -4,6 +4,7 @@ using AutomobilePlantContracts.ViewModels; using AutomobilePlantShopApp.Models; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; +using System.Xml.Linq; namespace AutomobilePlantShopApp.Controllers { @@ -105,7 +106,7 @@ namespace AutomobilePlantShopApp.Controllers return View(); } [HttpPost] - public void Update(int shop, string shopName, string address, DateTime dateOpening, int count) + public void Update(int shop, string name, string address, DateTime openingDate, int count) { if (!APIClient.isAuth) { @@ -115,9 +116,9 @@ namespace AutomobilePlantShopApp.Controllers APIClient.PostRequest($"api/shop/updateshop", new ShopBindingModel { Id = shop, - Name = shopName, + Name = name, Address = address, - OpeningDate = dateOpening, + OpeningDate = openingDate, MaxCountCars = count } ); diff --git a/AutomobilePlant/AutomobilePlantShopApp/Views/Home/Update.cshtml b/AutomobilePlant/AutomobilePlantShopApp/Views/Home/Update.cshtml index cc84957..9467069 100644 --- a/AutomobilePlant/AutomobilePlantShopApp/Views/Home/Update.cshtml +++ b/AutomobilePlant/AutomobilePlantShopApp/Views/Home/Update.cshtml @@ -13,7 +13,7 @@
Название:
-
+
Адрес:
@@ -22,7 +22,7 @@
Дата открытия:
- +
@@ -39,7 +39,7 @@ Количество - +
@@ -66,11 +66,10 @@ }); } - function fillTable(carcount) { - $("#carcount").empty(); + function fillTable(CarCount) { + $("#carCount").empty(); - for (var i = 0; i < carcount.length; i++) - $("#carcount").append('' + carcount[i].item1 + - '' + carcount[i].item2 + ''); + for (var i = 0; i < CarCount.length; i++) + $("#carCount").append('' + carCount[i].item1 + '' + carCount[i].item2 + ''); } \ No newline at end of file