예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Boosters"));
            }
            BoosterEvent boosterevent = db.Events.Find(id);

            db.Events.Remove(boosterevent);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        //
        // GET: /Boosters/Details/5

        public ActionResult Details(int id = 0)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Boosters"));
            }
            BoosterEvent boosterevent = db.Events.Find(id);

            if (boosterevent == null)
            {
                return(HttpNotFound());
            }
            return(View(boosterevent));
        }
예제 #3
0
 public ActionResult Edit(BoosterEvent boosterevent)
 {
     if (!User.Identity.IsAuthenticated)
     {
         return(RedirectToAction("Boosters"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(boosterevent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(boosterevent));
 }
예제 #4
0
        public ActionResult Create(BoosterEvent boosterevent)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Boosters"));
            }
            if (ModelState.IsValid)
            {
                db.Events.Add(boosterevent);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(boosterevent));
        }