コード例 #1
0
        public static List <MovieListDO> SearchSuperblyForActors(string keyword)
        {
            //search in actors
            List <int> ids = MovieNameBL.SearchDOByLikelyName(keyword).Select(q => q.MovieID).ToList( );

            return(getMovieListDO(ids));
        }
コード例 #2
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();
        }
コード例 #3
0
ファイル: MovieBL.cs プロジェクト: chakian/movie-archive
        public static List <MovieDO> GetAllAsDO( )
        {
            var list      = GetAll( );
            var movieList = Mapper.Map <List <MOV_M_Movie>, List <MovieDO> >(list);

            foreach (var item in movieList)
            {
                item.OriginalName = MovieNameBL.GetOriginalNameOfMovie(item.ID);
            }
            return(movieList);
        }
コード例 #4
0
ファイル: MovieBL.cs プロジェクト: chakian/movie-archive
        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);
        }