public void CreateAccount() { Console.Clear(); Console.WriteLine("Please enter a nickName between 3 and 50 characters"); string nickName = Console.ReadLine(); var user = SqlQueries.GetUser(nickName); if (user == null) { Console.WriteLine("Password:"******"Birth date ex 1989-01-01:"); string birthDate = Console.ReadLine(); Console.WriteLine("City"); string city = Console.ReadLine(); Console.WriteLine("Enter your secret recovery word"); string secret = Console.ReadLine(); SqlQueries.CreateUser(nickName, password, birthDate, city, secret); } else { Console.WriteLine("Name taken, Please try something else!"); CreateAccount(); } }
public static void MainMenu(string nickName) { bool continueMenu = true; while (continueMenu) { Console.WriteLine("Menu"); Console.WriteLine("-------------------------"); Console.WriteLine("(1) View profile."); Console.WriteLine("(2) Edit profile."); Console.WriteLine("(3) Messages."); Console.WriteLine("(4) Search for user."); Console.WriteLine("(5) Logout."); Console.WriteLine(); switch (Console.ReadKey().KeyChar) { case '1': DisplayProfile(SqlQueries.GetUser(nickName)); break; case '2': EditProfileMenu(); break; case '3': MessagesMenu(nickName); break; case '4': break; case '5': LogInSystemControll lsc = new LogInSystemControll(); lsc.StartLogInSystem(); break; } } }
public static void MessagesMenu(string nickName) { bool continueMenu = true; SqlQueries.GetUser(nickName); User user = new User(); MessageData.ListAllComments(user.UserId); while (continueMenu) { Console.WriteLine("Messages"); Console.WriteLine("-------------------------"); Console.WriteLine("(1) Read Message."); Console.WriteLine("(2) Send Message.");; Console.WriteLine("(3) Delete Messsage."); Console.WriteLine("(4) Exit to Main menu"); Console.WriteLine(); switch (Console.ReadKey().KeyChar) { case '1': break; case '2': break; case '3': break; case '4': default: continueMenu = false; break; } } }