/// <summary> /// Prints Admin menu /// </summary> /// <param name="admin">Takes a user with admin priviliges</param> public static void PrintAdminSelectionMenu(User admin) { SharedView.PrintWithGreenText($"\tVälkommen {admin.Name}"); var logoutUser = false; do { GeneralViewHelper.WaitAndClearScreen(); AdminView.Print(); string menuInput = InputHelper.AskForMenuInput(); int validatedInput = InputHelper.ValidateMenuInput(menuInput); logoutUser = SharedController.LogoutIf_X_IsPressed(admin, menuInput, validatedInput); if (logoutUser) { continue; } else { switch (validatedInput) { case 1: AdminFunctions(admin); break; case 2: SharedController.BuyBookMenu(admin); break; } } } while (!logoutUser); }
/// <summary> /// Prints out that the user has entered wrong credentials /// </summary> /// <param name="user">takes a user to check if it is null</param> public static void PrintWrongCredentials(User user) { if (user == null) { SharedView.PrintWithRedText("\tFelaktigt användarnamn eller lösenord."); GeneralViewHelper.WaitAndClearScreen(); } }
/// <summary> /// Prints out success! /// </summary> public static void Success() { SharedView.PrintWithGreenText("\tLyckades!"); GeneralViewHelper.WaitAndClearScreen(); }
/// <summary> /// Prints out that the user has entered wrong menu input /// </summary> public static void PrintWrongMenuInput() { SharedView.PrintWithRedText("\tFelaktigt menyval, försök igen."); GeneralViewHelper.WaitAndClearScreen(); }
/// <summary> /// Prints out failed /// </summary> public static void Failed() { SharedView.PrintWithRedText("\tMisslyckades."); GeneralViewHelper.WaitAndClearScreen(); }