public ActionResult DeleteConfirmed(int id) { GradoEstudio gradoEstudio = db.GradoEstudios.Find(id); db.GradoEstudios.Remove(gradoEstudio); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Nombre_Institucion,Titulo,Fecha_Graduacion,AplicanteId")] GradoEstudio gradoEstudio) { if (ModelState.IsValid) { db.Entry(gradoEstudio).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AplicanteId = new SelectList(db.Aplicantes, "Id", "Nombre", gradoEstudio.AplicanteId); return(View(gradoEstudio)); }
// GET: GradoEstudios/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GradoEstudio gradoEstudio = db.GradoEstudios.Find(id); if (gradoEstudio == null) { return(HttpNotFound()); } return(View(gradoEstudio)); }
// GET: GradoEstudios/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GradoEstudio gradoEstudio = db.GradoEstudios.Find(id); if (gradoEstudio == null) { return(HttpNotFound()); } ViewBag.AplicanteId = new SelectList(db.Aplicantes, "Id", "Nombre", gradoEstudio.AplicanteId); return(View(gradoEstudio)); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } GradoEstudio = await _context.GradoEstudio.SingleOrDefaultAsync(m => m.IdCarrerarGradoEstudio == id); if (GradoEstudio == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } GradoEstudio = await _context.GradoEstudio.FindAsync(id); if (GradoEstudio != null) { _context.GradoEstudio.Remove(GradoEstudio); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }