Exemplo n.º 1
0
 // 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());
     }
 }
Exemplo n.º 2
0
        // 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());
            }
        }