示例#1
0
        public List <Movies> GetMovies()
        {
            MoviesEntities1 db     = new MoviesEntities1();
            List <Movies>   movies = db.Movies.ToList();

            return(movies);
        }
示例#2
0
        public List <MoviesA> GetMovieList()
        {
            MoviesEntities1 DB    = new MoviesEntities1();
            List <MoviesA>  Movie = DB.MoviesAs.ToList();

            return(Movie);
        }
示例#3
0
        public List <Movies> GetMovieByKey(string keyword)
        {
            MoviesEntities1 db    = new MoviesEntities1();
            List <Movies>   movie = (from m in db.Movies
                                     where m.Title.Contains(keyword)
                                     select m).ToList();

            return(movie);
        }
示例#4
0
        public List <Movies> GetMovieInfo(string id)
        {
            MoviesEntities1 db    = new MoviesEntities1();
            List <Movies>   movie = (from m in db.Movies
                                     where m.Title == id
                                     select m).ToList();

            return(movie);
        }
示例#5
0
        public List <Movies> GetMovieByGenre(string id)
        {
            MoviesEntities1 db    = new MoviesEntities1();
            List <Movies>   movie = (from m in db.Movies
                                     where m.Genre.Contains(id)
                                     select m).ToList();

            return(movie);
        }
示例#6
0
        public List <MoviesA> GetMovieByCategory(string cat)
        {
            MoviesEntities1 DB       = new MoviesEntities1();
            List <MoviesA>  MovieCat = (from M in DB.MoviesAs
                                        where M.Category.Contains(cat)
                                        select M).ToList();

            return(MovieCat);
        }
示例#7
0
        public List <MoviesA> GetRandom()
        {
            Random          rnd       = new Random();
            MoviesEntities1 DB        = new MoviesEntities1();
            List <MoviesA>  MovieRnd  = DB.MoviesAs.ToList();
            int             MovieA    = MovieRnd.Count() + 1;
            int             MovieRnds = rnd.Next(0, MovieA);

            return(MovieRnd);
        }
示例#8
0
        public Movies GetRandomMovieByGenre(string id)
        {
            Random          movy  = new Random();
            MoviesEntities1 db    = new MoviesEntities1();
            List <Movies>   movie = (from m in db.Movies
                                     where m.Genre == id
                                     select m).ToList();

            int RandMovie = movy.Next(0, movie.Count());

            return(movie[RandMovie]);
        }
示例#9
0
        public Movies GetRandomMovie()
        {
            MoviesEntities1 db        = new MoviesEntities1();
            Random          movie     = new Random();
            int             RandMovie = movie.Next(0, db.Movies.Count());

            Movies moovie = (from m in db.Movies
                             where m.ID == RandMovie
                             select m).Single();

            return(moovie);
        }
示例#10
0
        public List <MoviesA> GetRandomByCat(string cat)
        {
            Random          rnd       = new Random();
            MoviesEntities1 DB        = new MoviesEntities1();
            List <MoviesA>  MovieCatR = (from M in DB.MoviesAs
                                         where M.Category.Contains(cat)
                                         select M).ToList();
            int MovieA    = MovieCatR.Count() + 1;
            int MovieRnds = rnd.Next(0, MovieA);

            return(MovieCatR);
        }
示例#11
0
        public List <Movies> GetRandomMovieList(int num)
        {
            Random          rnd             = new Random();
            MoviesEntities1 db              = new MoviesEntities1();
            List <Movies>   randomMovieList = new List <Movies>();
            List <Movies>   fullMovieList   = db.Movies.ToList();

            for (int i = 0; i < num; i++)
            {
                int randomNumber = rnd.Next(0, fullMovieList.Count());
                randomMovieList.Add(fullMovieList[randomNumber]);
            }

            return(randomMovieList);
        }