Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PrepEvent prepevent = db.PrepEvents.Single(p => p.EventID == id);

            db.PrepEvents.DeleteObject(prepevent);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        //
        // GET: /PrepEvent/Delete/5

        public ActionResult Delete(int id = 0)
        {
            PrepEvent prepevent = db.PrepEvents.Single(p => p.EventID == id);

            if (prepevent == null)
            {
                return(HttpNotFound());
            }
            return(View(prepevent));
        }
Esempio n. 3
0
 public ActionResult Edit(PrepEvent prepevent)
 {
     if (ModelState.IsValid)
     {
         db.PrepEvents.Attach(prepevent);
         db.ObjectStateManager.ChangeObjectState(prepevent, EntityState.Modified);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(prepevent));
 }
Esempio n. 4
0
        public ActionResult Create(PrepEvent prepevent)
        {
            if (ModelState.IsValid)
            {
                db.PrepEvents.AddObject(prepevent);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(prepevent));
        }