/// <summary> /// Shows the user a simple login menu /// when the application starts and /// checks if user exists in database. /// </summary> public string ShowLoginScreen() { BankAccountRepository bankRepository = new BankAccountRepository(); bool passed = false; int tries = 3; MessageMenu(@" ╔═╗┌─┐┌┐┌┌─┐┌─┐┬ ┌─┐ ╔╗ ┌─┐┌┐┌┬┌─ ║ │ ││││└─┐│ ││ ├┤ ╠╩╗├─┤│││├┴┐ ╚═╝└─┘┘└┘└─┘└─┘┴─┘└─┘ ╚═╝┴ ┴┘└┘┴ ┴ "); do { Console.WriteLine(" Please enter Username and Password."); Console.WriteLine("=====================================\n"); Console.Write("# Username: "******"# Password: "******" ERROR: Wrong username or Password. [TRIES LEFT: {--tries}]"); } }while (!passed && tries > 0); // If both checks are passed, clear console and show // application menu depending on username, // else exit the application. if (tries <= 0) { Environment.Exit(0); } Console.Clear(); return(Username); }