в работе

This commit is contained in:
gg12 darfren 2024-04-27 15:06:33 +04:00
parent ea299b652d
commit 8003d8f7f9
5 changed files with 13 additions and 13 deletions

View File

@ -117,7 +117,7 @@ View(APIPharmacist.GetRequest<List<MedicineViewModel>>($"api/medicine/getmedicin
{
return Redirect("~/Home/Enter");
}
ViewBag.Animals = APIPharmacist.GetRequest<List<AnimalViewModel>>($"api/animal/getanimals");
ViewBag.Animals = APIPharmacist.GetRequest<List<AnimalViewModel>>($"api/animal/getanimallist");
return View();
}
@ -182,7 +182,7 @@ View(APIPharmacist.GetRequest<List<MedicineViewModel>>($"api/medicine/getmedicin
return Redirect("~/Home/Enter");
}
ViewBag.Medicines = APIPharmacist.GetRequest<List<MedicineViewModel>>($"api/medicine/getmedicines?pharmacistid={APIPharmacist.Pharmacist.Id}");
ViewBag.Animals = APIPharmacist.GetRequest<List<AnimalViewModel>>($"api/animal/getanimals");
ViewBag.Animals = APIPharmacist.GetRequest<List<AnimalViewModel>>($"api/animal/getanimallist");
return View();
}

View File

@ -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())
{

View File

@ -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);
// }
}
});
};

View File

@ -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)
};
}

View File

@ -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);
}