// 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()); } }
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: Doctor public ActionResult Index() { try { var doctors = doctorBusiness.List(); return(View(DoctorModel.ToModelList(doctors))); } catch (Exception ex) { Log.Error(ex.Message, ex); ModelState.AddModelError("Model", "Ha ocurrido un error. Por favor, contacte al administrador"); return(View()); } }
// GET: Doctors public ActionResult Index() { var docBll = new DoctorBLL(); return(View(docBll.List())); }