Exemple #1
0
 // GET: Patient
 public ActionResult Index()
 {
     try
     {
         var patients = patientBusiness.List();
         return(View(PatientModel.ToModelList(patients)));
     }
     catch (Exception ex)
     {
         Log.Error(ex.Message, ex);
         ModelState.AddModelError("Model", "Ha ocurrido un error. Por favor, contacte al administrador");
         return(View());
     }
 }
 // GET: Appointment/Create
 public ActionResult Create()
 {
     try
     {
         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());
     }
     catch (Exception ex)
     {
         Log.Error(ex.Message, ex);
         return(View());
     }
 }
Exemple #3
0
        public ActionResult GetView(string id, string viewName, string message = "")
        {
            ViewBag.error = TempData["error"];
            Appointment app = null;

            if (id.Length > 0)
            {
                app = appBLL.GetById(Int32.Parse(id));
            }

            ViewBag.DoctorId  = new SelectList(docBLL.List(), "Id", "Name");
            ViewBag.PatientId = new SelectList(patientBLL.List(), "Id", "Name");
            ViewBag.RoomId    = new SelectList(roomBLL.List(), "Id", "Name");

            if (message.Length > 0)
            {
                ViewBag.message = message;
            }

            return(PartialView(viewName, app));
        }
        // GET: Patients
        public ActionResult Index()
        {
            var patientBll = new PatientBLL();

            return(View(patientBll.List()));
        }