From cc73a1085173339aa0bd863e0236f107a48b0060 Mon Sep 17 00:00:00 2001 From: antoc0der <1@DESKTOP-K1L8ND3> Date: Mon, 27 May 2024 03:49:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B9=20=D0=B4=D0=B0=20=D0=B2=20=D0=BF?= =?UTF-8?q?=D0=B8....?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/ServiceStorage.cs | 2 +- .../VeterinaryShowDoctorApp/Controllers/HomeController.cs | 5 +++-- .../VeterinaryShowDoctorApp/Views/Home/CreateService.cshtml | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/VeterinaryView/VeterinaryDatabaseImplement/Implements/ServiceStorage.cs b/VeterinaryView/VeterinaryDatabaseImplement/Implements/ServiceStorage.cs index f447bf1..ffb84ad 100644 --- a/VeterinaryView/VeterinaryDatabaseImplement/Implements/ServiceStorage.cs +++ b/VeterinaryView/VeterinaryDatabaseImplement/Implements/ServiceStorage.cs @@ -29,7 +29,7 @@ namespace VeterinaryDatabaseImplement.Implements { using var context = new VeterinaryDatabase(); - return context.Services.Include(x => x.Doctor).Include(x => x.Visit).Include(x => x.Medications) + return context.Services.Where(x => x.DoctorId == model.DoctorId).Include(x => x.Doctor).Include(x => x.Visit).Include(x => x.Medications) .ThenInclude(x => x.Medication) .Where(x => String.IsNullOrEmpty(model.ServiceName) || x.ServiceName.Contains(model.ServiceName)) .ToList() diff --git a/VeterinaryView/VeterinaryShowDoctorApp/Controllers/HomeController.cs b/VeterinaryView/VeterinaryShowDoctorApp/Controllers/HomeController.cs index 22b09e9..261b732 100644 --- a/VeterinaryView/VeterinaryShowDoctorApp/Controllers/HomeController.cs +++ b/VeterinaryView/VeterinaryShowDoctorApp/Controllers/HomeController.cs @@ -345,12 +345,12 @@ namespace VeterinaryShowDoctorApp.Controllers return Redirect("~/Home/Enter"); } ViewBag.Medications = APIDoctor.GetRequest>($"api/medication/getmedications?doctorid={APIDoctor.Doctor.Id}"); - //ViewBag.Visits = APIDoctor.GetRequest>($"api/visit/getallvisits"); + ViewBag.Visits = APIDoctor.GetRequest>($"api/visit/getallvisits"); return View(); } [HttpPost] - public void CreateService(string name, List medications) + public void CreateService(string name, List medications, int visit) { if (APIDoctor.Doctor == null) { @@ -370,6 +370,7 @@ namespace VeterinaryShowDoctorApp.Controllers { ServiceName = name, ServiceMedications = a, + VisitId = visit, DoctorId = APIDoctor.Doctor.Id }); Response.Redirect("Services"); diff --git a/VeterinaryView/VeterinaryShowDoctorApp/Views/Home/CreateService.cshtml b/VeterinaryView/VeterinaryShowDoctorApp/Views/Home/CreateService.cshtml index d768d96..cff4c56 100644 --- a/VeterinaryView/VeterinaryShowDoctorApp/Views/Home/CreateService.cshtml +++ b/VeterinaryView/VeterinaryShowDoctorApp/Views/Home/CreateService.cshtml @@ -12,6 +12,12 @@ +
+
Визиты:
+
+ +
+
Медикаменты: