diff --git a/Bank/BankManagersClientApp/Controllers/HomeController.cs b/Bank/BankManagersClientApp/Controllers/HomeController.cs index e1eb649..578d1e2 100644 --- a/Bank/BankManagersClientApp/Controllers/HomeController.cs +++ b/Bank/BankManagersClientApp/Controllers/HomeController.cs @@ -396,6 +396,21 @@ namespace BankManagersClientApp.Controllers Response.Redirect("Withdrawals"); } + [HttpGet] + public WithdrawalViewModel? GetWithdrawal(int withdrawalId) + { + if (APIClient.Client == null) + { + throw new Exception("Вы как суда попали? Суда вход только авторизованным"); + } + var result = APIClient.GetRequest($"api/withdrawal/getwithdrawal?withdrawalid={withdrawalId}"); + if (result == null) + { + return default; + } + return result; + } + [HttpGet] public List GetAccounts(int withdrawalId) { diff --git a/Bank/BankManagersClientApp/Views/Home/WithdrawalUpdate.cshtml b/Bank/BankManagersClientApp/Views/Home/WithdrawalUpdate.cshtml index e389ed0..a98a67e 100644 --- a/Bank/BankManagersClientApp/Views/Home/WithdrawalUpdate.cshtml +++ b/Bank/BankManagersClientApp/Views/Home/WithdrawalUpdate.cshtml @@ -59,7 +59,13 @@ } }); $.ajax({ - }); + method: "GET", + url: "/Home/GetWithdrawal", + data: { withdrawalId: withdrawal }, + success: function (result) { + $('#sum').val(result.sum) + } + }) }; } check();