From c8a720ec7463bcdf960f69aa8f7c9552a36968fa Mon Sep 17 00:00:00 2001 From: frog24 Date: Thu, 30 May 2024 02:39:52 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=B2=D0=BE=D1=82=20?= =?UTF-8?q?=D1=8D=D1=82=D0=BE=20=D0=B4=D0=B0!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vetclinic/ClientApp/Controllers/HomeController.cs | 8 ++------ Vetclinic/ClientApp/Views/Home/CreateDoctorVisit.cshtml | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Vetclinic/ClientApp/Controllers/HomeController.cs b/Vetclinic/ClientApp/Controllers/HomeController.cs index eef74de..c540557 100644 --- a/Vetclinic/ClientApp/Controllers/HomeController.cs +++ b/Vetclinic/ClientApp/Controllers/HomeController.cs @@ -198,22 +198,18 @@ namespace ClientApp.Controllers { a.Add(pet, new AnimalSearchModel { Id = pet } as IAnimalModel); } + var serviceEnt = APIClient.GetRequest>>>($"api/service/getservice?serviceid={service}"); APIClient.PostRequest("api/doctorvisit/createvisit", new DoctorVisitBindingModel { ClientId = APIClient.Client.Id, ServiceId = service, VisitAnimals = a, - Cost = GetCost(service), + Cost = serviceEnt.Item1.Price, DateVisit= dateTime, VisitName = name }); Response.Redirect("IndexDoctorVisit"); } - public double GetCost(int serviceId) - { - var service = APIClient.GetRequest($"api/service/getservice?sereviceid={serviceId}"); - return service.Price; - } //=================ПОКУПКИ================= public IActionResult IndexDrugPurchase() { diff --git a/Vetclinic/ClientApp/Views/Home/CreateDoctorVisit.cshtml b/Vetclinic/ClientApp/Views/Home/CreateDoctorVisit.cshtml index 516aba2..5c880fe 100644 --- a/Vetclinic/ClientApp/Views/Home/CreateDoctorVisit.cshtml +++ b/Vetclinic/ClientApp/Views/Home/CreateDoctorVisit.cshtml @@ -3,7 +3,7 @@ }
-

Создание покупки

+

Запись к врачу