Example #1
0
        private void UpdateSecurityLevel(int level)
        {
            int old_sl = security_level;

            security_level = level;

            ResetDataGrid();

            // if level changed
            if (security_level != old_sl)
            {
                sub_state = 0;

                // admin
                if (level == 2)
                {
                    current_view = null;
                    main_form.selectTable.SelectedIndex = 0;
                }
                // student/instructor
                else if (level == 0 || level == 1)
                {
                    if (level == 0)
                    {
                        SwitchView("Sign-up");
                    }
                    else
                    {
                        SwitchView("Section View");
                    }
                }
            }

            UpdateState();
        }
Example #2
0
        public void SwitchView(string name)
        {
            switch (name)
            {
            case "Course Info.":
                current_view = course_info_list;
                break;

            case "Person":
                current_view = person_list;
                break;

            case "Instructor":
                current_view = inst_list;
                break;

            case "Section":
                current_view = section_list;
                break;

            case "Section View":
                current_view = section_view;
                break;

            case "Assignment":
                current_view = assign_list;
                break;

            case "Grade":
                current_view = grade_list;
                break;

            case "Sign-up":
                current_view = signup_list;
                break;

            case "Inst Sign-up View":
                current_view = inst_signup_view;
                break;

            case "Inst Assign View":
                current_view = inst_assign_view;
                break;

            case "Inst Grade View":
                current_view = inst_grade_view;
                break;
            }

            if (current_view != null)
            {
                UpdateView();
            }
        }
Example #3
0
        public void Logout()
        {
            CurrentYear = DateTime.Now.Year;
            CurrentSem  = "Fall";

            current_view    = null;
            current_id      = -1;
            current_login   = null;
            current_section = null;
            current_assign  = null;
            sub_state       = 0;
            UpdateSecurityLevel(-1);
        }
Example #4
0
        public cIAGS()
        {
            current_view     = null;
            person_list      = new cPersonList();
            course_info_list = new cCourseInfoList();
            inst_list        = new cInstructorList();
            section_list     = new cSectionList();
            assign_list      = new cAssignmentList();
            signup_list      = new cSignupList();
            grade_list       = new cGradeList();

            // view
            section_view     = new cInstSectionView();
            inst_signup_view = new cInstSignupView();
            inst_assign_view = new cInstAssignView();
            inst_grade_view  = new cInstGradeView();

            // self register for event
            prog_args   = new cProgArgs();
            UpdateProg += new ProgEventHandler(UpdateProgHandler);

            default_dir = Directory.GetCurrentDirectory();
        }
Example #5
0
        public void SwitchView(string name)
        {
            switch(name)
            {
                case "Course Info.":
                    current_view = course_info_list;
                    break;

                case "Person":
                    current_view = person_list;
                    break;

                case "Instructor":
                    current_view = inst_list;
                    break;

                case "Section":
                    current_view = section_list;
                    break;

                case "Section View":
                    current_view = section_view;
                    break;

                case "Assignment":
                    current_view = assign_list;
                    break;

                case "Grade":
                    current_view = grade_list;
                    break;

                case "Sign-up":
                    current_view = signup_list;
                    break;

                case "Inst Sign-up View":
                    current_view = inst_signup_view;
                    break;

                case "Inst Assign View":
                    current_view = inst_assign_view;
                    break;

                case "Inst Grade View":
                    current_view = inst_grade_view;
                    break;
            }

            if(current_view != null)
            {
                UpdateView();
            }
        }
Example #6
0
        public void Logout()
        {
            CurrentYear = DateTime.Now.Year;
            CurrentSem = "Fall";

            current_view = null;
            current_id = -1;
            current_login = null;
            current_section = null;
            current_assign = null;
            sub_state = 0;
            UpdateSecurityLevel(-1);
        }
Example #7
0
        public cIAGS()
        {
            current_view     = null;
            person_list      = new cPersonList();
            course_info_list = new cCourseInfoList();
            inst_list        = new cInstructorList();
            section_list     = new cSectionList();
            assign_list      = new cAssignmentList();
            signup_list      = new cSignupList();
            grade_list       = new cGradeList();

            // view
            section_view = new cInstSectionView();
            inst_signup_view = new cInstSignupView();
            inst_assign_view = new cInstAssignView();
            inst_grade_view = new cInstGradeView();

            // self register for event
            prog_args = new cProgArgs();
            UpdateProg += new ProgEventHandler(UpdateProgHandler);

            default_dir = Directory.GetCurrentDirectory();
        }
Example #8
0
        private void UpdateSecurityLevel(int level)
        {
            int old_sl = security_level;
            security_level = level;

            ResetDataGrid();

            // if level changed
            if (security_level != old_sl)
            {
                sub_state = 0;

                // admin
                if (level == 2)
                {
                    current_view = null;
                    main_form.selectTable.SelectedIndex = 0;
                }
                // student/instructor
                else if (level == 0 || level == 1)
                {
                    if (level == 0)
                    {
                        SwitchView("Sign-up");
                    }
                    else
                    {
                        SwitchView("Section View");
                    }
                }
            }

            UpdateState();
        }