Exemplo n.º 1
0
        public ActionResult ActorDetails(Guid actorId)
        {
            var model = new ActorDetailsViewModel
            {
                Actor  = _moviefileService.GetSingleActor(actorId),
                Movies = _moviefileService.GetMovieCollection(actorId)
            };

            return(View(model));
        }
Exemplo n.º 2
0
        private void OnSelectedActorChanged(object sender, SelectionChangedEventArgs e)
        {
            if (m_NodeWindow.ActorTabControl.SelectedIndex == -1)
            {
                SelectedStaff = null;
            }
            else
            {
                SelectedStaff = SelectedEvent.Actors[m_NodeWindow.ActorTabControl.SelectedIndex];
            }

            ActorDetailsViewModel.ReflectObject(SelectedStaff);
        }
Exemplo n.º 3
0
        public IActionResult Details(int id)
        {
            var actor = actorServices.FindActorById(id);

            var model = new ActorDetailsViewModel
            {
                FullName       = actor.FullName,
                MediumImageUrl = actor.MediumImageUrl,
                ApiActorId     = actor.ApiActorId,
                Biography      = actor.Biography,
                DateOfBirth    = actor.DateOfBirth,
                ImdbProfileUrl = actor.ImdbProfileUrl,
                PlaceOfBirth   = actor.PlaceOfBirth,
                Movies         = actor.Movies,
            };

            return(View(model));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Details(int actorId)
        {
            var actor = await _context.Actors
                        .Include(a => a.ActorMovies)
                        .ThenInclude(am => am.Movie)
                        .SingleOrDefaultAsync(a => a.ID == actorId);

            if (actor == null)
            {
                return(NotFound());
            }
            var vm = new ActorDetailsViewModel();

            // get the actors in a nice collection for the View
            // TODO: maybe move this to the ViewModel?
            actor.Movies = actor.ActorMovies.Select(x => x.Movie);
            vm.Actor     = actor;
            //gets all movies where the actor doesn't appear in
            vm.AvailableMovies = await _context.Movies.Except(actor.Movies).ToListAsync();

            //this will be needed by the Controller that handles adding movies to actors
            vm.SelectedActorId = actorId;
            return(View(vm));
        }
        private void OnMovieClick(object sender, ItemClickEventArgs e)
        {
            var movie = (CastActorMovies)e.ClickedItem;

            ActorDetailsViewModel.NavigateToMovieDetails(movie.id);
        }