Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Sacramento sacramento = db.Sacramentos.Find(id);

            db.Sacramentos.Remove(sacramento);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 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));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "SacramentoID,DetalleSacramento")] Sacramento sacramento)
        {
            if (ModelState.IsValid)
            {
                db.Sacramentos.Add(sacramento);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sacramento));
        }
Beispiel #4
0
        // 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));
        }