Example #1
0
        public static void TestGetMovieItemListAdmin(MovieItemDaoCollection movieItemDao)
        {
            List <MovieItem> movieItemList = movieItemDao.GetMovieItemListAdmin();

            Console.WriteLine("\n" + heading);
            foreach (MovieItem movie in movieItemList)
            {
                Console.WriteLine(movie);
            }
            Console.WriteLine();
        }
Example #2
0
        public static void TestModifyMovieItem(MovieItemDaoCollection movieItemDao)
        {
            List <MovieItem> movieItemList = movieItemDao.GetMovieItemListAdmin();

            Console.WriteLine("\nMovies before modification:\n");
            Console.WriteLine(heading);
            foreach (MovieItem movie in movieItemList)
            {
                Console.WriteLine(movie);
            }
            Console.Write("\nEnter the Movie ID you wish to modify: ");
            long id = long.Parse(Console.ReadLine());

            Console.Write("Enter Movie Name: ");
            string movieName = Console.ReadLine();

            Console.Write("Enter Movie Budget: ");
            long movieBudget = long.Parse(Console.ReadLine());

            Console.Write("Active (Yes/No):");
            bool movieStatus = (Console.ReadLine().Equals("yes", StringComparison.InvariantCultureIgnoreCase)) == true ? true : false;

            Console.Write("Enter Date of Launch: ");
            DateTime dateOfLaunch = DateTime.ParseExact(Console.ReadLine(), "dd/MM/yyyy", null);

            Console.Write("Enter Movie Genre: ");
            string genre = Console.ReadLine();

            Console.Write("Has Teaser (Yes/No):");
            bool hasTeaser = (Console.ReadLine().Equals("yes", StringComparison.InvariantCultureIgnoreCase)) == true ? true : false;

            movieItemDao.ModifyMovieItem(new MenuItem(id, movieName, movieBudget, movieStatus, dateOfLaunch, genre, hasTeaser));
            Console.WriteLine("\nMovies after modification:\n");
            movieItemList = movieItemDao.GetMovieItemListAdmin();
            Console.WriteLine(list);
            foreach (MovieItem movie in movieItemList)
            {
                Console.WriteLine(movie);
            }
            Console.WriteLine();
        }
        public FavoritesDaoCollectionTest()
        {
            MovieItemDaoCollection movieItemDao  = new MovieItemDaoCollection();
            List <MovieItem>       movieItemList = movieItemDao.GetMovieItemListAdmin();

            Console.WriteLine("Available Items:\n" + heading);
            foreach (MovieItem item in movieItemList)
            {
                Console.WriteLine(item);
            }
            string choice;
            FavoritesDaoCollection favoritesDao = new FavoritesDaoCollection();

            Console.WriteLine();
            l1 : Console.Write("1. Add To Favorite\n2. Remove Favorite Movie\n3. Get All Favorite Movies\n\nEnter your choice: ");
            choice = Console.ReadLine();
            switch (choice)
            {
            case "1":
            {
                TestAddFavoriteMovie(favoritesDao);
                goto l1;
            }

            case "2":
            {
                TestRemoveFavoriteMovie(favoritesDao);
                goto l1;
            }

            case "3":
            {
                TestGetAllFavoriteMovies(favoritesDao);
                goto l1;
            }

            default:
            {
                Console.WriteLine("Exiting...");
                break;
            }
            }
            Console.WriteLine();
        }