diff --git a/VetClinic/PharmacistApp/Controllers/HomeController.cs b/VetClinic/PharmacistApp/Controllers/HomeController.cs index fb3c334..9eb8a28 100644 --- a/VetClinic/PharmacistApp/Controllers/HomeController.cs +++ b/VetClinic/PharmacistApp/Controllers/HomeController.cs @@ -297,13 +297,13 @@ View(APIPharmacist.GetRequest>($"api/medicine/getmedicin } [HttpGet] - public Tuple>? GetMedicine(int medicineId) + public Tuple>>? GetMedicine(int medicineId) { if (APIPharmacist.Pharmacist == null) { throw new Exception("Вы как сюда попали? Сюда вход только авторизованным"); } - var result = APIPharmacist.GetRequest>>($"api/medicine/getmedicine?medicineid={medicineId}"); + var result = APIPharmacist.GetRequest>>>($"api/medicine/getmedicine?medicineid={medicineId}"); if (result == null) { return default; @@ -471,13 +471,13 @@ View(APIPharmacist.GetRequest>($"api/service/getservices? } [HttpGet] - public Tuple>? GetService(int serviceId) + public Tuple>>? GetService(int serviceId) { if (APIPharmacist.Pharmacist == null) { throw new Exception("Âû êàê ñþäà ïîïàëè? Ñþäà âõîä òîëüêî àâòîðèçîâàííûì"); } - var result = APIPharmacist.GetRequest>>($"api/service/getservice?serviceid={serviceId}"); + var result = APIPharmacist.GetRequest>>>($"api/service/getservice?serviceid={serviceId}"); if (result == null) { return default; diff --git a/VetClinic/PharmacistApp/Views/Home/MedicineAnimals.cshtml b/VetClinic/PharmacistApp/Views/Home/MedicineAnimals.cshtml index 9b4d80f..91859b2 100644 --- a/VetClinic/PharmacistApp/Views/Home/MedicineAnimals.cshtml +++ b/VetClinic/PharmacistApp/Views/Home/MedicineAnimals.cshtml @@ -22,7 +22,7 @@ @@ -50,7 +50,7 @@ $('#price').val(result.item1.price); $.map(result.item2, function (n) { console.log("#" + n); - $(`option[data-name=${n}]`).attr("selected", "selected") + $(`option[data-name=${n.item2}]`).attr("selected", "selected") }); } diff --git a/VetClinic/PharmacistApp/Views/Home/UpdateService.cshtml b/VetClinic/PharmacistApp/Views/Home/UpdateService.cshtml index 7a55acd..7b9b19e 100644 --- a/VetClinic/PharmacistApp/Views/Home/UpdateService.cshtml +++ b/VetClinic/PharmacistApp/Views/Home/UpdateService.cshtml @@ -28,7 +28,7 @@ @@ -56,7 +56,7 @@ $('#price').val(result.item1.price); $.map(result.item2, function ( n ) { console.log("#" + n); - $(`option[data-name=${n}]`).attr("selected", "selected") + $(`option[data-name=${n.item2}]`).attr("selected", "selected") }); } diff --git a/VetClinic/VetClinicBusinessLogic/BusinessLogics/ReportLogicPharmacist.cs b/VetClinic/VetClinicBusinessLogic/BusinessLogics/ReportLogicPharmacist.cs index 9ec9b53..e016dda 100644 --- a/VetClinic/VetClinicBusinessLogic/BusinessLogics/ReportLogicPharmacist.cs +++ b/VetClinic/VetClinicBusinessLogic/BusinessLogics/ReportLogicPharmacist.cs @@ -122,6 +122,7 @@ namespace VetClinicBusinessLogic.BusinessLogics if (used.Contains(visit.Id)) continue; dict[medicine.Item1.Id].Visits.Add(visit); + used.Add(visit.Id); } } ans.Add(dict[medicine.Item1.Id]); diff --git a/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs b/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs index 149eeba..3aa2bb9 100644 --- a/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs +++ b/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs @@ -11,7 +11,7 @@ namespace VetClinicDataBaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS01;Initial Catalog=VetClinicDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=VetClinicDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } diff --git a/VetClinic/VetClinicRestApi/Controllers/MedicineController.cs b/VetClinic/VetClinicRestApi/Controllers/MedicineController.cs index 94fe345..5a3072a 100644 --- a/VetClinic/VetClinicRestApi/Controllers/MedicineController.cs +++ b/VetClinic/VetClinicRestApi/Controllers/MedicineController.cs @@ -21,14 +21,14 @@ namespace VetClinicRestApi.Controllers } [HttpGet] - public Tuple>? GetMedicine(int medicineId) + public Tuple>>? GetMedicine(int medicineId) { try { var elem = _medicine.ReadElement(new MedicineSearchModel { Id = medicineId }); if (elem == null) return null; - var res = Tuple.Create(elem, elem.MedicineAnimals.Select(x => x.Value.AnimalName).ToList()); + var res = Tuple.Create(elem, elem.MedicineAnimals.Select(x => Tuple.Create(x.Value.AnimalName, x.Value.Id)).ToList()); res.Item1.MedicineAnimals = null!; return res; } diff --git a/VetClinic/VetClinicRestApi/Controllers/ServiceController.cs b/VetClinic/VetClinicRestApi/Controllers/ServiceController.cs index a014296..b850901 100644 --- a/VetClinic/VetClinicRestApi/Controllers/ServiceController.cs +++ b/VetClinic/VetClinicRestApi/Controllers/ServiceController.cs @@ -21,14 +21,14 @@ namespace VetClinicRestApi.Controllers } [HttpGet] - public Tuple>? GetService(int serviceId) + public Tuple>>? GetService(int serviceId) { try { var elem = _service.ReadElement(new ServiceSearchModel { Id = serviceId }); if (elem == null) return null; - var res = Tuple.Create(elem, elem.ServiceMedicines.Select(x => x.Value.MedicineName).ToList()); + var res = Tuple.Create(elem, elem.ServiceMedicines.Select(x => Tuple.Create(x.Value.MedicineName, x.Value.Id)).ToList()); res.Item1.ServiceMedicines = null!; return res; }