public ActionResult DeleteConfirmed(int id) { ClassIngresos classIngresos = db.Ingresos.Find(id); db.Ingresos.Remove(classIngresos); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID_Ingresos,ID_Habitacion,ID_Paciente,Fecha_Ingreso")] ClassIngresos classIngresos) { if (ModelState.IsValid) { db.Entry(classIngresos).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_Habitacion = new SelectList(db.Habitaciones, "ID_Habitacion", "Num_Habitacion", classIngresos.ID_Habitacion); ViewBag.ID_Paciente = new SelectList(db.Pacientes, "ID_Paciente", "Nombre_Paciente", classIngresos.ID_Paciente); return(View(classIngresos)); }
// GET: Ingresos/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClassIngresos classIngresos = db.Ingresos.Find(id); if (classIngresos == null) { return(HttpNotFound()); } return(View(classIngresos)); }
// GET: Ingresos/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClassIngresos classIngresos = db.Ingresos.Find(id); if (classIngresos == null) { return(HttpNotFound()); } ViewBag.ID_Habitacion = new SelectList(db.Habitaciones, "ID_Habitacion", "Num_Habitacion", classIngresos.ID_Habitacion); ViewBag.ID_Paciente = new SelectList(db.Pacientes, "ID_Paciente", "Nombre_Paciente", classIngresos.ID_Paciente); return(View(classIngresos)); }