From 9021ed8c13c2e050736a2574f485440b861496dd Mon Sep 17 00:00:00 2001 From: Stepan Date: Tue, 30 Apr 2024 22:46:35 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 110 +++++-- .../Views/Home/CreateCompletions.cshtml | 19 +- .../Views/Home/CreateInspection.cshtml | 10 +- .../Controllers/HomeController.cs | 302 +++++++++++------- .../Views/Home/CreateEmployee.cshtml | 8 +- .../Views/Home/CreatePreSaleWork.cshtml | 39 ++- .../Views/Home/SalesInspectionsReport.cshtml | 4 +- 7 files changed, 307 insertions(+), 185 deletions(-) diff --git a/CarCenter/CarCenterAdministratorAPP/Controllers/HomeController.cs b/CarCenter/CarCenterAdministratorAPP/Controllers/HomeController.cs index b72cacd..672e5b1 100644 --- a/CarCenter/CarCenterAdministratorAPP/Controllers/HomeController.cs +++ b/CarCenter/CarCenterAdministratorAPP/Controllers/HomeController.cs @@ -38,7 +38,7 @@ namespace ImplementerApp.Controllers public IActionResult IndexCompletions() { List completions = new List(); - new CompletionsViewModel + completions.Add(new CompletionsViewModel { Id = 1, СompletionName = "Name1", @@ -46,27 +46,18 @@ namespace ImplementerApp.Controllers СompletionPrice = 500.0M, AdministratorId = 1, СompletionCars = new() - }; - new CompletionsViewModel + }); + completions.Add(new CompletionsViewModel { Id = 2, СompletionName = "Name2", СompletionFeatures = "Feature2", СompletionPrice = 1000.0M, AdministratorId = 2 - }; + }); return View(completions); } public IActionResult CreateCompletions() - { - return View(); - } - - public IActionResult IndexCarSales() - { - return View(new List()); - } - public IActionResult CreateCarSales() { var cars = new List(); cars.Add(new CarSalesViewModel @@ -87,14 +78,36 @@ namespace ImplementerApp.Controllers }); return View(cars); } + + public IActionResult IndexCarSales() + { + var cars = new List(); + cars.Add(new CarSalesViewModel + { + Id = 1, + CarBrand = "Brand1", + CarModel = "Model1", + CarCost = 50000.9M, + AdministratorId = 1 + }); + cars.Add(new CarSalesViewModel + { + Id = 2, + CarBrand = "Brand2", + CarModel = "Model2", + CarCost = 100000.9M, + AdministratorId = 2 + }); + return View(cars); + } + public IActionResult CreateCarSales() + { + return View(); + } public IActionResult IndexInspection() - { - return View(new List()); - } - public IActionResult CreateInspection() { List inspections = new List(); - new InspectionViewModel + inspections.Add(new InspectionViewModel { Id = 1, InspectionName = "Inspection1", @@ -103,8 +116,8 @@ namespace ImplementerApp.Controllers AdministratorId = 1, EmployeeId = 1, InspectionCars = new() - }; - new InspectionViewModel + }); + inspections.Add(new InspectionViewModel { Id = 2, InspectionName = "Inspection2", @@ -113,9 +126,30 @@ namespace ImplementerApp.Controllers AdministratorId = 2, EmployeeId = 2, InspectionCars = new() - }; + }); return View(inspections); } + public IActionResult CreateInspection() + { + var cars = new List(); + cars.Add(new CarSalesViewModel + { + Id = 1, + CarBrand = "Brand1", + CarModel = "Model1", + CarCost = 50000.9M, + AdministratorId = 1 + }); + cars.Add(new CarSalesViewModel + { + Id = 2, + CarBrand = "Brand2", + CarModel = "Model2", + CarCost = 100000.9M, + AdministratorId = 2 + }); + return View(cars); + } public IActionResult Privacy() { return View(); @@ -128,11 +162,39 @@ namespace ImplementerApp.Controllers public IActionResult CarsPreSaleWorkReport() { - return View(new List()); + List CarsPreSaleWork = new List + { + new CarsPreSaleWorkReportViewModel + { + CarBrand = "CarBrand1", + PreSaleWork = new List { "PreSaleWork1", "PreSaleWork2" }, + }, + new CarsPreSaleWorkReportViewModel + { + CarBrand = "CarBrand2", + PreSaleWork = new List { "PreSaleWork3", "PreSaleWork4" }, + } + }; + return View(CarsPreSaleWork); } - public IActionResult EmployeeCompletionsReport() + public IActionResult CarsPeriodReport() { - return View(new List()); + List CarsPeriod = new List + { + new CarsPeriodReportViewModel + { + CarBrand = "CarBrand1", + Completions = new List { "Completions1", "Completions2" }, + Employees = new List { "Employees1", "Employees2" }, + }, + new CarsPeriodReportViewModel + { + CarBrand = "CarBrand2", + Completions = new List { "Completions3", "Completions4" }, + Employees = new List { "Employees3", "Employees4" }, + } + }; + return View(CarsPeriod); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] diff --git a/CarCenter/CarCenterAdministratorAPP/Views/Home/CreateCompletions.cshtml b/CarCenter/CarCenterAdministratorAPP/Views/Home/CreateCompletions.cshtml index ebd94d8..cc5e60d 100644 --- a/CarCenter/CarCenterAdministratorAPP/Views/Home/CreateCompletions.cshtml +++ b/CarCenter/CarCenterAdministratorAPP/Views/Home/CreateCompletions.cshtml @@ -3,16 +3,16 @@ @model List @{ - ViewData["Title"] = "CreateCompletions"; + ViewData["Title"] = "CreateCompletions"; }
-

Создание изделия

+

Создание изделия

-
-
Название:
-
-
+
+
Название:
+
+
Completions
@@ -31,19 +31,12 @@ @cars.CarBrand - - - }
-
-
Сумма:
-
-
diff --git a/CarCenter/CarCenterAdministratorAPP/Views/Home/CreateInspection.cshtml b/CarCenter/CarCenterAdministratorAPP/Views/Home/CreateInspection.cshtml index 5bc9ce3..6ce2e43 100644 --- a/CarCenter/CarCenterAdministratorAPP/Views/Home/CreateInspection.cshtml +++ b/CarCenter/CarCenterAdministratorAPP/Views/Home/CreateInspection.cshtml @@ -24,23 +24,19 @@ - @foreach (var CarSales in Model) + @foreach (var cars in Model) { - + - @CarSales.CarBrand + @cars.CarBrand }
-
-
Сумма:
-
-
diff --git a/CarCenter/CarCenterManagerAPP/Controllers/HomeController.cs b/CarCenter/CarCenterManagerAPP/Controllers/HomeController.cs index e93c9d5..75fa923 100644 --- a/CarCenter/CarCenterManagerAPP/Controllers/HomeController.cs +++ b/CarCenter/CarCenterManagerAPP/Controllers/HomeController.cs @@ -9,136 +9,200 @@ using CarCenterDataBaseImplement.Models; 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 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) - { - _logger = logger; - } + public HomeController(ILogger logger) + { + _logger = logger; + } - public IActionResult Index() - { - 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 Index() + { + return View(); + } + public IActionResult Enter() + { + return View(); + } + public IActionResult Register() + { + return View(); + } + public IActionResult IndexEmployee() + { + List Employee = new List(); + Employee.Add(new EmployeeViewModel + { + Id = 1, + EmployeeFIO = "EmployeeFIO1", + EmployeePost = "EmployeePost1", + EmployeeSalary = 500.0M, + ManagerId = 1, + EmployeeSales = new() + }); + Employee.Add(new EmployeeViewModel + { + Id = 2, + EmployeeFIO = "EmployeeFIO2", + EmployeePost = "EmployeePost2", + EmployeeSalary = 5100.0M, + ManagerId = 2, + EmployeeSales = new() + }); + return View(Employee); + } - 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 CreateEmployee() + { + List Sales = new List(); + Sales.Add(new SaleViewModel + { + Id = 1, + SaleName = "Sale1", + SalePrice = 100.5M, + SaleDate = DateTime.Now, + ManagerId = 1, + }); + Sales.Add(new SaleViewModel + { + Id = 2, + SaleName = "Sale2", + SalePrice = 600.0M, + SaleDate = DateTime.Now, + ManagerId = 2, + }); + return View(Sales); + } - public IActionResult ReportsMenu() - { - return View(); - } + + public IActionResult IndexPreSaleWork() + { + List 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 CreatePreSaleWork() + { + List Sales = new List(); + Sales.Add(new SaleViewModel + { + Id = 1, + SaleName = "Sale1", + SalePrice = 100.5M, + SaleDate = DateTime.Now, + ManagerId = 1, + }); + Sales.Add(new SaleViewModel + { + Id = 2, + SaleName = "Sale2", + SalePrice = 600.0M, + SaleDate = DateTime.Now, + ManagerId = 2, + }); + return View(Sales); + } + public IActionResult IndexSale() + { + List Sales = new List(); + Sales.Add(new SaleViewModel + { + Id = 1, + SaleName = "Sale1", + SalePrice = 100.5M, + SaleDate = DateTime.Now, + ManagerId = 1, + }); + Sales.Add(new SaleViewModel + { + Id = 2, + SaleName = "Sale2", + SalePrice = 600.0M, + SaleDate = DateTime.Now, + ManagerId = 2, + }); + return View(Sales); + } + public IActionResult CreateSale() + { + return View(); + } + public IActionResult Privacy() + { + return View(); + } + + public IActionResult ReportsMenu() + { + return View(); + } public IActionResult SalesInspectionsReport() { - return View(new List()); + List SaleInspectionReports = new List + { + new SalesInspectionsReportViewModel + { + SaleName = "SaleName1", + Inspections = new List { "Inspections1", "Inspections2" }, + }, + new SalesInspectionsReportViewModel + { + SaleName = "SaleName2", + Inspections = new List { "Inspections3", "Inspections4" }, + } + }; + return View(SaleInspectionReports); } public IActionResult SalesPeriodReport() { - return View(new List()); + List SalePeriodReports = new List + { + new SalesPeriodReportViewModel + { + SaleName = "SaleName1", + Completions = new List { "Completions1", "Completions2" }, + Employee = new List { "Employee1", "Employee2"}, + }, + new SalesPeriodReportViewModel + { + SaleName = "SaleName2", + Completions = new List { "Completions3", "Completions4" }, + Employee = new List { "Employee3", "Employee4"}, + } + }; + return View(SalePeriodReports); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] - public IActionResult Error() - { - return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); - } - } + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + } } \ No newline at end of file diff --git a/CarCenter/CarCenterManagerAPP/Views/Home/CreateEmployee.cshtml b/CarCenter/CarCenterManagerAPP/Views/Home/CreateEmployee.cshtml index 7321962..26bc0d7 100644 --- a/CarCenter/CarCenterManagerAPP/Views/Home/CreateEmployee.cshtml +++ b/CarCenter/CarCenterManagerAPP/Views/Home/CreateEmployee.cshtml @@ -9,16 +9,16 @@

Создание сотрудника

-
+
ФИО сотрудника:
-
+
Должность сотрудника:
-
-
Стоимость продажи:
+
+
Заработная плата:
diff --git a/CarCenter/CarCenterManagerAPP/Views/Home/CreatePreSaleWork.cshtml b/CarCenter/CarCenterManagerAPP/Views/Home/CreatePreSaleWork.cshtml index a3bf4c4..3d562f0 100644 --- a/CarCenter/CarCenterManagerAPP/Views/Home/CreatePreSaleWork.cshtml +++ b/CarCenter/CarCenterManagerAPP/Views/Home/CreatePreSaleWork.cshtml @@ -3,16 +3,16 @@ @model List @{ - ViewData["Title"] = "CreatePreSaleWork"; + ViewData["Title"] = "CreatePreSaleWork"; }
-

Создание предпродажной работы

+

Создание предпродажной работы

-
-
Название:
-
-
+
+
Название:
+
+
PreSaleWork
@@ -24,17 +24,24 @@ - @foreach (var sales in Model) + @if (Model != null && Model.Any()) { - - - - - @sales.SaleName - - - - + @foreach (var sales in Model) + { + + + + + @sales.SaleName + + } + } + else + { + + + + none } diff --git a/CarCenter/CarCenterManagerAPP/Views/Home/SalesInspectionsReport.cshtml b/CarCenter/CarCenterManagerAPP/Views/Home/SalesInspectionsReport.cshtml index c81d0e9..9cb7475 100644 --- a/CarCenter/CarCenterManagerAPP/Views/Home/SalesInspectionsReport.cshtml +++ b/CarCenter/CarCenterManagerAPP/Views/Home/SalesInspectionsReport.cshtml @@ -9,10 +9,10 @@

Список осмотров по продажам

- + -
+