diff --git a/Canteen/CanteenManagerApp/Controllers/HomeController.cs b/Canteen/CanteenManagerApp/Controllers/HomeController.cs
index 4dead79..a632222 100644
--- a/Canteen/CanteenManagerApp/Controllers/HomeController.cs
+++ b/Canteen/CanteenManagerApp/Controllers/HomeController.cs
@@ -344,7 +344,7 @@ namespace CanteenManagerApp.Controllers
}
[HttpPost]
- public void DishCreate(string name)
+ public void DishCreate(string name, int price)
{
if (APIClient.Manager == null)
{
@@ -356,10 +356,16 @@ namespace CanteenManagerApp.Controllers
throw new Exception("Наименование блюда не должно быть пустым");
}
+ if (price <= 0)
+ {
+ throw new Exception("Цена блюда должна быть больше нуля");
+ }
+
APIClient.PostRequest("api/main/dishcreate", new DishBindingModel
{
ManagerId = APIClient.Manager.Id,
- DishName = name
+ DishName = name,
+ Price = price
});
Response.Redirect("DishList");
@@ -484,7 +490,7 @@ namespace CanteenManagerApp.Controllers
public void ReportPdf(ReportBindingModel model)
{
model.UserId = APIClient.Manager.Id;
- APIClient.PostRequest("api/main/SaveOrdersToPDF", model);
+ APIClient.PostRequest("api/main/SaveCooksToPDF", model);
Response.Redirect("Index");
}
@@ -492,7 +498,7 @@ namespace CanteenManagerApp.Controllers
public void ReportXsl(ReportBindingModel model)
{
model.UserId = APIClient.Manager.Id;
- APIClient.PostRequest("api/main/SavevToXSL", model);
+ APIClient.PostRequest("api/main/SaveOrdersToXSL", model);
Response.Redirect("Index");
}
diff --git a/Canteen/CanteenManagerApp/Views/Home/CookUpdate.cshtml b/Canteen/CanteenManagerApp/Views/Home/CookUpdate.cshtml
index 329a04d..da5d4c6 100644
--- a/Canteen/CanteenManagerApp/Views/Home/CookUpdate.cshtml
+++ b/Canteen/CanteenManagerApp/Views/Home/CookUpdate.cshtml
@@ -2,6 +2,9 @@
@{
ViewData["Title"] = "CookUpdate";
}
+