в работе
This commit is contained in:
parent
ea299b652d
commit
8003d8f7f9
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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())
|
||||
{
|
||||
|
@ -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);
|
||||
// }
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -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)
|
||||
};
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user