From 82ee4b8e60ba60c219756d1446ee13e28680b70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D0=B0=D1=82=20=D0=97=D0=B0=D1=80=D0=B3?= =?UTF-8?q?=D0=B0=D1=80=D0=BE=D0=B2?= Date: Sat, 20 May 2023 09:59:45 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B4=D0=B0=D0=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CarCenter/EmployeeApp/Controllers/HomeController.cs | 9 +++++++++ CarCenter/EmployeeApp/Views/Home/Cars.cshtml | 3 --- CarCenter/EmployeeApp/Views/Home/CreateCar.cshtml | 2 +- CarCenter/EmployeeApp/Views/Home/Sales.cshtml | 3 +++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CarCenter/EmployeeApp/Controllers/HomeController.cs b/CarCenter/EmployeeApp/Controllers/HomeController.cs index 47af51e..65af009 100644 --- a/CarCenter/EmployeeApp/Controllers/HomeController.cs +++ b/CarCenter/EmployeeApp/Controllers/HomeController.cs @@ -209,5 +209,14 @@ namespace EmployeeApp.Controllers _saleLogic.Create(new SaleBindingModel { EmployeeId = APIClient.Employee.Id, Sum = (float)Convert.ToDouble(sum), CarId=car }); Response.Redirect("Sales"); } + public void DeleteSale(int id) + { + if (APIClient.Employee == null) + { + throw new Exception("Вы как суда попали? Суда вход только авторизованным"); + } + _saleLogic.Delete(new SaleBindingModel { Id = id }); + Response.Redirect("/Home/Sales"); + } } } \ No newline at end of file diff --git a/CarCenter/EmployeeApp/Views/Home/Cars.cshtml b/CarCenter/EmployeeApp/Views/Home/Cars.cshtml index 487850c..163a061 100644 --- a/CarCenter/EmployeeApp/Views/Home/Cars.cshtml +++ b/CarCenter/EmployeeApp/Views/Home/Cars.cshtml @@ -51,9 +51,6 @@ @Html.DisplayFor(modelItem => item.EmployeeName) - - Посмотреть - } diff --git a/CarCenter/EmployeeApp/Views/Home/CreateCar.cshtml b/CarCenter/EmployeeApp/Views/Home/CreateCar.cshtml index 694187c..c24114a 100644 --- a/CarCenter/EmployeeApp/Views/Home/CreateCar.cshtml +++ b/CarCenter/EmployeeApp/Views/Home/CreateCar.cshtml @@ -10,7 +10,7 @@
Предпродажные работы:
- +
diff --git a/CarCenter/EmployeeApp/Views/Home/Sales.cshtml b/CarCenter/EmployeeApp/Views/Home/Sales.cshtml index 6467a8f..23eea16 100644 --- a/CarCenter/EmployeeApp/Views/Home/Sales.cshtml +++ b/CarCenter/EmployeeApp/Views/Home/Sales.cshtml @@ -55,6 +55,9 @@ @Html.DisplayFor(modelItem => item.CarId) + + Удалить + }