public IActionResult Delete(int id) { var model = pacientData.Get(id); if (model == null) { return(View("NotFound")); } return(View(model)); }
public IActionResult Details(int id) { var model = new MedicamentPacientViewModel(); var medicament = medicamentData.Get(id); var pacients = new List <Pacient>(); foreach (var pair in consultatieData.GetAll()) { if (pair.MedicamentId == id) { var pacient = pacientData.Get(pair.PacientId); pacients.Add(pacient); } } model.Medicament = medicament; model.Pacients = pacients; if (model == null) { return(View("NotFound")); } return(View(model)); }