public ActionResult DeleteConfirmed(int id) { Sacramento sacramento = db.Sacramentos.Find(id); db.Sacramentos.Remove(sacramento); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SacramentoID,DetalleSacramento")] Sacramento sacramento) { if (ModelState.IsValid) { db.Entry(sacramento).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sacramento)); }
public ActionResult Create([Bind(Include = "SacramentoID,DetalleSacramento")] Sacramento sacramento) { if (ModelState.IsValid) { db.Sacramentos.Add(sacramento); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sacramento)); }
// GET: Sacramentos/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Sacramento sacramento = db.Sacramentos.Find(id); if (sacramento == null) { return(HttpNotFound()); } return(View(sacramento)); }