diff --git a/AutoWorkshopClientApp/Controllers/HomeController.cs b/AutoWorkshopClientApp/Controllers/HomeController.cs index 52826de..b2e4e1e 100644 --- a/AutoWorkshopClientApp/Controllers/HomeController.cs +++ b/AutoWorkshopClientApp/Controllers/HomeController.cs @@ -156,5 +156,16 @@ namespace AutoWorkshopClientApp.Controllers RepairViewModel? Repair = ApiClient.GetRequest($"api/main/getrepair?repairId={repair}"); return count * (Repair?.Price ?? 1); } + + [HttpGet] + public IActionResult Mails() + { + if (ApiClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + + return View(ApiClient.GetRequest>($"api/client/getmessages?clientId={ApiClient.Client.Id}")); + } } } diff --git a/AutoWorkshopClientApp/Views/Home/Mails.cshtml b/AutoWorkshopClientApp/Views/Home/Mails.cshtml new file mode 100644 index 0000000..ab4764e --- /dev/null +++ b/AutoWorkshopClientApp/Views/Home/Mails.cshtml @@ -0,0 +1,51 @@ +@using AutoWorkshopContracts.ViewModels + +@model List +@{ + ViewData["Title"] = "Mails"; +} + +
+

Заказы

+
+ +
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } + + + + + + + + + + @foreach (var Item in Model) + { + + + + + + } + +
+ Дата письма + + Заголовок + + Текст +
+ @Html.DisplayFor(modelItem => Item.DateDelivery) + + @Html.DisplayFor(modelItem => Item.Subject) + + @Html.DisplayFor(modelItem => Item.Body) +
+ } +
diff --git a/AutoWorkshopClientApp/Views/Shared/_Layout.cshtml b/AutoWorkshopClientApp/Views/Shared/_Layout.cshtml index 14e847b..6297fac 100644 --- a/AutoWorkshopClientApp/Views/Shared/_Layout.cshtml +++ b/AutoWorkshopClientApp/Views/Shared/_Layout.cshtml @@ -26,6 +26,9 @@ +
  • + Письма +