public static void GuestsMenuEnjoy() { GuestHeading(); MainScreen.ChangeColorToBlue(); Console.WriteLine(" What would you like to do now?\n"); Thread.Sleep(500); MainScreen.ChangeColorToRed(); Console.WriteLine("\t1. Choose another movie\n" + "\t2. Go back to the main menu"); Console.Write(" > "); int menuType = 0; Console.ForegroundColor = ConsoleColor.Gray; string userInput = Console.ReadLine(); try { CustomException.ValidateInput(Convert.ToInt32(userInput), menuType); } catch (CustomException) { GuestsMenuEnjoy(); } catch (OverflowException) { CustomException.OverflowErrorMessage(); GuestsMenuEnjoy(); } catch (FormatException) { CustomException.FormatErrorMessage(); GuestsMenuEnjoy(); } switch (userInput) { case "1": Console.Clear(); GuestsMenu(); break; case "2": MainScreen.ChangeColorToDarkGray(); Console.WriteLine("\n Taking you back to Main Screen."); MainScreen.ChangeColorToRed(); Thread.Sleep(1000); MainScreen.Loading(150); MainScreen.MainMenu(); break; default: break; } }
public static void AdminHeading() { Console.Clear(); MainScreen.ChangeColorToBlue(); Console.WriteLine(); MainScreen.CenterText("****************************************"); MainScreen.CenterText("**************** Admin Menu ****************"); MainScreen.CenterText("****************************************"); MainScreen.ChangeColorToWhite(); Console.WriteLine(); }
private static void AdminMenuMoviesPlayingToday() { AdminHeading(); MainScreen.ChangeColorToDarkYellow(); Console.WriteLine(" Welcome MoviePlex Administrator.\n\n"); MainScreen.ChangeColorToBlue(); Console.Write(" How many movies are playing today?"); MainScreen.ChangeColorToDarkGray(); Console.WriteLine(" (Maximum 10)"); MainScreen.ChangeColorToBlue(); Console.Write(" > "); int menuType = 2; Console.ForegroundColor = ConsoleColor.Gray; string userInput = Console.ReadLine(); if (userInput == "") { CustomException.NoInputDetected(); AdminMenuMoviesPlayingToday(); } try { CustomException.ValidateInput(Convert.ToInt32(userInput), menuType); } catch (CustomException) { AdminMenuMoviesPlayingToday(); } catch (OverflowException) { CustomException.OverflowErrorMessage(); AdminMenuMoviesPlayingToday(); } catch (FormatException) { CustomException.FormatErrorMessage(); AdminMenuMoviesPlayingToday(); } switch (userInput) { default: playingToday = Convert.ToInt32(userInput); Thread.Sleep(500); AdminMenuAddMovies(); break; } }
public static void GuestsMenu() { GuestHeading(); if (Admin.moviesList.Count == 0) { MainScreen.ChangeColorToDarkYellow(); Console.WriteLine(" Sorry, there are no movies playing today."); Thread.Sleep(1000); MainScreen.ChangeColorToDarkGray(); Console.WriteLine("\n Taking you back to Main Screen."); MainScreen.ChangeColorToRed(); Thread.Sleep(1000); MainScreen.Loading(150); MainScreen.MainMenu(); } else { MainScreen.ChangeColorToBlue(); Console.WriteLine(" Welcome!! Movies to be Played Today:"); int count = 1; MainScreen.ChangeColorToDarkGray(); Console.WriteLine("\t<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); Console.Write("\t| "); MainScreen.ChangeColorToRed(); Console.Write("Sr. "); MainScreen.ChangeColorToDarkGray(); Console.Write("| "); MainScreen.ChangeColorToRed(); Console.Write("Title "); MainScreen.ChangeColorToDarkGray(); Console.Write("| "); MainScreen.ChangeColorToRed(); Console.Write("Rating"); MainScreen.ChangeColorToDarkGray(); Console.WriteLine(" |"); foreach (KeyValuePair <string, string> movie in Admin.moviesList) { Console.WriteLine("\t-----------------------------------------------------------------------------"); Console.Write("\t| "); MainScreen.ChangeColorToBlue(); Console.Write("{0}", count++); MainScreen.ChangeColorToDarkGray(); Console.Write(" |"); MainScreen.ChangeColorToRed(); 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.ChangeColorToRed(); 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.WriteLine("\n\n Which movie would you like to watch?"); MainScreen.ChangeColorToRed(); Console.Write(" > "); Console.ForegroundColor = ConsoleColor.Gray; string userInput = Console.ReadLine(); if (userInput == "") { CustomException.NoInputDetected(); GuestsMenu(); } try { CustomException.ValidateMovieChoice(Convert.ToInt32(userInput)); } catch (CustomException) { GuestsMenu(); } catch (OverflowException) { CustomException.OverflowErrorMessage(); GuestsMenu(); } catch (FormatException) { CustomException.FormatErrorMessage(); GuestsMenu(); } switch (userInput) { default: movieChoice = Convert.ToInt32(userInput); GuestsMenuVerifyAge(); break; } } }
public static void LoadingMovie() { GuestHeading(); MainScreen.ChangeColorToRed(); Console.Write(" Playing "); for (int i = 0; i < 50; i++) { Thread.Sleep(50); Console.Write("-"); } MainScreen.ChangeColorToDarkYellow(); Console.WriteLine(" {0}", Admin.moviesList[movieChoice - 1].Key); MainScreen.ChangeColorToDarkYellow(); int timer = 150; Console.WriteLine(); Console.Write(" "); for (int x = 0; x < 5; x++) { Thread.Sleep(timer); Console.Write("+"); Thread.Sleep(timer); Console.Write("\b"); Thread.Sleep(timer); Console.Write("x"); } Console.WriteLine("\n "); MainScreen.ChangeColorToBlue(); for (int x = 0; x < 3; x++) { //Console.Write("/"); //Thread.Sleep(timer); //Console.Write("\b"); //Thread.Sleep(timer); //Console.Write("-"); //Thread.Sleep(timer); //Console.Write("\b"); //Thread.Sleep(timer); //Console.Write("|"); //Thread.Sleep(timer); //Console.Write("\b"); //Thread.Sleep(timer); //Console.Write("-"); //Thread.Sleep(timer); //Console.Write("\b"); //Thread.Sleep(timer); //Console.Write("\\"); //Thread.Sleep(timer); //Console.Write("\b"); //Thread.Sleep(timer); Console.WriteLine( " ---------- __o \n" + "-------- _ \\<,_ \n" + "------ - (*) / (*) "); Thread.Sleep(1500); } Console.Clear(); GuestsMenuEnjoy(); }
public static void GuestsMenuVerifyAge() { GuestHeading(); MainScreen.ChangeColorToRed(); Console.Write("\n You have chosen to watch :"); MainScreen.ChangeColorToDarkYellow(); Console.WriteLine(" {0}", Admin.moviesList[movieChoice - 1].Key); MainScreen.ChangeColorToRed(); Console.Write(" It has the rating of :"); MainScreen.ChangeColorToDarkYellow(); Console.WriteLine(" {0}", Admin.moviesList[movieChoice - 1].Value); MainScreen.ChangeColorToBlue(); Console.WriteLine("\n\n What is your age?"); MainScreen.ChangeColorToRed(); Console.Write(" > "); Console.ForegroundColor = ConsoleColor.Gray; guestAge = Console.ReadLine(); int ageLimit = 0; if (Admin.moviesList[movieChoice - 1].Value == "G") { ageLimit = 0; } else if (Admin.moviesList[movieChoice - 1].Value == "PG") { ageLimit = 10; } else if (Admin.moviesList[movieChoice - 1].Value == "PG-13") { ageLimit = 13; } else if (Admin.moviesList[movieChoice - 1].Value == "R") { ageLimit = 15; } else if (Admin.moviesList[movieChoice - 1].Value == "NC-17") { ageLimit = 17; } else { ageLimit = Convert.ToInt32(Admin.moviesList[movieChoice - 1].Value); } try { CustomException.ValidateGuestAge(Convert.ToInt32(guestAge), ageLimit); } catch (CustomException) { GuestsMenuVerifyAge(); } catch (OverflowException) { CustomException.OverflowErrorMessage(); GuestsMenuVerifyAge(); } catch (FormatException) { CustomException.FormatErrorMessage(); GuestsMenuVerifyAge(); } switch (guestAge) { default: LoadingMovie(); break; } }
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(); } }
public static void AdminMenu() { AdminHeading(); while (WrongPassWordCount != 0) { WrongPassWordCount--; MainScreen.ChangeColorToBlue(); Console.Write("\n Please Enter the Admin Password: "******""; do { ConsoleKeyInfo key = Console.ReadKey(true); // Backspace Should Not Work if (key.Key != ConsoleKey.Backspace && key.Key != ConsoleKey.Enter) { enteredPassword += key.KeyChar; Console.Write("*"); } else { if (key.Key == ConsoleKey.Backspace && enteredPassword.Length > 0) { enteredPassword = enteredPassword.Substring(0, (enteredPassword.Length - 1)); Console.Write("\b \b"); } else if (key.Key == ConsoleKey.Enter) { break; } } } while (true); MainScreen.ChangeColorToWhite(); if (String.Equals(CorrectPassword, enteredPassword)) { MainScreen.ChangeColorToBlue(); Console.WriteLine(); MainScreen.Loading(150); Console.WriteLine("\n Logging you in."); MainScreen.ChangeColorToWhite(); Thread.Sleep(400); Console.Clear(); AdminMenuMoviesPlayingToday(); break; } else if (enteredPassword == "0") { Console.Clear(); MainScreen.MainMenu(); break; } else if (WrongPassWordCount == 0) { AdminHeading(); Console.Beep(); MainScreen.ChangeColorToRed(); Console.WriteLine(" Invalid password.\n"); Console.ForegroundColor = ConsoleColor.White; Console.Write(" You have"); MainScreen.ChangeColorToBlue(); Console.Write(" {0} ", WrongPassWordCount); Console.ForegroundColor = ConsoleColor.White; Console.Write("more attempts to enter the correct password."); Thread.Sleep(1500); MainScreen.ChangeColorToDarkGray(); Console.WriteLine("\n Taking you back to Main Screen."); MainScreen.ChangeColorToBlue(); Thread.Sleep(1000); MainScreen.Loading(150); MainScreen.MainMenu(); } else { AdminHeading(); Console.Beep(); MainScreen.ChangeColorToRed(); Console.WriteLine(" Invalid password.\n"); Console.ForegroundColor = ConsoleColor.Gray; Console.Write(" You have"); MainScreen.ChangeColorToBlue(); Console.Write(" {0} ", WrongPassWordCount); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("more attempts to enter the correct password" + "\n\t\t\tOR"); MainScreen.ChangeColorToDarkGray(); Console.WriteLine("\n Press '0' to go back to the previous screen.\n"); } } }