diff --git a/Bank/BankManagersClientApp/Controllers/HomeController.cs b/Bank/BankManagersClientApp/Controllers/HomeController.cs index f4b3a58..08b5f1a 100644 --- a/Bank/BankManagersClientApp/Controllers/HomeController.cs +++ b/Bank/BankManagersClientApp/Controllers/HomeController.cs @@ -26,6 +26,60 @@ namespace BankManagersClientApp.Controllers return View(APIClient.Client); } + [HttpPost] + public void Privacy(string login, string password, string fio) + { + if (APIClient.Client == null) + { + throw new Exception("Вы как суда попали? Суда вход только авторизованным"); + } + if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(fio)) + { + throw new Exception("Введите логин, пароль и ФИО"); + } + APIClient.PostRequest("api/manager/updatemanager", new ManagerBindingModel + { + Id = APIClient.Client.Id, + Fio = fio, + Email = login, + Password = password + }); + APIClient.Client.Fio = fio; + APIClient.Client.Email = login; + APIClient.Client.Password = password; + Response.Redirect("Index"); + } + + [HttpGet] + public IActionResult Register() + { + return View(); + } + + [HttpPost] + public void Register(string login, string password, string fio) + { + if (string.IsNullOrEmpty(login) || + string.IsNullOrEmpty(password) || string.IsNullOrEmpty(fio)) + { + throw new Exception("Введите логин, пароль и ФИО"); + } + APIClient.PostRequest("api/manager/createmanager", new ManagerBindingModel + { + Fio = fio, + Email = login, + Password = password + }); + Response.Redirect("Enter"); + return; + } + + [HttpGet] + public IActionResult Enter() + { + return View(); + } + [HttpPost] public void Enter(string login, string password) { @@ -41,12 +95,6 @@ namespace BankManagersClientApp.Controllers } Response.Redirect("Index"); } - - [HttpGet] - public IActionResult Enter() - { - return View(); - } #endregion #region//Accounts diff --git a/Bank/BankManagersClientApp/Views/Home/Privacy.cshtml b/Bank/BankManagersClientApp/Views/Home/Privacy.cshtml index 2689d5c..7bb4064 100644 --- a/Bank/BankManagersClientApp/Views/Home/Privacy.cshtml +++ b/Bank/BankManagersClientApp/Views/Home/Privacy.cshtml @@ -6,19 +6,32 @@