public ActionResult Deactivate(int id)
        {
            hypster_tv_DAL.homeSlideshowManager homeSlideshowManager = new hypster_tv_DAL.homeSlideshowManager();
            hypster_tv_DAL.homeSlideshow        slide = new hypster_tv_DAL.homeSlideshow();
            slide = homeSlideshowManager.homeSlideshowByID(id);

            if (slide.homeSlideshow_ID != 0)
            {
                homeSlideshowManager.DeactivateHomeSlideshow(slide.homeSlideshow_ID);
            }
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Deactivate(int id)
 {
     if (Session["Roles"] != null && Session["Roles"].Equals("Admin"))
     {
         hypster_tv_DAL.homeSlideshowManager homeSlideshowManager = new hypster_tv_DAL.homeSlideshowManager();
         hypster_tv_DAL.homeSlideshow        slide = new hypster_tv_DAL.homeSlideshow();
         slide = homeSlideshowManager.homeSlideshowByID(id);
         if (slide.homeSlideshow_ID != 0)
         {
             homeSlideshowManager.DeactivateHomeSlideshow(slide.homeSlideshow_ID);
         }
         return(RedirectToAction("Index"));
     }
     else
     {
         return(RedirectPermanent("/home/"));
     }
 }