From 82f8a241d698b86a3ede6971ea2b6cd2744b09c7 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:21:59 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=B0=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlacksmithWorkshopStoreApp.csproj | 4 +++ .../Controllers/HomeController.cs | 4 ++- .../Views/Home/Index.cshtml | 36 +++++++++++++++++-- .../Views/Shared/_Layout.cshtml | 2 +- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/BlacksmithWorkshopStoreApp.csproj b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/BlacksmithWorkshopStoreApp.csproj index 0ed8702..d2be2f5 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/BlacksmithWorkshopStoreApp.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/BlacksmithWorkshopStoreApp.csproj @@ -10,4 +10,8 @@ + + + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Controllers/HomeController.cs b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Controllers/HomeController.cs index 7c6f84b..825d0c5 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Controllers/HomeController.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Controllers/HomeController.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopStoreApp.Models; +using BlacksmithWorkshopContracts.ViewModels; +using BlacksmithWorkshopStoreApp.Models; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; @@ -18,6 +19,7 @@ namespace BlacksmithWorkshopStoreApp.Controllers { return Redirect("~/Home/Enter"); } + ViewBag.Stores = APIClient.GetRequest>("/api/store/getstores"); return View(); } [HttpGet] diff --git a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Index.cshtml b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Index.cshtml index d2d19bd..4bc110c 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Index.cshtml +++ b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Home/Index.cshtml @@ -1,8 +1,38 @@ @{ - ViewData["Title"] = "Home Page"; + ViewData["Title"] = "Магазины"; }
-

Welcome

-

Learn about building Web apps with ASP.NET Core.

+

Список магазинов

+@if (ViewBag.Stores.Count != 0) +{ + + + + + + + + + + + @foreach (var store in ViewBag.Stores) + { + + + + + + + + + + } + +
НазваниеАдресДата открытияМакс. изделий
@store.StoreName@store.Address@store.OpeningDate@store.MaxManufacturesИзменитьУдалитьПоставить изделие
+} +else +{ +
Магазинов нет
+} \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Shared/_Layout.cshtml b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Shared/_Layout.cshtml index 601cf5f..72c0044 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Shared/_Layout.cshtml +++ b/BlacksmithWorkshop/BlacksmithWorkshopStoreApp/Views/Shared/_Layout.cshtml @@ -20,7 +20,7 @@