public ActionResult DeleteConfirmed(int id) { Bautizos bautizos = db.Bautizos.Find(); db.Bautizos.Remove(bautizos); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BautizoId,Bautizado,FechaBautizo,LugarBautizo,PadreBautizado,CedPadre,MadreBautizado,Cedmadre,PadrinoBautizado,Cedpadrino,Representate,Cedrepresentante,Comentario,Celebrante")] Bautizos bautizos) { if (ModelState.IsValid) { db.Entry(bautizos).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BautizoId = new SelectList(db.Bautizos, "BautizoId", "Bautizado", bautizos.BautizoId); return(View(bautizos)); }
//Get: Bautizos / Delete public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Bautizos bautizos = db.Bautizos.Find(id); if (bautizos == null) { return(HttpNotFound()); } return(View(bautizos)); }
//Get: Bautizos/ Edit public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Bautizos bautizos = db.Bautizos.Find(id); if (bautizos == null) { return(HttpNotFound()); } ViewBag.BautizoId = new SelectList(db.Bautizos, "BautizoId", "Bautizado", bautizos.BautizoId); return(View(bautizos)); }