diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs index 391f795..206ff52 100644 --- a/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs @@ -148,16 +148,21 @@ namespace BankYouBankruptCashierApp.Controllers //открытие счёта. Получаем и передаём список изделий во вьюху? [HttpGet] - public IActionResult Create() + public IActionResult CreateAccount() { - ViewBag.Clients = APICashier.GetRequest>("/api/Client/GetAllClients"); + //запрашиваем список в формате вспомогательной вьюшки из-за работы select в asp net + ViewBag.Clients = APICashier.GetRequest>($"/api/Client/GetAllClients").Select(x => new ClientSelectViewModel + { + Id = x.Id, + FullName = x.Surname + " " + x.Name + " " + x.Patronymic + }).ToList(); - return View(); - } + return View(); + } //создание заказа Post-запросом [HttpPost] - public void Create(int clientId, string accountNumber, string password, int balance) + public void CreateAccount(int clientId, string accountNumber, string password, int balance) { if (APICashier.Cashier == null) { diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/Create.cshtml b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/CreateAccount.cshtml similarity index 92% rename from BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/Create.cshtml rename to BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/CreateAccount.cshtml index 2486046..0cec3c9 100644 --- a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/Create.cshtml +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/CreateAccount.cshtml @@ -9,7 +9,7 @@
Клиент:
- +
diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/Index.cshtml b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/Index.cshtml index bbaf558..21beb46 100644 --- a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/Index.cshtml +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/Index.cshtml @@ -18,7 +18,7 @@ return; }

- Открыть счёт + Открыть счёт

diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs index f4fae54..0393708 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs @@ -211,7 +211,7 @@ namespace BankYouBankruptClientApp.Controllers } - ViewBag.Cards = APIClient.GetRequest>($"api/Card/GetAllCards").Select(x => new ClientCardViewModel + ViewBag.Cards = APIClient.GetRequest>($"api/Card/GetAllCards").Select(x => new ClientSelectViewModel { Id = x.Id, FullName = x.ClientSurname + " " +x.Number.ToString() diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CardsList.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CardsList.cshtml index d377a36..95ff86a 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CardsList.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CardsList.cshtml @@ -3,7 +3,7 @@ @model List @{ - ViewData["Title"] = "Home Page"; + ViewData["Title"] = "Список карт"; }
diff --git a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/ClientCardViewModel.cs b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/ClientSelectViewModel.cs similarity index 90% rename from BankYouBankrupt/BankYouBankruptContracts/ViewModels/ClientCardViewModel.cs rename to BankYouBankrupt/BankYouBankruptContracts/ViewModels/ClientSelectViewModel.cs index 0ef220c..7a5af46 100644 --- a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/ClientCardViewModel.cs +++ b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/ClientSelectViewModel.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace BankYouBankruptContracts.ViewModels { - public class ClientCardViewModel + public class ClientSelectViewModel { public int Id { get; set; }