ура!
This commit is contained in:
parent
47ab8f7e72
commit
6ba7695422
@ -3,6 +3,7 @@ using VeterinaryContracts.BindingModels;
|
||||
using VeterinaryContracts.BusinessLogicContracts;
|
||||
using VeterinaryContracts.SearchModels;
|
||||
using VeterinaryContracts.ViewModels;
|
||||
using VeterinaryDatabaseImplement.Models;
|
||||
|
||||
namespace VeterinaryRestApi.Controllers
|
||||
{
|
||||
@ -60,5 +61,18 @@ namespace VeterinaryRestApi.Controllers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public List<DoctorViewModel> GetDoctors()
|
||||
{
|
||||
try
|
||||
{
|
||||
return _logic.ReadList(null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка получения списка врачей");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -221,11 +221,12 @@ namespace VeterinaryShowOwnerApp.Controllers
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
ViewBag.Pets = APIOwner.GetRequest<List<PetViewModel>>($"api/pet/getpets?ownerid={APIOwner.Owner.Id}");
|
||||
ViewBag.Doctors = APIOwner.GetRequest<List<DoctorViewModel>>($"api/doctor/getdoctors");
|
||||
|
||||
return View();
|
||||
}
|
||||
[HttpPost]
|
||||
public void CreateVisit(string name, List<int> pets, DateTime dateTime)
|
||||
public void CreateVisit(string name, List<int> pets, DateTime dateTime, int doctor)
|
||||
{
|
||||
if (APIOwner.Owner == null)
|
||||
{
|
||||
@ -245,6 +246,8 @@ namespace VeterinaryShowOwnerApp.Controllers
|
||||
VisitName = name,
|
||||
VisitPet = a,
|
||||
DateVisit = dateTime,
|
||||
DoctorId = doctor,
|
||||
OwnerId = APIOwner.Owner.Id,
|
||||
});
|
||||
Response.Redirect("Index");
|
||||
}
|
||||
|
@ -18,6 +18,12 @@
|
||||
<input type="datetime-local" id="datetime" name="datetime" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Врач:</div>
|
||||
<div class="col-8">
|
||||
<select id="doctor" name="doctor" class="form-control" asp-items="@(new SelectList(@ViewBag.Doctors, "Id", "DoctorFIO"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Животные:</div>
|
||||
<div class="col-8">
|
||||
|
Loading…
x
Reference in New Issue
Block a user