/// <summary>
 /// Kreira instance Controller klase ovisno o kontekstu.
 /// </summary>
 /// <param name="model"></param>
 /// <param name="view"></param>
 /// <param name="context"></param>
 /// <returns></returns>
 public static Controller NewControllerInstance(Model model, View view, AppContext context)
 {
     if (context == AppContext.Students || context == AppContext.Teachers)
         return new UsersController(model, view);
     else if (context == AppContext.ClassAdministration)
         return new ClassesController(model, view);
     else if (context == AppContext.StudentGrading)
         return new StudentGradingController(model, view);
     else if (context == AppContext.Grades)
         return new GradesController(model, view);
     return null;
 }
Beispiel #2
0
        public LoginController(Model model, Window view)
        {
            this.model = model;
            this.view = (LoginWindow) view;

            usernameStringBuilder = new StringBuilder();
            passwordStringBuilder = new StringBuilder();

            this.view.buttonLogin.IsEnabled = false;

            this.view.buttonLogin.Click += ActionLogin;
            this.view.textBoxPassword.KeyUp += ActionKeyPress;
            this.view.textBoxUsername.KeyUp += ActionKeyPress;
        }
Beispiel #3
0
        public GradesController(Model model, View view)
        {
            this.model = (GradesModel) model;
            this.view = (GradesView) view;

            coursesModel = (CoursesModel) ModelFactory.NewModelInstance(ModelType.Courses);
            courseRubricsModel = (CourseRubricsModel) ModelFactory.NewModelInstance(ModelType.CourseRubrics);

            coursesList = new List<CourseObject>();
            rubricsList = new List<CourseRubricObject>();
            gradesListDictionary = new Dictionary<string, List<GradeObject>>();

            this.view.comboBoxCourse.SelectionChanged += ActionComboChange;

            FetchAllData();
        }
        public ClassesController(Model model, View view)
        {
            this.model = (ClassesInSchoolsModel) model;
            this.view = (ClassesView) view;

            classesModel = (ClassesModel) ModelFactory.NewModelInstance(ModelType.Classes);
            usersModel = (UsersModel) ModelFactory.NewModelInstance(ModelType.Users);

            classesList = new List<ClassObject>();
            schoolClassesList = new List<ClassInSchoolObject>();
            teachersList = new List<UserObject>();

            this.view.CurrentListView.SelectionMode = System.Windows.Controls.SelectionMode.Single;
            this.view.buttonAdd.Click += ActionShowDialog;
            this.view.buttonDelete.Click += ActionDelete;
            this.view.buttonDelete.IsEnabled = false;

            LoadClassNames();
            LoadData();
        }
Beispiel #5
0
        public UsersController(Model model, View view)
        {
            this.model = (UsersModel) model;
            this.view = (UsersView) view;

            classesList = new List<ClassObject>();
            schoolClassesList = new List<ClassInSchoolObject>();
            usersList = new List<object>();

            classesModel = (ClassesModel) ModelFactory.NewModelInstance(ModelType.Classes);
            schoolClassesModel = (ClassesInSchoolsModel) ModelFactory.NewModelInstance(ModelType.ClassesInSchools);

            this.view.buttonDelete.Click += ActionDelete;
            this.view.buttonAdd.Click += ActionShowDialog;

            schoolClassesModel = (ClassesInSchoolsModel) ModelFactory.NewModelInstance(ModelType.ClassesInSchools);

            LoadClasses();
            GetData();
        }
        public StudentGradingController(Model model, View view)
        {
            this.model = (GradesModel) model;
            this.view = (StudentGradingView) view;

            coursesModel = (CoursesModel) ModelFactory.NewModelInstance(ModelType.Courses);
            courseRubricsModel = (CourseRubricsModel) ModelFactory.NewModelInstance(ModelType.CourseRubrics);
            usersModel = (UsersModel) ModelFactory.NewModelInstance(ModelType.Users);

            coursesList = new List<CourseObject>();
            rubricsList = new List<CourseRubricObject>();
            studentsList = new List<UserObject>();

            gradesListDictionary = new Dictionary<string, List<GradeObject>>();

            this.view.comboBoxCourse.SelectionChanged += ActionComboChange;
            this.view.comboBoxStudent.SelectionChanged += ActionComboChange;
            this.view.buttonAddGrade.Click += ActionShowDialog;

            FetchAllData();
        }