diff --git a/VetClinic/PharmacistApp/Controllers/HomeController.cs b/VetClinic/PharmacistApp/Controllers/HomeController.cs index 0edecba..cc042bc 100644 --- a/VetClinic/PharmacistApp/Controllers/HomeController.cs +++ b/VetClinic/PharmacistApp/Controllers/HomeController.cs @@ -117,7 +117,7 @@ View(APIPharmacist.GetRequest>($"api/medicine/getmedicin { return Redirect("~/Home/Enter"); } - ViewBag.Animals = APIPharmacist.GetRequest>($"api/animal/getanimals"); + ViewBag.Animals = APIPharmacist.GetRequest>($"api/animal/getanimallist"); return View(); } @@ -182,7 +182,7 @@ View(APIPharmacist.GetRequest>($"api/medicine/getmedicin return Redirect("~/Home/Enter"); } ViewBag.Medicines = APIPharmacist.GetRequest>($"api/medicine/getmedicines?pharmacistid={APIPharmacist.Pharmacist.Id}"); - ViewBag.Animals = APIPharmacist.GetRequest>($"api/animal/getanimals"); + ViewBag.Animals = APIPharmacist.GetRequest>($"api/animal/getanimallist"); return View(); } diff --git a/VetClinic/PharmacistApp/Program.cs b/VetClinic/PharmacistApp/Program.cs index 934998a..57900d3 100644 --- a/VetClinic/PharmacistApp/Program.cs +++ b/VetClinic/PharmacistApp/Program.cs @@ -7,7 +7,7 @@ builder.Services.AddControllersWithViews(); var app = builder.Build(); -APIAdmin.Connect(builder.Configuration); +APIPharmacist.Connect(builder.Configuration); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { diff --git a/VetClinic/PharmacistApp/Views/Home/UpdateMedicine.cshtml b/VetClinic/PharmacistApp/Views/Home/UpdateMedicine.cshtml index 8f327cf..c9d851a 100644 --- a/VetClinic/PharmacistApp/Views/Home/UpdateMedicine.cshtml +++ b/VetClinic/PharmacistApp/Views/Home/UpdateMedicine.cshtml @@ -51,15 +51,14 @@ success: function (result) { $('#name').val(result.item1.medicineName); $('#price').val(result.item1.price); - $('#animals-elements').html - @foreach (var animal in ViewBag.Animals) - { - $($"#select option[value={animal.Id}]").prop('selected', false); - } - @foreach (var animal in result.Item2) - { - $($"#select option[value={animal.id}]").prop('selected', true); - } + // @foreach (var animal in ViewBag.Animals) + // { + // $($"#select option[value={animal.Id}]").prop('selected', false); + // } + // @foreach (var animal in result.Item2) + // { + // $($"#select option[value={animal.id}]").prop('selected', true); + // } } }); }; diff --git a/VetClinic/VetClinicDataBaseImplement/Models/Medicine.cs b/VetClinic/VetClinicDataBaseImplement/Models/Medicine.cs index 9861078..acc693e 100644 --- a/VetClinic/VetClinicDataBaseImplement/Models/Medicine.cs +++ b/VetClinic/VetClinicDataBaseImplement/Models/Medicine.cs @@ -54,6 +54,7 @@ namespace VetClinicDataBaseImplement.Models { Animal = context.Animals.First(y => y.Id == x.Key), }).ToList(), + PharmacistId = model.PharmacistId, Pharmacist = context.Pharmacists.First(x => x.Id == model.PharmacistId) }; } diff --git a/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs b/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs index 1d9e6df..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\SQLEXPRESS02;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); }