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 @@