コード例 #1
0
        /// <summary>
        /// Prints out the result of the search based on the usergiven genre
        /// </summary>
        /// <param name="search"></param>
        public static void GetByGenre(string search)
        {
            List <Movie> movies = DALManager.GetByGenre(search);

            foreach (Movie item in movies)
            {
                Console.WriteLine(item.MovieTitle + " " + item.Description);
                Console.WriteLine();
            }
            Console.WriteLine();
        }
コード例 #2
0
        /// <summary>
        /// Prints out the result of the search on the usergiven movie title
        /// </summary>
        /// <param name="search"></param>
        public static void GetSearch(string search)
        {
            List <Movie> movies = DALManager.GetSearch(search);

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Search Result: \n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Movie item in movies)
            {
                Console.WriteLine(item.MovieTitle + " | " + item.Description);
            }
            Console.WriteLine();
        }
コード例 #3
0
        /// <summary>
        /// Prints out all the genres in the Genre table of the database
        /// </summary>
        public static void GetGenres()
        {
            List <Genre> genres = DALManager.GetGenres();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Genres\n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Genre item in genres)
            {
                Console.WriteLine(item.Type);
            }
            Console.WriteLine();
        }
コード例 #4
0
        /// <summary>
        /// Prints out all the actors in the Actors table of the database
        /// </summary>
        public static void GetActors()
        {
            List <Actor> actors = DALManager.GetActors();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Actors\n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Actor item in actors)
            {
                Console.WriteLine(item.FirstName + " " + item.LastName);
            }
            Console.WriteLine();
        }
コード例 #5
0
        /// <summary>
        /// Prints out all the movies in the Movies table of the database
        /// </summary>
        public static void GetMovies()
        {
            List <Movie> returnedmovies = DALManager.GetMovies();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Movies\n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Movie item in returnedmovies)
            {
                Console.WriteLine(item.MovieTitle);
            }
            Console.WriteLine();
        }
コード例 #6
0
        /// <summary>
        /// Prints out the result of the search on the usergiven firstname
        /// </summary>
        /// <param name="search"></param>
        public static void GetSearchActors(string search)
        {
            List <Actor> actors = DALManager.GetSearchActors(search);

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Search Result: \n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Actor item in actors)
            {
                Console.WriteLine(item.FirstName + " " + item.LastName);
            }
            Console.WriteLine();
        }
コード例 #7
0
        /// <summary>
        /// Deletes a genre fitting the usergiven genre name, and then prints out the updates list of genres
        /// </summary>
        /// <param name="search"></param>
        public static void DeleteGenre(string search)
        {
            DALManager.DeleteGenre(search);

            List <Genre> genres = DALManager.GetGenres();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Updated list of Genres\n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Genre item in genres)
            {
                Console.WriteLine(item.Type);
            }
            Console.WriteLine();
        }
コード例 #8
0
        /// <summary>
        /// Deletes an actor from the database with the usergiven name and prints out the new full list of actors
        /// </summary>
        /// <param name="search"></param>
        public static void DeleteActor(string search)
        {
            DALManager.DeleteActor(search);

            List <Actor> actors = DALManager.GetActors();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Updated list of Actors\n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Actor item in actors)
            {
                Console.WriteLine(item.FirstName + " " + item.LastName);
            }
            Console.WriteLine();
        }
コード例 #9
0
        /// <summary>
        /// Inserts the given first and last name as an actor in the database and prints the updated list of actors
        /// </summary>
        /// <param name="fn"></param>
        /// <param name="ln"></param>
        public static void InsertActor(String fn, string ln)
        {
            Actor a = new Actor(fn, ln);

            DALManager.InsertActor(a);
            List <Actor> actors = DALManager.GetActors();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Updated list of Actors\n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Actor item in actors)
            {
                Console.WriteLine(item.FirstName + " " + item.LastName);
            }
            Console.WriteLine();
        }
コード例 #10
0
        /// <summary>
        /// Inserts the usergiven data into the database as a movie and prints out the updated list of movies
        /// </summary>
        /// <param name="title"></param>
        /// <param name="year"></param>
        /// <param name="genre"></param>
        /// <param name="description"></param>
        public static void InsertMovie(String title, int year, string genre, string description)
        {
            Console.WriteLine();
            Movie a = new Movie(title, year, genre, description);

            DALManager.InsertMovie(a);
            List <Movie> movies = DALManager.GetMovies();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Updated list of Movies\n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Movie item in movies)
            {
                Console.WriteLine(item.MovieTitle + " | " + item.Description);
            }
            Console.WriteLine();
        }
コード例 #11
0
        /// <summary>
        /// Inserts the usergiven genre to the Genre table and prints out the update list of genres
        /// </summary>
        /// <param name="type"></param>
        public static void InsertGenre(String type)
        {
            Console.WriteLine();
            Genre a = new Genre(type);

            DALManager.InsertGenre(a);

            List <Genre> genres = DALManager.GetGenres();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Updated list of Genres\n");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (Genre item in genres)
            {
                Console.WriteLine(item.Type);
            }
            Console.WriteLine();
        }
コード例 #12
0
        /// <summary>
        /// Deletes movie based on usergiven movietitle, if the user wanted to delete a movie
        /// </summary>
        /// <param name="search"></param>
        public static void DeleteMovie(string search)
        {
            if (answerrecieved == true)
            {
                DALManager.DeleteMovie(search);

                List <Movie> returnedmovies = DALManager.GetMovies();

                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Updated list of Movies\n");
                Console.ForegroundColor = ConsoleColor.White;
                foreach (Movie item in returnedmovies)
                {
                    Console.WriteLine(item.MovieTitle);
                }
                Console.WriteLine();
            }
            else
            {
            }
        }