появилось изделие в заказах

This commit is contained in:
ityurner02@mail.ru 2023-04-05 13:29:07 +04:00
parent a394b7a123
commit b95ad316df

View File

@ -2,6 +2,7 @@
using PlumbingRepairClientApp.Models; using PlumbingRepairClientApp.Models;
using PlumbingRepairContracts.BindingModels; using PlumbingRepairContracts.BindingModels;
using PlumbingRepairContracts.ViewModels; using PlumbingRepairContracts.ViewModels;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
namespace PlumbingRepairClientApp.Controllers namespace PlumbingRepairClientApp.Controllers
@ -116,10 +117,12 @@ namespace PlumbingRepairClientApp.Controllers
{ {
throw new Exception("Количество и сумма должны быть больше 0"); throw new Exception("Количество и сумма должны быть больше 0");
} }
var works = APIClient.GetRequest<List<WorkViewModel>>("api/main/getworklist");
APIClient.PostRequest("api/main/createorder", new OrderBindingModel APIClient.PostRequest("api/main/createorder", new OrderBindingModel
{ {
ClientId = APIClient.Client.Id, ClientId = APIClient.Client.Id,
WorkId = work, WorkId = work,
WorkName = (works.FirstOrDefault(x => x.Id == work)).WorkName,
Count = count, Count = count,
Sum = Calc(count, work) Sum = Calc(count, work)
}); });