From a1ddbe8312abe42fbd2a645cfc596423ba425592 Mon Sep 17 00:00:00 2001 From: sardq Date: Mon, 29 Apr 2024 22:58:28 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B4=D0=BE=D0=BB=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84?= =?UTF-8?q?=D0=B5=D0=B9=D1=81=D0=BE=D0=B2=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BD=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 112 +++++------------- .../Views/Home/ExecutionPhase.cshtml | 26 ++++ .../Views/Home/ExecutionPhases.cshtml | 63 ++++++++++ .../FactoryWorkerApp/Views/Home/Index.cshtml | 20 +++- .../Views/Home/PlanProduction.cshtml | 24 ++++ .../Views/Home/PlanProductions.cshtml | 69 +++++++++++ .../Views/Home/Workpiece.cshtml | 11 +- .../Views/Home/Workpieces.cshtml | 10 +- .../Views/Shared/_Layout.cshtml | 5 +- 9 files changed, 242 insertions(+), 98 deletions(-) create mode 100644 Factory/FactoryWorkerApp/Views/Home/ExecutionPhase.cshtml create mode 100644 Factory/FactoryWorkerApp/Views/Home/ExecutionPhases.cshtml create mode 100644 Factory/FactoryWorkerApp/Views/Home/PlanProduction.cshtml create mode 100644 Factory/FactoryWorkerApp/Views/Home/PlanProductions.cshtml diff --git a/Factory/FactoryWorkerApp/Controllers/HomeController.cs b/Factory/FactoryWorkerApp/Controllers/HomeController.cs index abca7f3..48cc95e 100644 --- a/Factory/FactoryWorkerApp/Controllers/HomeController.cs +++ b/Factory/FactoryWorkerApp/Controllers/HomeController.cs @@ -17,38 +17,13 @@ namespace FactoryWorkerApp.Controllers public IActionResult Index() { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } + //if (APIClient.Client == null) + //{ + // return Redirect("~/Home/Enter"); + //} return View(); } - [HttpPost] - public void Privacy(string email, string password, string login) - { - if (APIClient.Client == null) - { - throw new Exception("Вы как суда попали? Суда вход только авторизованным"); - } - if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email)) - { - throw new Exception("Введите логин, пароль и ФИО"); - } - APIClient.PostRequest("api/client/updatedata", new ClientBindingModel - { - Id = APIClient.Client.Id, - Login = login, - Email = email, - Password = password - }); - - APIClient.Client.Login = login; - APIClient.Client.Email = email; - APIClient.Client.Password = password; - Response.Redirect("Index"); - } - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { @@ -61,44 +36,12 @@ namespace FactoryWorkerApp.Controllers return View(); } - [HttpPost] - public void Enter(string login, string password) - { - if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password)) - { - throw new Exception("Введите логин и пароль"); - } - APIClient.Client = APIClient.GetRequest($"api/client/login?login={login}&password={password}"); - if (APIClient.Client == null) - { - throw new Exception("Неверный логин/пароль"); - } - Response.Redirect("Index"); - } - [HttpGet] public IActionResult Register() { return View(); } - [HttpPost] - public void Register(string email, string password, string login) - { - if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email)) - { - throw new Exception("Введите логин, пароль и ФИО"); - } - APIClient.PostRequest("api/client/register", new ClientBindingModel - { - Login = login, - Email = email, - Password = password - }); - Response.Redirect("Enter"); - return; - } - [HttpGet] public IActionResult Create() { @@ -106,26 +49,35 @@ namespace FactoryWorkerApp.Controllers return View(); } - [HttpPost] - public void Create(string name, double cost, string material) + [HttpGet] + public IActionResult Workpieces() { - if (APIClient.Client == null) - { - throw new Exception("Вы как суда попали? Суда вход только авторизованным"); - } - if (cost<= 0) - { - throw new Exception("Количество и сумма должны быть больше 0"); - } - APIClient.PostRequest("api/main/createorder", new WorkpieceBindingModel - { - ClientId = APIClient.Client.Id, - Material = material, - Cost = cost, - WorkpieceName = name, - - }); - Response.Redirect("Index"); + return View(new List()); + } + [HttpGet] + public IActionResult Workpiece() + { + return View(); + } + [HttpGet] + public IActionResult PlanProductions() + { + return View(new List()); + } + [HttpGet] + public IActionResult PlanProduction() + { + return View(); + } + [HttpGet] + public IActionResult ExecutionPhases() + { + return View(new List()); + } + [HttpGet] + public IActionResult ExecutionPhase() + { + return View(); } } } \ No newline at end of file diff --git a/Factory/FactoryWorkerApp/Views/Home/ExecutionPhase.cshtml b/Factory/FactoryWorkerApp/Views/Home/ExecutionPhase.cshtml new file mode 100644 index 0000000..30f8887 --- /dev/null +++ b/Factory/FactoryWorkerApp/Views/Home/ExecutionPhase.cshtml @@ -0,0 +1,26 @@ +@{ + ViewData["Title"] = "Workpiece"; +} +
+

Заготовка

+
+
+
+
План производства:
+
+ +
+
+
+
Название:
+
+
+
+
Статус:
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/Factory/FactoryWorkerApp/Views/Home/ExecutionPhases.cshtml b/Factory/FactoryWorkerApp/Views/Home/ExecutionPhases.cshtml new file mode 100644 index 0000000..8e6744b --- /dev/null +++ b/Factory/FactoryWorkerApp/Views/Home/ExecutionPhases.cshtml @@ -0,0 +1,63 @@ +@using FactoryContracts.ViewModels +@model List + +@{ + ViewData["Title"] = "Execution Phases"; +} +
+

Этапы выполнения

+
+ + +
+ @{ + //if (Model == null) + //{ + //

Авторизируйтесь

+ // return; + //} + +

+ Создать + +

+ + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + } + +
+ Название + + Логин клиента + + ФИО исполнителя + + Статус +
+ @Html.DisplayFor(modelItem => item.ExecutionPhaseName) + + @Html.DisplayFor(modelItem => item.ClientLogin) + + @Html.DisplayFor(modelItem => item.ImplementerFIO) + + @Html.DisplayFor(modelItem => item.Status) +
+ } +
\ No newline at end of file diff --git a/Factory/FactoryWorkerApp/Views/Home/Index.cshtml b/Factory/FactoryWorkerApp/Views/Home/Index.cshtml index 53e5503..c1aea52 100644 --- a/Factory/FactoryWorkerApp/Views/Home/Index.cshtml +++ b/Factory/FactoryWorkerApp/Views/Home/Index.cshtml @@ -12,17 +12,25 @@
@{ - if (Model == null) - { -

Авторизируйтесь

- return; - } + //if (Model == null) + //{ + //

Авторизируйтесь

+ // return; + //}

Заготовки +

+

Планы производства +

+

Привзяка планов производства к заготовкам - Этапы выполнения +

+

+ Этапы выполнения +

+

Получение списка

} diff --git a/Factory/FactoryWorkerApp/Views/Home/PlanProduction.cshtml b/Factory/FactoryWorkerApp/Views/Home/PlanProduction.cshtml new file mode 100644 index 0000000..8c0a709 --- /dev/null +++ b/Factory/FactoryWorkerApp/Views/Home/PlanProduction.cshtml @@ -0,0 +1,24 @@ +@{ + ViewData["Title"] = "Plan Production"; +} +
+

План производства

+
+
+
+
Название:
+
+
+
+
Количество:
+
+
+
+
Срок выполнения:
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/Factory/FactoryWorkerApp/Views/Home/PlanProductions.cshtml b/Factory/FactoryWorkerApp/Views/Home/PlanProductions.cshtml new file mode 100644 index 0000000..e3b3980 --- /dev/null +++ b/Factory/FactoryWorkerApp/Views/Home/PlanProductions.cshtml @@ -0,0 +1,69 @@ +@using FactoryContracts.ViewModels +@model List + +@{ + ViewData["Title"] = "Plan Productions"; +} +
+

Планы производства

+
+ + +
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } + +

+ Создать + +

+ + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + } + +
+ Название + + Логин клиента + + Количество + + Этап выполнения + + Срок выполнения +
+ @Html.DisplayFor(modelItem => item.ProductionName) + + @Html.DisplayFor(modelItem => item.ClientLogin) + + @Html.DisplayFor(modelItem => item.Count) + + @Html.DisplayFor(modelItem => item.ExecutionPhaseName) + + @Html.DisplayFor(modelItem => item.Deadline) +
+ } +
\ No newline at end of file diff --git a/Factory/FactoryWorkerApp/Views/Home/Workpiece.cshtml b/Factory/FactoryWorkerApp/Views/Home/Workpiece.cshtml index 1fee081..94dcf73 100644 --- a/Factory/FactoryWorkerApp/Views/Home/Workpiece.cshtml +++ b/Factory/FactoryWorkerApp/Views/Home/Workpiece.cshtml @@ -1,4 +1,5 @@ -@{ +@using FactoryContracts.ViewModels +@{ ViewData["Title"] = "Workpiece"; }
@@ -8,12 +9,16 @@
Изделие:
- +
+
+
Название:
+
+
Материал:
-
+
Цена:
diff --git a/Factory/FactoryWorkerApp/Views/Home/Workpieces.cshtml b/Factory/FactoryWorkerApp/Views/Home/Workpieces.cshtml index bd25080..d9481f9 100644 --- a/Factory/FactoryWorkerApp/Views/Home/Workpieces.cshtml +++ b/Factory/FactoryWorkerApp/Views/Home/Workpieces.cshtml @@ -11,11 +11,11 @@
@{ - if (Model == null) - { -

Авторизируйтесь

- return; - } + //if (Model == null) + //{ + //

Авторизируйтесь

+ // return; + //}

Создать заказ diff --git a/Factory/FactoryWorkerApp/Views/Shared/_Layout.cshtml b/Factory/FactoryWorkerApp/Views/Shared/_Layout.cshtml index c71300d..ea22d65 100644 --- a/Factory/FactoryWorkerApp/Views/Shared/_Layout.cshtml +++ b/Factory/FactoryWorkerApp/Views/Shared/_Layout.cshtml @@ -20,10 +20,7 @@