public ActionResult AddMovie(MovieHelper movieHelper)
        {
            var  movieBLL   = new MovieBLL();
            bool movieAdded = movieBLL.AddMovie(movieHelper);

            if (movieAdded)
            {
                ViewBag.RegistrationSuccess = "Movie added";
                return(RedirectToAction("../Home/Index"));
            }
            ViewBag.RegistrationFailed = "Movie Failed";
            movieHelper.selectList     = movieBLL.GetCategories();
            return(View(movieHelper));
        }
        // Legg til ny Film
        public ActionResult AddMovie()
        {
            MovieBLL    movieBLL    = new MovieBLL();
            MovieHelper movieHelper = new MovieHelper
            {
                selectList = movieBLL.GetCategories()
            };

            if (Session["Admin"] == null)
            {
                return(View("NotAllowed"));
            }
            return(View(movieHelper));
        }
        // GET: Dashboard
        public ActionResult Index()
        {
            if (Session["Admin"] == null)
            {
                return(View("NotAllowed"));
            }
            var         movieBLL = new MovieBLL();
            MovieHelper mh       = new MovieHelper()
            {
                selectList = movieBLL.GetCategories()
            };

            return(View(mh));
        }
        public ActionResult EditMovie(int id, MovieHelper movieHelper)
        {
            var movieBLL = new MovieBLL();

            if (movieBLL.EditMovie(id, movieHelper))
            {
                ViewBag.EditSuccessfull = "Endret film";
                return(RedirectToAction("AllMovies"));
            }

            movieHelper.selectedList = movieBLL.SelectedCategoriesIDs(id);
            movieHelper.selectList   = movieBLL.GetCategories();
            ViewBag.EditSuccessfull  = "Endring feilet";
            return(View(movieHelper));
        }
        // Rediger Film
        public ActionResult EditMovie(int id)
        {
            var   movieBLL = new MovieBLL();
            Movie movie    = movieBLL.GetMovie(id);

            if (movie == null)
            {
                return(RedirectToAction("AllMovies"));               // Movie not found
            }
            MovieHelper movieHelper = new MovieHelper
            {
                movie        = movie,
                selectList   = movieBLL.GetCategories(),
                selectedList = movieBLL.SelectedCategoriesIDs(id)
            };

            return(View(movieHelper));
        }