// GET: Appointment/Delete/5 public ActionResult Delete(int id) { try { Appointment appointment = appointmentBusiness.GetById(id); if (appointment == null) { return(HttpNotFound()); } return(View(AppointmentModel.ToModel(appointment))); } catch (Exception ex) { Log.Error(ex.Message, ex); return(View()); } }
// GET: Appointment/Edit/5 public ActionResult Edit(int id) { try { Appointment appointment = appointmentBusiness.GetById(id); if (appointment == null) { return(HttpNotFound()); } ViewBag.DoctorId = new SelectList(doctorBusiness.List(), "Id", "Name"); ViewBag.PatientId = new SelectList(patientBusiness.List(), "Id", "Name"); ViewBag.RoomId = new SelectList(roomBusiness.List(), "Id", "Name"); return(View(AppointmentModel.ToModel(appointment))); } catch (Exception ex) { Log.Error(ex.Message, ex); return(View()); } }