ура я починила эти.. рецепты

окончательно! (надеюсь :_) )
This commit is contained in:
Елена Бакальская 2024-05-29 02:59:50 +04:00
parent 4ac7886a74
commit 3bfc9cf130
3 changed files with 14 additions and 4 deletions

View File

@ -16,7 +16,7 @@ namespace PolyclinicDatabaseImplement.Models
public string? Comment { get; set; } = string.Empty; public string? Comment { get; set; } = string.Empty;
public int? CourseId { get; set; } public int? CourseId { get; set; }
public virtual Course Course { get; set; } = new(); public virtual Course? Course { get; set; }
private Dictionary<int, IProcedureModel>? _recipeProcedures = null; private Dictionary<int, IProcedureModel>? _recipeProcedures = null;
@ -63,7 +63,7 @@ namespace PolyclinicDatabaseImplement.Models
Id = Id, Id = Id,
ProceduresCount = ProceduresCount, ProceduresCount = ProceduresCount,
Comment = Comment, Comment = Comment,
CourseId = Course?.Id ?? null, CourseId = CourseId ?? null,
}; };
public void UpdateProcedures(PolyclinicDatabase database, RecipeBindingModel bindingModel) public void UpdateProcedures(PolyclinicDatabase database, RecipeBindingModel bindingModel)

View File

@ -48,6 +48,11 @@ namespace PolyclinicWebAppSuretor.Controllers
return View(); return View();
} }
/// <summary>
/// RECIPES
/// </summary>
/// <returns></returns>
public IActionResult Recipes() public IActionResult Recipes()
{ {
List<RecipeViewModel> recipes = _recipeLogic.ReadList(null); List<RecipeViewModel> recipes = _recipeLogic.ReadList(null);
@ -62,7 +67,7 @@ namespace PolyclinicWebAppSuretor.Controllers
[HttpPost] [HttpPost]
public IActionResult CreateRecipe(RecipeModel model, int[] selectedProcedures) public IActionResult CreateRecipe(RecipeModel model, int[] selectedProcedures)
{ {
ViewBag.Courses = _courseLogic.ReadList(null); ViewBag.Courses = _courseLogic.ReadList();
if (HttpContext.Request.Method == "GET") if (HttpContext.Request.Method == "GET")
{ {
ViewData["Title"] = "Íîâûé ðåöåïò"; ViewData["Title"] = "Íîâûé ðåöåïò";
@ -138,6 +143,11 @@ namespace PolyclinicWebAppSuretor.Controllers
return RedirectToAction("Recipes"); return RedirectToAction("Recipes");
} }
/// <summary>
/// MEDICAMENTS
/// </summary>
/// <returns></returns>
public IActionResult Medicaments() public IActionResult Medicaments()
{ {
List<MedicamentViewModel> medicaments = _medicamentLogic.ReadList(null); List<MedicamentViewModel> medicaments = _medicamentLogic.ReadList(null);

View File

@ -29,7 +29,7 @@
<h3 class="col-3"> <h3 class="col-3">
Курс (номер): Курс (номер):
</h3> </h3>
<select style="width: 45vh" id="courseId" name="courseId" asp-for="RecipeViewModel.CourseId"> <select style="width: 45vh" asp-for="RecipeViewModel.CourseId">
<option>Выберите номер курса</option> <option>Выберите номер курса</option>
@foreach (var course in ViewBag.Courses) @foreach (var course in ViewBag.Courses)
{ {