public ActionResult DeleteConfirmed(int id) { Examan examan = db.Examen.Find(id); db.Examen.Remove(examan); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IdTest,Nombre,Fecha,Descripcion,status")] Examan examan) { if (ModelState.IsValid) { db.Entry(examan).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(examan)); }
public ActionResult Create([Bind(Include = "IdTest,Nombre,Fecha,Descripcion,status")] Examan examan) { if (ModelState.IsValid) { db.Examen.Add(examan); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(examan)); }
public ActionResult Edit([Bind(Include = "exm_idExamen,exm_idHistorial,exm_idEmpleado,exm_idResultado")] Examan examan) { if (ModelState.IsValid) { db.Entry(examan).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.exm_idEmpleado = new SelectList(db.Empleadoes, "emp_idEmpleado", "emp_nombre", examan.exm_idEmpleado); ViewBag.exm_idHistorial = new SelectList(db.Historials, "his_idHistorial", "his_idHistorial", examan.exm_idHistorial); ViewBag.exm_idResultado = new SelectList(db.Resultadoes, "res_idResultado", "res_resultado", examan.exm_idResultado); return(View(examan)); }
// GET: Examen/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Examan examan = db.Examen.Find(id); if (examan == null) { return(HttpNotFound()); } return(View(examan)); }
// GET: Examenes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Examan examan = db.Examen.Find(id); if (examan == null) { return(HttpNotFound()); } ViewBag.exm_idEmpleado = new SelectList(db.Empleadoes, "emp_idEmpleado", "emp_nombre", examan.exm_idEmpleado); ViewBag.exm_idHistorial = new SelectList(db.Historials, "his_idHistorial", "his_idHistorial", examan.exm_idHistorial); ViewBag.exm_idResultado = new SelectList(db.Resultadoes, "res_idResultado", "res_resultado", examan.exm_idResultado); return(View(examan)); }