public ActionResult Activate(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.ActivateHomeSlideshow(slide.homeSlideshow_ID); } return(RedirectToAction("Index")); }
public ActionResult Activate(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.ActivateHomeSlideshow(slide.homeSlideshow_ID); } return(RedirectToAction("Index")); } else { return(RedirectPermanent("/home/")); } }