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