Beispiel #1
0
        private static bool AdminMainMenu()
        {
            bool logout = false;

            do
            {
                Console.Clear();
                Console.WriteLine("Tiger Board!");
                Console.WriteLine("Admin-meny");
                Console.WriteLine();
                Console.WriteLine("0. Logga ut");
                Console.WriteLine("1. Skapa användare");
                Console.WriteLine("2. Redigera användarinfo");
                Console.WriteLine("3. Byt lösenord för användare");
                Console.WriteLine();
                Console.Write("Ditt val: ");
                string menuChoice = UserInput.GetInput <string>();

                switch (menuChoice)
                {
                case "0":
                    logout = LogoutConfirmation();
                    break;

                case "1":
                    UserStore   userStore = new UserStore();
                    UserCreator creator   = new UserCreator();
                    creator.Create(userStore);
                    break;

                case "2":
                    UserManagerPresenter.ChangeUser(UserLevel.Admin);
                    break;

                case "3":
                    AdminPresenter.ChangeUserPassword();
                    break;

                case "4":
                    var ds = new EducationClassStore();
                    EducationClassCreator edCreator = new EducationClassCreator();
                    edCreator.Create(ds);
                    break;

                case "5":
                    ClassListPresenter.MainMenu();
                    break;
                }
            } while (!logout);
            return(false);
        }
Beispiel #2
0
        internal static void ManageClassMenu(User user)
        {
            Console.Clear();
            Console.WriteLine("Hantera klasser");
            Console.WriteLine();
            Console.WriteLine("1. Skapa ny klass");
            Console.WriteLine("2. Visa klasser jag ansvarar för");
            Console.WriteLine("3. Visa kurslista för en klass");
            Console.WriteLine("4. Visa klasslista för en klass");
            Console.WriteLine("5. Lägg till student i klass");
            Console.WriteLine("6. Ta bort student från klass");

            Console.WriteLine();
            Console.Write("Ditt val: ");
            string menuChoice = UserInput.GetInput <string>();

            switch (menuChoice)
            {
            case "1":
                var creator    = new EducationClassCreator();
                var classStore = new EducationClassStore();
                creator.Create(classStore);
                break;

            case "2":
                ClassListPresenter.ListAllClasses(user);
                break;

            case "3":
                ClassListPresenter.ShowCoursesForClass();
                break;

            case "4":
                ClassListPresenter.ShowClassStudentList();
                break;

            case "5":
                ClassListPresenter.AddStudentToClass();
                break;

            case "6":
                ClassListPresenter.RemoveStudentFromClass();
                break;

            default:
                return;
            }
        }