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 @@