From 08d0edf66825a322b6d239adadfcbe0f55466cd5 Mon Sep 17 00:00:00 2001 From: shadowik Date: Wed, 17 May 2023 18:49:15 +0400 Subject: [PATCH] FirstReportCards --- .../Controllers/HomeController.cs | 14 ++++- .../Views/Home/ReportWithCards.cshtml | 56 +++++++++++++++++++ .../Views/Shared/_Layout.cshtml | 28 +++++----- .../ViewModels/ReportClientCardsViewModel.cs | 17 ++++++ 4 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportWithCards.cshtml create mode 100644 BankYouBankrupt/BankYouBankruptContracts/ViewModels/ReportClientCardsViewModel.cs diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs index f4fae54..11cceea 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs @@ -142,7 +142,6 @@ namespace BankYouBankruptClientApp.Controllers #endregion - #region Снятие средств [HttpGet] @@ -239,5 +238,18 @@ namespace BankYouBankruptClientApp.Controllers } #endregion + + [HttpGet] + public IActionResult ReportWithCards() + { + if (APIClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + + return View(new ReportClientCardsViewModel() { + Cards = APIClient.GetRequest>($"api/Card/GetUsersCardsList?id={APIClient.Client.Id}") + }); + } } } \ No newline at end of file diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportWithCards.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportWithCards.cshtml new file mode 100644 index 0000000..25d24bc --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportWithCards.cshtml @@ -0,0 +1,56 @@ +@using BankYouBankruptContracts.ViewModels + +@model ReportClientCardsViewModel + +@{ + ViewData["Title"] = "Отчет по картам"; +} + +
+

Отчет

+
+ +
+ +
+
+
+ @foreach (var item in Model.Cards) + { +
+ + +
+ + } +
+
+
+
+ + + + + + + + + + + + +
+ Номер карты + + Сумма + + Статус + + Дата открытия + + Дата закрытия +
+
+
+
+
\ No newline at end of file diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Shared/_Layout.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Shared/_Layout.cshtml index 5bb532c..7841046 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Shared/_Layout.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Shared/_Layout.cshtml @@ -24,19 +24,21 @@ diff --git a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/ReportClientCardsViewModel.cs b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/ReportClientCardsViewModel.cs new file mode 100644 index 0000000..6c2512b --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/ReportClientCardsViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankYouBankruptContracts.ViewModels +{ + public class ReportClientCardsViewModel + { + public List? Cards { get; set; } = new(); + + public List? Debitings { get; set; } = new(); + + public List? Creditings { get; set; } = new(); + } +}