правочка

This commit is contained in:
Максим Яковлев 2024-05-29 21:20:52 +04:00
parent 94c1f206de
commit 3d4536eafa

View File

@ -1,6 +1,7 @@
using DocumentFormat.OpenXml.Drawing;
using DocumentFormat.OpenXml.Wordprocessing;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using ServiceStationContracts.BindingModels;
using ServiceStationContracts.BusinessLogicsContracts;
using ServiceStationContracts.SearchModels;
@ -316,26 +317,26 @@ namespace ServiceStationExecutorApp.Controllers
return View(APIExecutor.GetRequest<List<CarViewModel>>($"api/main/getcarlist?executorId={APIExecutor.Executor.Id}"));
}
[HttpPost]
public void UpdateTechnicalWork(int technicalWork, string TechnicalWorkType, double TechnicalWorkPrice, int[] car)
public void UpdateTechnicalWork(int technicalWork, string worktype, double workPrice, int[] car)
{
if (APIExecutor.Executor == null)
{
throw new Exception("Авторизироваться не забыли?");
}
if (string.IsNullOrEmpty(TechnicalWorkType))
if (string.IsNullOrEmpty(worktype))
{
throw new Exception("Введите тип ТО");
}
if(TechnicalWorkPrice < 100)
if(workPrice < 100)
{
throw new Exception("Цена ТО должны быть больше 100");
}
APIExecutor.PostRequest("api/main/updatetechnicalwork", new TechnicalWorkBindingModel
{
Id = technicalWork,
WorkType = TechnicalWorkType,
WorkType = worktype,
ExecutorId = APIExecutor.Executor.Id,
WorkPrice = TechnicalWorkPrice,
WorkPrice = workPrice,
});
APIExecutor.PostRequest("api/main/addcartotechnicalwork", Tuple.Create(
new TechnicalWorkSearchModel() { Id = technicalWork },