diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs index 21b02d9..4484429 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs @@ -10,8 +10,8 @@ using System.Xml.Linq; namespace BankYouBankruptClientApp.Controllers { - public class HomeController : Controller - { + public class HomeController : Controller + { private readonly ILogger _logger; public HomeController(ILogger logger) @@ -78,7 +78,7 @@ namespace BankYouBankruptClientApp.Controllers [HttpPost] public void Register(string login, string password, string name, string surname, string patronymic, string telephone) { - if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(name) + if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(name) || string.IsNullOrEmpty(surname) || string.IsNullOrEmpty(patronymic) || string.IsNullOrEmpty(telephone)) { throw new Exception("Введите логин, пароль, ФИО и телефон"); @@ -213,7 +213,7 @@ namespace BankYouBankruptClientApp.Controllers ViewBag.Cards = APIClient.GetRequest>($"api/Card/GetAllCards").Select(x => new ClientSelectViewModel { Id = x.Id, - FullName = x.ClientSurname + " " +x.Number.ToString() + FullName = x.ClientSurname + " " + x.Number.ToString() }).ToList(); return View(); } @@ -239,11 +239,22 @@ namespace BankYouBankruptClientApp.Controllers #endregion + #region Получение отчёта [HttpGet] public IActionResult CreateReport() { + return View(); + } + + [HttpPost] + public void CreateReport(DateTime DateFrom, DateTime DateTo) + { + + } + + #endregion [HttpGet] public IActionResult ReportWithCards() @@ -255,12 +266,12 @@ namespace BankYouBankruptClientApp.Controllers return View(new ReportClientCardsViewModel() { - Cards = APIClient.GetRequest>($"api/Card/GetUsersCardsList?id={APIClient.Client.Id}").Select(x => new CheckboxViewModel() { + Cards = APIClient.GetRequest>($"api/Card/GetUsersCardsList?id={APIClient.Client.Id}").Select(x => new CheckboxViewModel() { Id = x.Id, LabelName = x.Number, IsChecked = false }).ToList() - }) ; + }); } [HttpPost] @@ -273,12 +284,12 @@ namespace BankYouBankruptClientApp.Controllers List cardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList(); List creditings = APIClient.GetRequest>($"api/Client/getUsersCreditings?userId={APIClient.Client.Id}") - .Where(x => cardList.Contains(x.CardId)).Select(x => new ReportViewModel() { - Id=x.Id, - CardId=x.CardId, - DateOpen=x.DateOpen, - DateClose=x.DateClose, - CardNumber=x.CardNumber, + .Where(x => cardList.Contains(x.CardId)).Select(x => new ReportViewModel() { + Id = x.Id, + CardId = x.CardId, + DateOpen = x.DateOpen, + DateClose = x.DateClose, + CardNumber = x.CardNumber, Status = x.Status, Sum = x.Sum, TypeOperation = TypeOperationEnum.Пополнение @@ -302,23 +313,7 @@ namespace BankYouBankruptClientApp.Controllers Cards = cards, Operations = result, - }) ; + }); } - - #region Получение отчёта - - [HttpGet] - public IActionResult CreateReport() - { - return View(); - } - - [HttpPost] - public void CreateReport(DateTime DateFrom, DateTime DateTo) - { - - } - - #endregion - } - } \ No newline at end of file + } +} \ No newline at end of file