示例#1
0
        public static void TestGetMovie()
        {
            Console.WriteLine("Enter Movie  Id:");
            long id = long.Parse(Console.ReadLine());
            MovieListDaoCollection movieListDao = new MovieListDaoCollection();

            Console.WriteLine(movieListDao.GetMovieList(id));
        }
示例#2
0
        public static void TestGetMovieListCustomer()
        {
            MovieListDaoCollection movieListDao = new MovieListDaoCollection();
            List <MovieList>       movieList    = movieListDao.GetMovieListCustomer();

            Console.WriteLine("\n{0,-20}{1,-25}{2,-20}{3,-20}{4,-20}{5,-20}{6}", "Id", "Title", "Budget", "Active", "Date Of Launch", "Genre", "Has Teaser");
            foreach (MovieList item in movieList)
            {
                Console.WriteLine(item);
            }
        }
示例#3
0
        public static void TestModifyMovie()
        {
            MovieListDaoCollection movieListDao = new MovieListDaoCollection();

            List <MovieList> movieList = movieListDao.GetMovieListAdmin();

            Console.WriteLine("After making Modification:\n{0,-20}{1,-25}{2,-20}{3,-20}{4,-20}{5,-20}{6}", "Id", "Title", "Budget", "Active", "Date Of Launch", "Genre", "Has Teaser");
            foreach (MovieList item in movieList)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine("Enter Movie Id:");
            long id = long.Parse(Console.ReadLine());

            Console.WriteLine("Enter Movie Title:");
            string title = Console.ReadLine();

            Console.WriteLine("Enter Movie budget:");
            float budget = float.Parse(Console.ReadLine());

            Console.WriteLine("Enter Movie Active Status (Yes/No):");
            string active = Console.ReadLine();
            bool   activeStatus;

            if (active.Equals("yes", StringComparison.InvariantCultureIgnoreCase))
            {
                activeStatus = true;
            }
            else
            {
                activeStatus = false;
            }

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

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

            Console.WriteLine("Does it have Teaser (Yes/No):");
            string hasteaser = Console.ReadLine();
            bool   freeDeliveryStatus;

            if (hasteaser.Equals("yes", StringComparison.InvariantCultureIgnoreCase))
            {
                freeDeliveryStatus = true;
            }
            else
            {
                freeDeliveryStatus = false;
            }

            movieListDao.ModifyMovieList(new MovieList(id, title, budget, activeStatus, dateOfLaunch, Genre, freeDeliveryStatus));

            movieList = movieListDao.GetMovieListAdmin();
            Console.WriteLine("Before making Modification:\n{0,-20}{1,-25}{2,-20}{3,-20}{4,-20}{5,-20}{6}", "Id", "Name", "Price", "Active", "Date Of Launch", "Category", "Free Delivery");
            foreach (MovieList item in movieList)
            {
                Console.WriteLine(item);
            }
            ;
        }