public static void GuestHeading() { Console.Clear(); MainScreen.ChangeColorToRed(); Console.WriteLine(); MainScreen.CenterText("************************************"); MainScreen.CenterText("************** Guests Menu *************"); MainScreen.CenterText("************************************"); MainScreen.ChangeColorToWhite(); Console.WriteLine(); }
public static void AdminHeading() { Console.Clear(); MainScreen.ChangeColorToBlue(); Console.WriteLine(); MainScreen.CenterText("****************************************"); MainScreen.CenterText("**************** Admin Menu ****************"); MainScreen.CenterText("****************************************"); MainScreen.ChangeColorToWhite(); Console.WriteLine(); }
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"); } } }