コード例 #1
0
        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));
        }
コード例 #2
0
        // 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));
        }