public static void NoInputDetected()
 {
     Console.Clear();
     MainScreen.ChangeColorToRed();
     Console.Beep();
     Console.WriteLine("\n\n  NO! Input Detected.");
     MainScreen.TryAgain();
 }
 public static void OverflowErrorMessage()
 {
     Console.Clear();
     MainScreen.ChangeColorToRed();
     Console.Beep();
     Console.WriteLine("\n\n  The inserted value was too big.");
     MainScreen.TryAgain();
 }
 public static void FormatErrorMessage()
 {
     Console.Clear();
     MainScreen.ChangeColorToRed();
     Console.Beep();
     Console.WriteLine("\n\n  The inserted value was not a number.");
     MainScreen.TryAgain();
 }
        public CustomException(string errorType)
        {
            if (errorType == "back to main menu")
            {
                MainScreen.ChangeColorToDarkGray();
                Console.WriteLine("\n  Taking you back to Main Screen.");
                Thread.Sleep(1500);
                MainScreen.MainMenu();
            }

            if (errorType == "out of scope")
            {
                Console.Clear();
                MainScreen.ChangeColorToRed();
                Console.Beep();
                Console.WriteLine("\n\n  That is not an option.");
                MainScreen.TryAgain();
            }

            else if (errorType == "negative")
            {
                Console.Clear();
                MainScreen.ChangeColorToRed();
                Console.Beep();
                Console.WriteLine("\n\n  Do not write negative numbers");
                MainScreen.TryAgain();
            }

            else if (errorType == "movies>10")
            {
                Console.Clear();
                Console.WriteLine("  A maximum of 10 movies can be played.");
                MainScreen.TryAgain();
            }

            else if (errorType == "invalid movie rating")
            {
                Admin.AdminHeading();

                MainScreen.ChangeColorToDarkCyan();

                Console.WriteLine("  The rating inserted is not valid, please choose one of these options:");
                Console.WriteLine("\tG     -   Any age");
                Console.WriteLine("\tPG    -   10 years or older");
                Console.WriteLine("\tPG-13 -   13 years or older");
                Console.WriteLine("\tR     -   15 years or older");
                Console.WriteLine("\tNC-17 -   17 years or older\n");
                Console.WriteLine("  Press Enter to input Rating again.");
                Console.ReadLine();
            }

            else if (errorType == "must be mortal")
            {
                Console.WriteLine("  You are too OLD! We don't want you to die, while watching movie.");
                MainScreen.TryAgain();
            }

            else if (errorType == "risky customer")
            {
                Console.WriteLine("\n\n  There are high chances, Customer could DIE while watching movie.");
                Thread.Sleep(500);
                MainScreen.TryAgain();
                Admin.AdminHeading();
            }

            else if (errorType == "too young")
            {
                Console.WriteLine(
                    "  You are '{0}' years old...\n" +
                    "  The movie '{1}' you chose has the rating of '{2}'.\n" +
                    "  Unfortunately, you cannot watch this movie\n",
                    Guests.guestAge,
                    Admin.moviesList[Guests.movieChoice - 1].Key,
                    Admin.moviesList[Guests.movieChoice - 1].Value
                    );
                Thread.Sleep(2000);
                MainScreen.TryAgain();
            }
        }
Пример #5
0
        private static void AdminMenuSatisfied()
        {
            AdminHeading();
            MainScreen.ChangeColorToDarkYellow();
            Console.WriteLine("  Movies to be Played Today:");
            int count = 1;

            MainScreen.ChangeColorToDarkGray();
            Console.WriteLine("\t<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
            Console.Write("\t|  ");
            MainScreen.ChangeColorToBlue();
            Console.Write("Sr.  ");
            MainScreen.ChangeColorToDarkGray();
            Console.Write("|                     ");
            MainScreen.ChangeColorToBlue();
            Console.Write("Title                       ");
            MainScreen.ChangeColorToDarkGray();
            Console.Write("|     ");
            MainScreen.ChangeColorToBlue();
            Console.Write("Rating");
            MainScreen.ChangeColorToDarkGray();
            Console.WriteLine("      |");
            foreach (KeyValuePair <string, string> movie in moviesList)
            {
                Console.WriteLine("\t-----------------------------------------------------------------------------");
                Console.Write("\t|   ");
                MainScreen.ChangeColorToDarkYellow();
                Console.Write("{0}", count++);
                MainScreen.ChangeColorToDarkGray();
                Console.Write("   |");
                MainScreen.ChangeColorToBlue();
                Console.Write("  {0}", movie.Key);
                MainScreen.ChangeColorToDarkGray();
                Console.Write(new String(' ', (47 - movie.Key.Length)));
                Console.Write("|");
                Console.Write(new String(' ', (17 - movie.Value.Length) / 2));
                MainScreen.ChangeColorToBlue();
                Console.Write("{0}", movie.Value);
                Console.Write(new String(' ', (18 - movie.Value.Length) / 2));
                MainScreen.ChangeColorToDarkGray();
                Console.Write("|\n");
            }
            Console.WriteLine("\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");

            MainScreen.ChangeColorToBlue();
            Console.Write("\n\n  Your Movies Playing Today Are Listed Above. Are you satisfied");
            MainScreen.ChangeColorToDarkYellow();
            Console.WriteLine(" Y / N ?");
            MainScreen.ChangeColorToBlue();
            Console.Write("  > ");
            Console.ForegroundColor = ConsoleColor.Gray;
            string userInput = Console.ReadLine().ToLower();

            if (userInput == "y" || userInput == "yes" || userInput == "0")
            {
                MainScreen.ChangeColorToDarkYellow();
                Console.WriteLine("\n\n  We will play these movies.   :)");
                Thread.Sleep(1000);
                Console.WriteLine("\n  Taking you back to Main Screen.");
                Thread.Sleep(1000);
                MainScreen.ChangeColorToBlue();
                MainScreen.Loading(150);
                Console.Clear();
                MainScreen.MainMenu();
            }
            else if (userInput == "n" || userInput == "no")
            {
                moviesList.Clear();
                AdminMenuMoviesPlayingToday();
            }
            else if (userInput == "")
            {
                CustomException.NoInputDetected();
                AdminMenuSatisfied();
            }
            else
            {
                Console.Clear();
                MainScreen.ChangeColorToRed();
                Console.WriteLine("  That was not a valid option.");
                MainScreen.TryAgain();
                AdminMenuSatisfied();
            }
        }