Beispiel #1
0
        public ActionResult ActorDetails(int Id)
        {
            if (Session["UserId"] == null)
            {
                RedirectToAction("Login", new { Controller = "Home" });
            }

            Actor actor = db.Actors.Find(Id);


            if (actor != null)
            {
                ActorMoviesViewModel AMVM = new ActorMoviesViewModel();

                AMVM.actor = actor;

                List <Movie> MoviesList = db.MOVIESS.Where(y => y.Cast.Contains(actor.full_name.ToLower())).ToList();

                AMVM.ActorMovies = MoviesList;

                return(View(AMVM));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
        public ActionResult GetMoviesByActor()
        {
            var viewModel = new ActorMoviesViewModel
            {
                Actors = repository.GetActors().Select(m =>
                                                       new SelectListItem(m.Name, m.Id.ToString())).ToList()
            };

            return(View(viewModel));
        }
Beispiel #3
0
        public ActionResult getMovies(string actorName)
        {
            Actor actor = new Actor(actorName);

            List <Movie> movies = new List <Movie>();

            movies = actor.getMovies();
            actorMoviesViewModel        = new ActorMoviesViewModel();
            actorMoviesViewModel.actor  = actor;
            actorMoviesViewModel.movies = movies;

            return(RedirectToAction("MoviesOfActor", "MoviesOfActor", false));
        }