public void LogOut() { Console.Clear(); AuthenticationPage authentication = new AuthenticationPage(); authentication.Init(); }
public void Registration() { bool val = true; while (val) { Console.Clear(); UserDTO user = new UserDTO(); string password, confirmPassword; Console.Write("Name : "); user.Name = Console.ReadLine(); Console.Write("Email : "); user.Email = Console.ReadLine(); if (_provider.IsEmailExist(user.Email)) { ShowErrorMessage("User with this email exist in our system, press (0) to try login," + " \npressany any other key try another email"); if (Console.ReadLine() == "0") { Console.Clear(); AuthenticationPage authentication = new AuthenticationPage(); authentication.Init(); break; } Console.Clear(); } else { while (true) { Console.Write("Password : "******"Confirm Password : "******"User created successfully!\nPress any key to start work!"); Console.ReadLine(); Console.Clear(); MainMenuPage mainMenuPage = new MainMenuPage(user); mainMenuPage.Init(); val = false; break; } else { // todo Console.Clear(); ShowErrorMessage("You enter different passwords, try again"); } } } } }