public static void MainApp() { Role role = new Role(); User user = new User(); user = LoginScreen.Login(); if (user.Role == adminRole) { SuperAdminMenu.DisplayMenu(); } if (user.Role != 0) { role.SetRole(user.Role); ApplicationMenu.DisplayMenu(role, user); } }
//method tha choose CRUD or MEssenger public static void MainApp() { User user = new User(); Console.WriteLine("Select 1 For DataBase Information and 2 for Messenger"); var choose = Convert.ToInt32(Console.ReadLine()); switch (choose) { case 1: ApplicationMenu.Info(user); break; case 2: user.Privilege = User.Role.WithoutPrivilege; break; } }
private static void CheckUsernameAvailabilityInPendingList(string usernameCheck, string passphraseCheck) { var _text = new DataToTextFile(); string pendingUsernameCheck = _text.GetPendingUsername(); if (pendingUsernameCheck == $"username: {usernameCheck}") { print.QuasarScreen("Not Registered"); print.ColoredText("\r\nYour Account Request is Pending. Please wait for the administrator to grant you access.\n\nPress any key to return to Login Screen", ConsoleColor.DarkGreen); } else { _text.NewUsernameRequestToList(usernameCheck, passphraseCheck); print.QuasarScreen("Not Registered"); print.ColoredText("\r\nNew account request is registered. Please wait for the administrator to grant you access.\n\nPress any key to return to Login Screen", ConsoleColor.DarkGreen); } Console.ReadKey(); ApplicationMenu.LoginScreen(); }
public void LoggingOffQuasar() { string yes = "Yes"; string no = "No"; string logOffMessage = "Would you like to log out?\r\n"; string currentUsername = RetrieveCurrentUserFromDatabase(); string yesOrNoSelection = SelectMenu.MenuRow(new List <string> { yes, no }, currentUsername, logOffMessage).option; if (yesOrNoSelection == yes) { print.QuasarScreen("Not Registered"); SetCurrentUserStatusToInactive(currentUsername); ApplicationMenu.LoginScreen(); } else if (yesOrNoSelection == no) { ActiveUserFunctions.UserFunctionMenuScreen(RetrieveCurrentUsernameRoleFromDatabase()); } }
public void TerminateQuasar() { var print = new OutputControl(); string yes = "Yes"; string no = "No"; string currentUsername = "******"; string exitMessage = "\r\nWould you like to exit Quasar?\r\n"; string yesOrNoSelection = SelectMenu.MenuRow(new List <string> { yes, no }, currentUsername, exitMessage).option; if (yesOrNoSelection == yes) { SetCurrentUserStatusToInactive(currentUsername); print.UniversalLoadingOutput("Wait for Quasar to shut down"); print.SpecialThanksMessage(); Environment.Exit(0); } else if (yesOrNoSelection == no) { ApplicationMenu.LoginScreen(); } }