//Returner alle skuespiller i en bestemt film public static List <Actor> GetActorInMovies(int movie_id, List <Film> movies) { List <Actor> actorsName = new List <Actor>(); List <ActorInMovie> actorInMovies = DalManager.GetActorInMovies(); List <Actor> actors = GetActor(); //Tjekker om movie_id på actor er det samme id på den valgte film for (int i = 0; i < actorInMovies.Count; i++) { if (actorInMovies[i].Movie_id == movie_id) { for (int j = 0; j < actors.Count; j++) { if (actors[j].Id == actorInMovies[i].Actor_id) { actorsName.Add(actors[j]); } } } } return(actorsName); }
//Returner alle film som i en bestemt skuespiller har været med i public static List <string> GetFilmsFromActor(int actor_id, List <Actor> actors) { List <string> MovieName = new(); List <ActorInMovie> actorInMovies = DalManager.GetActorInMovies(); List <Film> films = GetFilm(); //Tjekker om actor_id på film er det samme id på den valgte skuespiller foreach (ActorInMovie film in actorInMovies) { if (film.Actor_id == actors[actor_id].Id) { MovieName.Add(films[film.Movie_id].Title); } } return(MovieName); }
//Returner alle skuespiller i en bestemt film public static List <string> GetActorInMovies(int movie_id, List <Film> movies) { List <string> actorsName = new(); List <ActorInMovie> actorInMovies = DalManager.GetActorInMovies(); List <Actor> actors = GetActor(); //Tjekker om movie_id på actor er det samme id på den valgte film foreach (ActorInMovie actor in actorInMovies) { if (actor.Movie_id == movies[movie_id].Id) { actorsName.Add(actors[actor.Actor_id].Firstname + " " + actors[actor.Actor_id].Lastname); } } return(actorsName); }