public ActionResult DeleteConfirmed(int id) { HistorialPaciente historialPaciente = db.HistorialPacientes.Find(id); db.HistorialPacientes.Remove(historialPaciente); db.SaveChanges(); log.Info("Eliminacion de historial de paciente"); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,IdPaciente,Descripcion,Fecha")] HistorialPaciente historialPaciente) { if (ModelState.IsValid) { db.Entry(historialPaciente).State = EntityState.Modified; db.SaveChanges(); log.Info("Edicion de historial de paciente"); return(RedirectToAction("Index")); } ViewBag.IdPaciente = new SelectList(db.Pacientes, "Id", "Nombre", historialPaciente.IdPaciente); return(View(historialPaciente)); }
public ActionResult Create([Bind(Include = "Id,IdPaciente,Descripcion,Fecha")] HistorialPaciente historialPaciente) { if (ModelState.IsValid) { historialPaciente.Fecha = DateTime.Now; db.HistorialPacientes.Add(historialPaciente); db.SaveChanges(); log.Info("Creacion de historial de paciente"); return(RedirectToAction("Index")); } ViewBag.IdPaciente = new SelectList(db.Pacientes, "Id", "Nombre", historialPaciente.IdPaciente); return(View(historialPaciente)); }
// GET: HistorialPaciente/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HistorialPaciente historialPaciente = db.HistorialPacientes.Find(id); if (historialPaciente == null) { return(HttpNotFound()); } return(View(historialPaciente)); }
// GET: HistorialPaciente/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HistorialPaciente historialPaciente = db.HistorialPacientes.Find(id); if (historialPaciente == null) { return(HttpNotFound()); } ViewBag.IdPaciente = new SelectList(db.Pacientes, "Id", "Nombre", historialPaciente.IdPaciente); return(View(historialPaciente)); }