From 03b010bbedcbb98db50afb7e9c0f42a86fac3870 Mon Sep 17 00:00:00 2001 From: aleksandr chegodaev Date: Tue, 30 Apr 2024 22:23:33 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D0=B5=D0=B1-=D0=BA=D0=B0=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...{IndexCarSales.cshtml => IndexCars.cshtml} | 0 .../CarCenterImplementerAPP.csproj | 8 +- .../Controllers/HomeController.cs | 118 +++++++++++++++++- .../Views/Home/CreateBonus.cshtml | 56 +++++++++ .../Views/Home/Enter.cshtml | 21 ++++ .../Views/Home/Index.cshtml | 11 +- .../Views/Home/IndexBonus.cshtml | 63 ++++++++++ .../Views/Home/IndexCars.cshtml | 59 +++++++++ .../Views/Home/Register.cshtml | 29 +++++ .../Views/Home/ReportsMenu.cshtml | 11 ++ .../Views/Shared/_Layout.cshtml | 22 +--- 11 files changed, 374 insertions(+), 24 deletions(-) rename CarCenterDirectorAPP/Views/Home/{IndexCarSales.cshtml => IndexCars.cshtml} (100%) create mode 100644 CarCenterImplementerAPP/Views/Home/CreateBonus.cshtml create mode 100644 CarCenterImplementerAPP/Views/Home/Enter.cshtml create mode 100644 CarCenterImplementerAPP/Views/Home/IndexBonus.cshtml create mode 100644 CarCenterImplementerAPP/Views/Home/IndexCars.cshtml create mode 100644 CarCenterImplementerAPP/Views/Home/Register.cshtml create mode 100644 CarCenterImplementerAPP/Views/Home/ReportsMenu.cshtml diff --git a/CarCenterDirectorAPP/Views/Home/IndexCarSales.cshtml b/CarCenterDirectorAPP/Views/Home/IndexCars.cshtml similarity index 100% rename from CarCenterDirectorAPP/Views/Home/IndexCarSales.cshtml rename to CarCenterDirectorAPP/Views/Home/IndexCars.cshtml diff --git a/CarCenterImplementerAPP/CarCenterImplementerAPP.csproj b/CarCenterImplementerAPP/CarCenterImplementerAPP.csproj index 4c2bb77..922a168 100644 --- a/CarCenterImplementerAPP/CarCenterImplementerAPP.csproj +++ b/CarCenterImplementerAPP/CarCenterImplementerAPP.csproj @@ -1,4 +1,4 @@ - + net7.0 @@ -6,4 +6,10 @@ enable + + + + + + diff --git a/CarCenterImplementerAPP/Controllers/HomeController.cs b/CarCenterImplementerAPP/Controllers/HomeController.cs index c35f94e..cde1418 100644 --- a/CarCenterImplementerAPP/Controllers/HomeController.cs +++ b/CarCenterImplementerAPP/Controllers/HomeController.cs @@ -1,12 +1,21 @@ -using CarCenterImplementerAPP.Models; +using CarCenterManagerAPP.Models; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; +using CarCenterBusinessLogic.BusinessLogics; +using CarCenterContracts.BusinessLogicsContracts; +using CarCenterContracts.ViewModels; +using CarCenterDataModels.Models; +using CarCenterDataBaseImplement.Models; -namespace CarCenterImplementerAPP.Controllers +namespace ImplementerApp.Controllers { public class HomeController : Controller { private readonly ILogger _logger; + private readonly IEmployeeLogic _employeeLogic; + private readonly IManagerLogic _managerLogic; + private readonly IPreSaleWorkLogic _presaleworkLogic; + private readonly ISaleLogic _saleLogic; public HomeController(ILogger logger) { @@ -17,16 +26,119 @@ namespace CarCenterImplementerAPP.Controllers { return View(); } + public IActionResult Enter() + { + return View(); + } + public IActionResult Register() + { + return View(); + } + public IActionResult IndexEmployee() + { + List Employee = new List(); + new EmployeeViewModel + { + Id = 1, + EmployeeFIO = "EmployeeFIO1", + EmployeePost = "EmployeePost1", + EmployeeSalary = 500.0M, + ManagerId = 1, + EmployeeSales = new() + }; + new EmployeeViewModel + { + Id = 2, + EmployeeFIO = "EmployeeFIO2", + EmployeePost = "EmployeePost2", + EmployeeSalary = 5100.0M, + ManagerId = 2, + EmployeeSales = new() + }; + return View(Employee); + } + public IActionResult CreateEmployee() + { + return View(); + } + public IActionResult IndexPreSaleWork() + { + return View(new List()); + } + public IActionResult CreatePreSaleWork() + { + var work = new List(); + work.Add(new PreSaleWorkViewModel + { + Id = 1, + PreSaleWorkType = "PreSaleWork1", + PreSaleWorkDate = DateTime.Now, + PreSaleWorkPrice = 50000.9M, + ManagerId = 1, + CompletionsId = 1, + PreSaleWorkSales = new() + }); + work.Add(new PreSaleWorkViewModel + { + Id = 2, + PreSaleWorkType = "PreSaleWork2", + PreSaleWorkDate = DateTime.Now, + PreSaleWorkPrice = 100000.9M, + ManagerId = 2, + CompletionsId = 2, + PreSaleWorkSales = new() + }); + return View(work); + } + public IActionResult IndexSale() + { + return View(new List()); + } + public IActionResult CreateSale() + { + List Sales = new List(); + new SaleViewModel + { + Id = 1, + SaleName = "Sale1", + SalePrice = 100.5M, + SaleDate = DateTime.Now, + ManagerId = 1, + }; + new SaleViewModel + { + Id = 2, + SaleName = "Sale2", + SalePrice = 600.0M, + SaleDate = DateTime.Now, + ManagerId = 2, + }; + return View(Sales); + } public IActionResult Privacy() { return View(); } + public IActionResult ReportsMenu() + { + return View(); + } + + public IActionResult SalesInspectionsReport() + { + return View(new List()); + } + public IActionResult SalesPeriodReport() + { + return View(new List()); + } + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } -} +} \ No newline at end of file diff --git a/CarCenterImplementerAPP/Views/Home/CreateBonus.cshtml b/CarCenterImplementerAPP/Views/Home/CreateBonus.cshtml new file mode 100644 index 0000000..c8becfa --- /dev/null +++ b/CarCenterImplementerAPP/Views/Home/CreateBonus.cshtml @@ -0,0 +1,56 @@ +@using CarCenterContracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "CreateBonus"; +} +
+

Создание осмотра

+
+
+
+
Название:
+
+
+
+
CarSales
+
+ + + + + + + + + @foreach (var CarSales in Model) + { + + + + + } + +
ВыборНазвание
+ + @CarSales.CarBrand
+
+
+
+
Сумма:
+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/CarCenterImplementerAPP/Views/Home/Enter.cshtml b/CarCenterImplementerAPP/Views/Home/Enter.cshtml new file mode 100644 index 0000000..106d3d5 --- /dev/null +++ b/CarCenterImplementerAPP/Views/Home/Enter.cshtml @@ -0,0 +1,21 @@ +@{ + ViewData["Title"] = "Enter"; +} + +
+

Вход в приложение

+
+
+
+
Логин:
+
+
+
+
Пароль:
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/CarCenterImplementerAPP/Views/Home/Index.cshtml b/CarCenterImplementerAPP/Views/Home/Index.cshtml index d2d19bd..6e8730a 100644 --- a/CarCenterImplementerAPP/Views/Home/Index.cshtml +++ b/CarCenterImplementerAPP/Views/Home/Index.cshtml @@ -3,6 +3,13 @@ }
-

Welcome

-

Learn about building Web apps with ASP.NET Core.

+

Приложение "Автоцентр "Корыто". Исполнитель"

+
diff --git a/CarCenterImplementerAPP/Views/Home/IndexBonus.cshtml b/CarCenterImplementerAPP/Views/Home/IndexBonus.cshtml new file mode 100644 index 0000000..87c70f4 --- /dev/null +++ b/CarCenterImplementerAPP/Views/Home/IndexBonus.cshtml @@ -0,0 +1,63 @@ +@using CarCenterContracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "Bonus"; +} + +
+

Бонусы

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

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

+ return; + } + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + + } + +
+ Марка автомобили + + Клиент + + Накопленные бонусы +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.BonusName) + + @Html.DisplayFor(modelItem => item.BonusCost) + + @Html.DisplayFor(modelItem => item.BonusDate) + + Изменить + + Удалить +
+ } +
\ No newline at end of file diff --git a/CarCenterImplementerAPP/Views/Home/IndexCars.cshtml b/CarCenterImplementerAPP/Views/Home/IndexCars.cshtml new file mode 100644 index 0000000..9e345d8 --- /dev/null +++ b/CarCenterImplementerAPP/Views/Home/IndexCars.cshtml @@ -0,0 +1,59 @@ +@using CarCenterContracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "Cars"; +} + +
+

Автомобили в наличии

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

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

+ return; + } + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + } + +
+ Номер + + Производитель машины + + Модель машины +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.CarBrand) + + @Html.DisplayFor(modelItem => item.CarModel) + + @Html.DisplayFor(modelItem => item.CarCost) +
+ } +
\ No newline at end of file diff --git a/CarCenterImplementerAPP/Views/Home/Register.cshtml b/CarCenterImplementerAPP/Views/Home/Register.cshtml new file mode 100644 index 0000000..837b222 --- /dev/null +++ b/CarCenterImplementerAPP/Views/Home/Register.cshtml @@ -0,0 +1,29 @@ +@{ + ViewData["Title"] = "Register"; +} + +
+

Регистрация

+
+
+
+
ФИО:
+
+
+
+
Логин:
+
+
+
+
Почта:
+
+
+
+
Пароль:
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/CarCenterImplementerAPP/Views/Home/ReportsMenu.cshtml b/CarCenterImplementerAPP/Views/Home/ReportsMenu.cshtml new file mode 100644 index 0000000..fa0a48f --- /dev/null +++ b/CarCenterImplementerAPP/Views/Home/ReportsMenu.cshtml @@ -0,0 +1,11 @@ +@{ + ViewData["Title"] = "Report Menu"; +} + +
+

Список создания отчетов

+ +
diff --git a/CarCenterImplementerAPP/Views/Shared/_Layout.cshtml b/CarCenterImplementerAPP/Views/Shared/_Layout.cshtml index 22f3d85..7b88d24 100644 --- a/CarCenterImplementerAPP/Views/Shared/_Layout.cshtml +++ b/CarCenterImplementerAPP/Views/Shared/_Layout.cshtml @@ -3,30 +3,16 @@ - @ViewData["Title"] - CarCenterImplementerAPP + @ViewData["Title"] - CarCenterManagerAPP - +
@@ -38,7 +24,7 @@
- © 2024 - CarCenterImplementerAPP - Privacy + © 2024 - Исполнитель Автоцентр "Корыто" - Privacy