From 369a8a8bca4f4ccfe74558b58cf0e015e2e7cabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BA=20=D0=98=D0=B3=D0=BE=D1=80=D1=8C?= Date: Mon, 12 Jun 2023 00:42:14 +0400 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=D1=8B=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8E=20=D0=BC?= =?UTF-8?q?=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 14 ++++++++++- .../Views/Home/Create.cshtml | 24 +++++++++++++++++++ .../Views/Home/Index.cshtml | 5 +++- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Create.cshtml diff --git a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Controllers/HomeController.cs b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Controllers/HomeController.cs index 825d0c5..2555623 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Controllers/HomeController.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Controllers/HomeController.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopContracts.ViewModels; +using BlacksmithWorkshopContracts.BindingModels; +using BlacksmithWorkshopContracts.ViewModels; using BlacksmithWorkshopStoreApp.Models; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; @@ -40,6 +41,17 @@ namespace BlacksmithWorkshopStoreApp.Controllers } return Redirect("~/Home/Index"); } + [HttpGet] + public IActionResult Create() + { + return View(); + } + [HttpPost] + public IActionResult Create(StoreBindingModel model) + { + APIClient.PostRequest("/api/store/createstore", model); + return Redirect("~/Home/Stores"); + } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { diff --git a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Create.cshtml b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Create.cshtml new file mode 100644 index 0000000..bb90ded --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Create.cshtml @@ -0,0 +1,24 @@ +@{ + ViewData["Title"] = "Создание магазина"; +} +
+
+
Название магазина:
+
+
+
+
Адрес:
+
+
+
+
Дата открытия:
+
+
+
+
Макс. изделий:
+
+
+
+
+
+
\ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Index.cshtml b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Index.cshtml index 4bc110c..f745bca 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Index.cshtml +++ b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Index.cshtml @@ -35,4 +35,7 @@ else {
Магазинов нет
-} \ No newline at end of file +} +
+ +
\ No newline at end of file