Exemple #1
0
        public List <MovieOnShow> GetMovieOnShow(string newMovieName, string newCinemaName)
        {
            //根据电影名得到播放该电影的所有影院  为电影播放列表 显示播放该电影的所有影院信息提供数据源
            List <MovieOnShow> movieOnShows = new List <MovieOnShow>();

            List <MOVIE_SCHEDULE> movieSchedules = new List <MOVIE_SCHEDULE>();

            CinemaBLL cienmaBll = new CinemaBLL();

            movieSchedules = GetMovieSchedule(newMovieName);

            CINEMA cinema = cienmaBll.GetCinema(newCinemaName);

            foreach (MOVIE_SCHEDULE ms in movieSchedules)
            {
                if (ms.price < 0) //排除错误数据
                {
                    continue;
                }
                if (ms.cinema_id == cinema.id)
                {
                    MovieOnShow movieOnShow = new MovieOnShow();
                    string      cinemaeName = GetCinemaNameById(ms.cinema_id.Value);

                    movieOnShow.Name       = cinemaeName;
                    movieOnShow.ShowTime   = ms.showtime.ToString();
                    movieOnShow.Price      = Convert.ToInt32(ms.price);
                    movieOnShow.BuyWebsite = ms.book_website;

                    movieOnShows.Add(movieOnShow);
                }
            }

            return(movieOnShows);
        }
Exemple #2
0
        public List <MovieShow> GetMovieShow(string newMovieName, int newCinemaId)
        {
            //根据电影名得到该影院 的 所有该电影的信息  为电影院 显示该影院所有电影列表提供数据源
            List <MovieShow> movieShows = new List <MovieShow>();

            List <MOVIE_SCHEDULE> movieSchedules = new List <MOVIE_SCHEDULE>();

            CinemaBLL cienmaBll = new CinemaBLL();

            movieSchedules = GetMovieSchedule(newMovieName);

            foreach (MOVIE_SCHEDULE ms in movieSchedules)
            {
                if (ms.price < 0 || ms.cinema_id != newCinemaId) //排除错误数据
                {
                    continue;
                }

                MovieShow movieShow = new MovieShow();
                string    movieName = GetMovieNameById((int)ms.movie_id);

                movieShow.Name       = movieName;
                movieShow.ShowTime   = ms.showtime.ToString();
                movieShow.Price      = Convert.ToInt32(ms.price);
                movieShow.BuyWebsite = ms.book_website;

                movieShows.Add(movieShow);
            }

            /*/for (int i = 0; i < movieShows.Count(); i++)
             * //{
             * //    MovieShow m = movieShows.ElementAt(i);
             * //    for (int j = i + 1; j < movieShows.Count(); j++)
             * //    {
             * //        MovieShow m1 = movieShows.ElementAt(j);
             * //        if (m.Price == m1.Price)
             * //        {
             * //            movieShows.RemoveAt(j);
             * //        }
             * //    }
             * //}*/

            return(movieShows);
        }
Exemple #3
0
        public List <MovieShow> GetMovieShow(string newCinemaName)
        {
            //根据影院名得到该影院 播放的电影  为电影院 显示该影院所有电影列表提供数据源
            List <MovieShow>      movieShows     = new List <MovieShow>();
            List <MOVIE_SCHEDULE> movieSchedules = new List <MOVIE_SCHEDULE>();

            CinemaBLL cienmaBll = new CinemaBLL();

            movieSchedules = cienmaBll.GetMovies(newCinemaName);

            foreach (MOVIE_SCHEDULE ms in movieSchedules)
            {
                MovieShow movieShow = new MovieShow();
                string    movieName = GetMovieNameById((int)ms.movie_id);

                movieShow.Name       = movieName;
                movieShow.ShowTime   = ms.showtime.ToString();
                movieShow.Price      = Convert.ToInt32(ms.price);
                movieShow.BuyWebsite = ms.book_website;

                movieShows.Add(movieShow);
            }
            return(movieShows);
        }