public static List <MovieDTO> getMovieListbyActor(Actor actorDB) { List <MovieDTO> movies = new List <MovieDTO>(); foreach (Movie m in JobServiceDB.DBaccess.Movie) { if (m.idActor == actorDB.id) { MovieDTO movieDTO = JobServiceDB.mapMovieDTOfromDB(m); movies.Add(movieDTO); } } return(movies); }
public static List <ConcertDTO> getConcertListbyMusician(Musician musicianDB) { List <ConcertDTO> concerts = new List <ConcertDTO>(); foreach (Concert c in JobServiceDB.DBaccess.Concert) { if (c.idMusician == musicianDB.id) { ConcertDTO concertDTO = JobServiceDB.mapConcertDTOfromDB(c); concerts.Add(concertDTO); } } return(concerts); }
public static void quitConcert(MusicianDTO musicianDTO, ConcertDTO concertDTO) { JobServiceDB.getConcertById(concertDTO.Id).Job.assigned = false; JobServiceDB.getConcertById(concertDTO.Id).idMusician = null; JobServiceDB.DBaccess.SaveChanges(); }
public static void quitMovie(ActorDTO actorDTO, MovieDTO movieDTO) { JobServiceDB.getMovieById(movieDTO.Id).Job.assigned = false; JobServiceDB.getMovieById(movieDTO.Id).idActor = null; JobServiceDB.DBaccess.SaveChanges(); }