private static bool ProfileScreen(ProfileManagement profileManagment, Security security, Search search, string username) { Console.Clear(); bool exit = false; Console.WriteLine($"Hello {username}!\n1 -> Search for matches\n2 -> Edit user information\n3 -> Edit user preferences\n4 -> Delete account\n5 -> Exit"); char choice = Console.ReadKey().KeyChar; switch (choice) { case '1': search.FindMatch(security, username); break; case '2': profileManagment.EditUserInfo(security, username); break; case '3': profileManagment.EditUserPreferences(security, username); break; case '4': exit = profileManagment.DeleteUser(security, username); break; case '5': exit = true; break; } return(exit); }
public static bool StartScreen(Security security, ProfileManagement profileManagement, Search search) { Console.Clear(); Console.WriteLine("Hello user!\n1 -> Log into existing user\n2 -> Create new user\n3 -> Exit"); char choice = Console.ReadKey().KeyChar; Console.Clear(); bool exit = false; bool exitProfileScreen = false; switch (choice) { case '1': string username = security.Login(); if (username != "") { do { exitProfileScreen = ProfileScreen(profileManagement, security, search, username); } while (exitProfileScreen == false); } break; case '2': security.CreateNewUser(); break; case '3': exit = true; return(exit); } return(exit); }
static void Main(string[] args) { Console.ReadKey(); Search search = new Search(); SqlManagement sqlAccess = new SqlManagement(); ProfileManagement profileManagement = new ProfileManagement(sqlAccess); Security security = new Security(sqlAccess); bool exit = false; do { exit = Menu.StartScreen(security, profileManagement, search); } while (exit == false); }