Пример #1
0
        private static bool TeacherMainMenu(User user)
        {
            bool logout = false;

            do
            {
                Console.Clear();
                Console.WriteLine("Tiger Board!");
                Console.WriteLine("Lärarmeny");
                Console.WriteLine();
                Console.WriteLine("0. Logga ut");
                Console.WriteLine("1. Visa mina kurser");
                Console.WriteLine("2. Visa studentlista för en kurs");
                Console.WriteLine("3. Betygsätt student");
                Console.WriteLine("4. Betygsätt delmål");
                Console.WriteLine("5. Visa kursplan");
                Console.WriteLine("6. Visa kursmål");
                Console.WriteLine("7. Byt lösenord");

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

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

                case "1":
                    CoursePresenter.ShowTeacherCourses(user);
                    break;

                case "2":
                    CoursePresenter.ShowStudentsForCourse(user);
                    break;

                case "3":
                    GradePresenter.GradeStudentInCourse(user);
                    break;

                case "4":
                    GradePresenter.GradeStudentGoal(user);
                    break;

                case "5":
                    CoursePresenter.ShowCoursePlan(user);
                    break;

                case "6":
                    CoursePresenter.ShowCourseGoals();
                    break;

                case "7":
                    AccountPresenter.ChangePassword(user);
                    break;
                }
            } while (!logout);
            return(false);
        }
Пример #2
0
        private static bool EducationSupervisorMainMenu(User educationSupervisor)
        {
            bool logout = false;

            do
            {
                Console.Clear();
                Console.WriteLine("Tiger Board!");
                Console.WriteLine("Utbildningledare-meny");
                Console.WriteLine();
                Console.WriteLine("0. Logga ut");
                Console.WriteLine("1. Skapa konton");
                Console.WriteLine("2. Visa lärare");
                Console.WriteLine("3. Hantera klasser");
                Console.WriteLine("4. Hantera studenter");
                Console.WriteLine("5. Hantera kurser");
                Console.WriteLine("6. Byt lösenord");
                Console.WriteLine();

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

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

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

                case "2":
                    UserManagerPresenter.ListTeachers();
                    break;

                case "3":
                    EducationSupervisorPresenter.ManageClassMenu(educationSupervisor);
                    break;

                case "4":
                    UserManagerPresenter.ManageStudents(educationSupervisor);
                    break;

                case "5":
                    CoursePresenter.CourseManagementMenu(educationSupervisor);
                    break;

                case "6":
                    AccountPresenter.ChangePassword(educationSupervisor);
                    break;
                }
            } while (!logout);
            return(false);
        }
Пример #3
0
        private static bool StudentMainMenu(User user)
        {
            bool logout = false;

            do
            {
                Console.Clear();
                Console.WriteLine("Tiger Board!");
                Console.WriteLine("Studentmeny");
                Console.WriteLine();
                Console.WriteLine("0. Logga ut");
                Console.WriteLine("1. Visa mina studieresultat");
                Console.WriteLine("2. Klasslista");
                Console.WriteLine("3. Kurslista");
                Console.WriteLine("4. Byt lösenord");
                Console.WriteLine("5. Visa kursplan");
                Console.WriteLine("6. Visa kursmål");

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

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

                case "1":
                    GradePresenter.ShowStudentCourseGrades(user);
                    break;

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

                case "3":
                    CoursePresenter.ShowStudentCourseList(user);
                    break;

                case "4":
                    AccountPresenter.ChangePassword(user);
                    break;

                case "5":
                    CoursePresenter.ShowCoursePlan(user);
                    break;

                case "6":
                    CoursePresenter.ShowStudentCourseGoals(user);
                    break;
                }
            } while (!logout);
            return(false);
        }
Пример #4
0
        public bool ChangePassword(string prevPass, string newPass, string userName, AccountDto currentAccount)
        {
            AccountPresenter accPresenter = new AccountPresenter();
            var result = accPresenter.ChangePassword(userName, newPass, prevPass);

            if (result != null)
            {
                currentAccount.PassChangeDate = result.PassChangeDate;
                AccountBindingList.ResetBindings();
                return(true);
            }
            return(false);
        }