// GET: AppointmentMessages/Create public ActionResult Create() { PatientService patientService = new PatientService(); ViewBag.IdPatient = new SelectList(patientService.GetList(), "Id", "FirstName"); ViewBag.IdAppointmentType = new SelectList(AppointmentTypeService.GetList(), "Id", "Name"); return(View()); }
// GET: AppointmentMessages/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AppointmentMessage appointmentMessage = _appointmentService.GetById(id.Value); PatientService patientService = new PatientService(); ViewBag.IdPatient = new SelectList(patientService.GetList(), "Id", "FirstName", appointmentMessage?.IdPatient); ViewBag.IdAppointmentType = new SelectList(AppointmentTypeService.GetList(), "Id", "Name", appointmentMessage?.IdAppointmentType); if (appointmentMessage == null) { return(HttpNotFound()); } return(View(appointmentMessage)); }