diff --git a/HardwareShop/HardwareShopWorkerApp/Controllers/HomeController.cs b/HardwareShop/HardwareShopWorkerApp/Controllers/HomeController.cs index bdc3938..5f9f0a2 100644 --- a/HardwareShop/HardwareShopWorkerApp/Controllers/HomeController.cs +++ b/HardwareShop/HardwareShopWorkerApp/Controllers/HomeController.cs @@ -28,15 +28,7 @@ namespace HardwareShopWorkerApp.Controllers { throw new Exception("Введите логин, email, пароль и роль"); } - APIClient.PostRequest("api/client/register", new UserBindingModel - { - Login = login, - Email = email, - Password = password, - Role = (UserRole)role - }); Response.Redirect("Enter"); - return; } public IActionResult Index() @@ -61,18 +53,70 @@ namespace HardwareShopWorkerApp.Controllers } [HttpPost] - public IActionResult Enter(string email, string password) + public void Enter(string email, string password) { if (string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password)) { throw new Exception("Введите почту и пароль"); } - APIClient.User = APIClient.GetRequest($"api/client/login?email={email}&password={password}"); - if (APIClient.User == null) - { - throw new Exception("Неверные почта и/или пароль"); - } - return RedirectToAction("MainWorker", "Worker"); + Response.Redirect("MainWorker"); + } + + public IActionResult MainWorker() + { + return View(); + } + + public IActionResult Comments() + { + return View(); + } + + public IActionResult listComponents() + { + return View(); + } + + [HttpGet] + public IActionResult Purchases() + { + return View(); + } + + [HttpPost] + public void Purchases(int id) + { + Response.Redirect("Purchase"); + } + + + [HttpGet] + public IActionResult Purchase() + { + return View(); + } + + public IActionResult WorkerReport() + { + return View(); + } + + [HttpGet] + public IActionResult Builds() + { + return View(); + } + + [HttpPost] + public void Builds(int id) + { + Response.Redirect("LinkPurchase"); + } + + [HttpGet] + public IActionResult LinkPurchase() + { + return View(); } } } \ No newline at end of file diff --git a/HardwareShop/HardwareShopWorkerApp/Controllers/WorkerController.cs b/HardwareShop/HardwareShopWorkerApp/Controllers/WorkerController.cs deleted file mode 100644 index 0dac16d..0000000 --- a/HardwareShop/HardwareShopWorkerApp/Controllers/WorkerController.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace HardwareShopWorkerApp.Controllers -{ - public class WorkerController : Controller - { - private readonly ILogger _logger; - - public WorkerController(ILogger logger) - { - _logger = logger; - } - - public IActionResult Comments() - { - return View(); - } - - public IActionResult listComponents() - { - return View(); - } - - public IActionResult MainWorker() - { - return View(); - } - - [HttpGet] - public IActionResult Purchases() - { - return View(); - } - - [HttpPost] - public void Purchases(int id) - { - Response.Redirect("Purchase"); - } - - - [HttpGet] - public IActionResult Purchase() - { - return View(); - } - - public IActionResult WorkerReport() - { - return View(); - } - - [HttpGet] - public IActionResult Builds() - { - return View(); - } - - [HttpPost] - public void Builds(int id) - { - Response.Redirect("LinkPurchase"); - } - - [HttpGet] - public IActionResult LinkPurchase() - { - return View(); - } - - } -} diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Worker/Builds.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/Builds.cshtml similarity index 100% rename from HardwareShop/HardwareShopWorkerApp/Views/Worker/Builds.cshtml rename to HardwareShop/HardwareShopWorkerApp/Views/Home/Builds.cshtml diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Worker/Comments.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/Comments.cshtml similarity index 100% rename from HardwareShop/HardwareShopWorkerApp/Views/Worker/Comments.cshtml rename to HardwareShop/HardwareShopWorkerApp/Views/Home/Comments.cshtml diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Home/Index.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/Index.cshtml index b909037..15693ff 100644 --- a/HardwareShop/HardwareShopWorkerApp/Views/Home/Index.cshtml +++ b/HardwareShop/HardwareShopWorkerApp/Views/Home/Index.cshtml @@ -19,7 +19,7 @@ Регистрация diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Worker/LinkPurchase.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/LinkPurchase.cshtml similarity index 100% rename from HardwareShop/HardwareShopWorkerApp/Views/Worker/LinkPurchase.cshtml rename to HardwareShop/HardwareShopWorkerApp/Views/Home/LinkPurchase.cshtml diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Worker/MainWorker.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/MainWorker.cshtml similarity index 77% rename from HardwareShop/HardwareShopWorkerApp/Views/Worker/MainWorker.cshtml rename to HardwareShop/HardwareShopWorkerApp/Views/Home/MainWorker.cshtml index d5b8a9e..9a15a29 100644 --- a/HardwareShop/HardwareShopWorkerApp/Views/Worker/MainWorker.cshtml +++ b/HardwareShop/HardwareShopWorkerApp/Views/Home/MainWorker.cshtml @@ -4,5 +4,5 @@ }
- +
\ No newline at end of file diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Worker/Purchase.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/Purchase.cshtml similarity index 100% rename from HardwareShop/HardwareShopWorkerApp/Views/Worker/Purchase.cshtml rename to HardwareShop/HardwareShopWorkerApp/Views/Home/Purchase.cshtml diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Worker/Purchases.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/Purchases.cshtml similarity index 100% rename from HardwareShop/HardwareShopWorkerApp/Views/Worker/Purchases.cshtml rename to HardwareShop/HardwareShopWorkerApp/Views/Home/Purchases.cshtml diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Worker/WorkerReport.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/WorkerReport.cshtml similarity index 100% rename from HardwareShop/HardwareShopWorkerApp/Views/Worker/WorkerReport.cshtml rename to HardwareShop/HardwareShopWorkerApp/Views/Home/WorkerReport.cshtml diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Worker/listComponents.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/listComponents.cshtml similarity index 100% rename from HardwareShop/HardwareShopWorkerApp/Views/Worker/listComponents.cshtml rename to HardwareShop/HardwareShopWorkerApp/Views/Home/listComponents.cshtml diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Shared/_LayoutWorker.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Shared/_LayoutWorker.cshtml index 50a1f46..9f0f51c 100644 --- a/HardwareShop/HardwareShopWorkerApp/Views/Shared/_LayoutWorker.cshtml +++ b/HardwareShop/HardwareShopWorkerApp/Views/Shared/_LayoutWorker.cshtml @@ -20,19 +20,19 @@