Esempio n. 1
0
        private static void InitializeThread( )
        {
            int waitTime = 3;

            Thread.Sleep(500);
            MovieBL.GetAll();

            Thread.Sleep(waitTime);
            ActorBL.GetAll();

            Thread.Sleep(waitTime);
            DirectorBL.GetAll();

            Thread.Sleep(waitTime);
            WriterBL.GetAll();

            Thread.Sleep(waitTime);
            LanguageBL.GetAll();

            Thread.Sleep(waitTime);
            ArchiveBL.GetAll();

            Thread.Sleep(waitTime);
            TypeBL.GetAll();

            Thread.Sleep(waitTime);
            MovieActorBL.GetAll( );
            MovieActorBL.GetAllDO( );

            Thread.Sleep(waitTime);
            MovieUserArchiveBL.GetAll();
            MovieUserArchiveBL.GetAllDO();

            Thread.Sleep(waitTime);
            MovieDirectorBL.GetAll( );
            MovieDirectorBL.GetAllDO( );

            Thread.Sleep(waitTime);
            MovieLanguageBL.GetAll();
            MovieLanguageBL.GetAllDO();

            Thread.Sleep(waitTime);
            MovieNameBL.GetAll();
            MovieNameBL.GetAllAsDO();

            Thread.Sleep(waitTime);
            MovieTypeBL.GetAll();
            MovieTypeBL.GetAllDO();

            Thread.Sleep(waitTime);
            MovieWriterBL.GetAll();
            MovieWriterBL.GetAllDO();

            Thread.Sleep(waitTime);
            MovieUserRatingBL.GetAll();
        }
Esempio n. 2
0
        public static MovieDetailDO GetMovieWithDetails(int id, int currentUserID)
        {
            MovieDetailDO movieDetail = new MovieDetailDO( );

            //movie itself
            MOV_M_Movie movie = GetAll( ).Single(m => m.ID == id);

            movieDetail.Movie = Mapper.Map <MOV_M_Movie, MovieDO>(movie);

            //names
            movieDetail.Names = MovieNameBL.GetAllDOByMovieID(id);

            //archives
            movieDetail.Archives = MovieUserArchiveBL.GetAllDOByMovieIDAndUserID(id, currentUserID);

            //languages
            movieDetail.Languages = MovieLanguageBL.GetAllDOByMovieID(id);

            //types
            movieDetail.Types = MovieTypeBL.GetAllDOByMovieID(id);

            //directors
            movieDetail.Directors = MovieDirectorBL.GetAllDOByMovieID(id);

            //writers
            movieDetail.Writers = MovieWriterBL.GetAllDOByMovieID(id);

            //actors
            movieDetail.Actors = MovieActorBL.GetAllDOByMovieID(id);

            //userRatings
            movieDetail.UserRatings = MovieUserRatingBL.GetAllDOByMovieID(id);

            //average user rating
            movieDetail.AverageUserRating = MovieUserRatingBL.GetAverageUserRatingForMovie(id);

            //current user's rating
            movieDetail.CurrentUserRating = MovieUserRatingBL.GetUsersUserRatingForMovie(id, currentUserID);

            //lists
            movieDetail.UserListsIncludingThisMovie = UserListBL.GetAllViewForUserThatIncludeCurrentMovie(id, currentUserID);
            var listIdsThatContainThisMovie = movieDetail.UserListsIncludingThisMovie.Select(q => q.ListID).ToList();

            movieDetail.UserLists = UserListBL.GetAllForUser(currentUserID);
            movieDetail.UserLists.RemoveAll(q => listIdsThatContainThisMovie.Contains(q.ID));

            return(movieDetail);
        }