コード例 #1
0
 // TODO - Searching resets selections - Must keep record of selections or search within DataGridView results and not make new DB request
 private void BTN_DialogCourseUnitUnit_Click(object sender, EventArgs e)
 {
     courseUnitView.TabledData = cmd.DialogCourseUnitPopulateUnit(courseCode, TXT_DialogCourseUnitUnit.Text.Trim());
     courseUnitView.Create();
     resultCount = courseUnitView.ResultCount;
     SetResultLabel();
 }
コード例 #2
0
        // From College
        public DialogSemesterCollege(MainForm form, DataGridViewRow row)
        {
            InitializeComponent();

            mainForm    = form;
            collegeId   = (int)row.Cells["CollegeId"].Value;
            collegeName = row.Cells["CollegeName"].Value.ToString();

            LBL_DialogSemesterCollege_Name.Text  = "College:";
            LBL_DialogSemesterCollege_Value.Text = collegeName;

            semesterCollegeView = new BuildView()
            {
                GridView            = DGV_SemesterCollege,
                TabledData          = cmd.SemestersNotAssignedToCollege(collegeId),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.year,
                    columnProperties.isSecondSemester,
                    columnProperties.semesterKey,
                    columnProperties.semesterName_Dialog
                }
            };
            semesterCollegeView.Create();

            if (semesterCollegeView.ResultCount < 1)
            {
                LBL_DialogSemesterCollege_Results.Text = "No available Semester(s)";
                BTN_DialogSemesterCollegeAdd.Enabled   = false;
            }
            else
            {
                LBL_DialogSemesterCollege_Results.Text = semesterCollegeView.ResultCount.ToString() + " available Semester(s)";
            }
        }
コード例 #3
0
        public DialogTeachingHistory(DataGridViewRow row)
        {
            InitializeComponent();

            currentSemester = new SemesterKey(cmd.GetCurrentSemesterKey());
            string email = row.Cells["Email"].Value.ToString();
            string name  = row.Cells["FirstName"].Value.ToString() + " " + row.Cells["LastName"].Value.ToString();

            ColumnProperties columnProperties = new ColumnProperties();
            BuildView        historyView      = new BuildView()
            {
                GridView            = DGV_DialogTeachingHistory,
                TabledData          = cmd.TeacherHistory(email),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.courseCode,
                    columnProperties.courseName,
                    columnProperties.subjectName,
                    columnProperties.collegeName,
                    columnProperties.semesterName,
                    columnProperties.period,
                    columnProperties.teacherEmail_Hidden,
                    columnProperties.teacherFullName_Hidden,
                    columnProperties.semesterKey
                }
            };

            historyView.Create();
            historyView.GridView.MultiSelect = true;

            SetPeriod();
            LBL_TeachingHistory_Name.Text        = name;
            LBL_DialogTeacherHistoryResults.Text = string.Format("{0} Course(s)", historyView.ResultCount.ToString());
        }
コード例 #4
0
        // "form" currently unused - keeping dialog constructor params consistant
        public DialogCourseUnit(MainForm form, DataGridViewRow row)
        {
            InitializeComponent();

            mainForm   = form;
            courseCode = row.Cells["CourseCode"].Value.ToString();
            courseName = row.Cells["CourseName"].Value.ToString();

            ColumnProperties columnProperties = new ColumnProperties();

            courseUnitView = new BuildView()
            {
                GridView            = DGV_DialogCourseUnit,
                TabledData          = cmd.DialogCourseUnitPopulateUnit(courseCode, ""),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.unitCode,
                    columnProperties.unitDescription,
                    columnProperties.core_CheckBox,
                    columnProperties.select_CheckBox
                },
                EditMode = DataGridViewEditMode.EditOnEnter
            };
            courseUnitView.Create();
            totalCount  = courseUnitView.ResultCount;
            resultCount = courseUnitView.ResultCount;

            GetLoadedUnits();
            SetResultLabel();
            LBL_DialogCourseUnit.Text = string.Format("{0} - {1}", courseCode, courseName);
        }
コード例 #5
0
        // From Semester - alternate signature
        public DialogSemesterCollege(MainForm form, DataGridView dgv, int rowNumber)
        {
            InitializeComponent();

            mainForm = form;
            DataGridViewRow row = dgv.Rows[rowNumber];

            semesterKey  = new SemesterKey(row.Cells["SemesterKey"].Value.ToString());
            semesterName = row.Cells["SemesterName"].Value.ToString();

            LBL_DialogSemesterCollege_Name.Text  = "Semester:";
            LBL_DialogSemesterCollege_Value.Text = semesterName;

            semesterCollegeView = new BuildView()
            {
                GridView            = DGV_SemesterCollege,
                TabledData          = cmd.CollegesNotOperatingDuringSemester(semesterKey.Key),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.collegeId_Hidden,
                    columnProperties.collegeName,
                    columnProperties.address,
                    columnProperties.city,
                    columnProperties.state,
                    columnProperties.postCode,
                    columnProperties.semesterKey
                }
            };
            semesterCollegeView.Create();


            if (semesterCollegeView.ResultCount < 1)
            {
                LBL_DialogSemesterCollege_Results.Text = "No available College(s)";
                BTN_DialogSemesterCollegeAdd.Enabled   = false;
            }
            else
            {
                if (mainForm.currentSemester.Key >= semesterKey.Key)
                {
                    BTN_DialogSemesterCollegeAdd.Enabled   = false;
                    LBL_DialogSemesterCollege_Results.Text = "Cannot operate in the past " + semesterCollegeView.ResultCount.ToString() + " College(s)";
                }
                else
                {
                    LBL_DialogSemesterCollege_Results.Text = semesterCollegeView.ResultCount.ToString() + " available College(s)";
                }
            }
        }
コード例 #6
0
        // From Student Enrolments
        public DialogRegister(MainForm form, DataGridViewRow row)
        {
            InitializeComponent();

            // Add values to variables
            mainForm     = form;
            college      = row.Cells["CollegeName"].Value.ToString();
            semesterName = row.Cells["SemesterName"].Value.ToString();
            semesterKey  = new SemesterKey((int)row.Cells["SemesterKey"].Value);
            collegeId    = (int)row.Cells["CollegeId"].Value;

            LBL_DialogRegister_Name.Text             = "College:";
            LBL_DialogRegister_Value.Text            = college;
            LBL_DialogRegister_Semester.Text         = "Semester:";
            LBL_DialogRegister_SemesterValue.Text    = semesterName;
            LBL_DialogRegister_Semester.Visible      = true;
            LBL_DialogRegister_SemesterValue.Visible = true;

            // Create DataGridView
            ColumnProperties columnProperties = new ColumnProperties();
            BuildView        registerView     = new BuildView()
            {
                GridView            = DGV_DialogRegister,
                TabledData          = cmd.AllExceptRegisteredStudents(semesterKey.Key, collegeId),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.studentFirstName_Dialog,
                    columnProperties.studentLastName_Dialog,
                    columnProperties.studentEmail
                }
            };

            registerView.Create();

            // Sundry functions

            if (form.currentSemester.Key >= semesterKey.Key)
            {
                BTN_DialogRegisterAdd.Enabled  = false;
                LBL_DialogRegisterResults.Text = string.Format("Cannot register in the past {0} unregistered students(s)", registerView.ResultCount.ToString());
            }
            else
            {
                LBL_DialogRegisterResults.Text = string.Format("Select a student from {0} unregistered students(s)", registerView.ResultCount.ToString());
            }
        }
コード例 #7
0
        public DialogEnrol(MainForm form, DataGridViewRow row)
        {
            InitializeComponent();

            // Add values to variables
            mainForm                      = form;
            name                          = row.Cells["StudentFullName"].Value.ToString();
            college                       = row.Cells["CollegeName"].Value.ToString();
            semesterName                  = row.Cells["SemesterName"].Value.ToString();
            email                         = row.Cells["StudentEmail"].Value.ToString();
            semesterKey                   = new SemesterKey((int)row.Cells["SemesterKey"].Value);
            collegeId                     = (int)row.Cells["CollegeId"].Value;
            currentSemester               = mainForm.currentSemester;
            LBL_DialogEnrol_Name.Text     = name;
            LBL_DialogEnrol_College.Text  = college;
            LBL_DialogEnrol_Semester.Text = semesterName;

            // Create DataGridView
            columnProperties = new ColumnProperties()
            {
            };
            enrolView = new BuildView()
            {
                GridView            = DGV_DialogEnrol,
                TabledData          = cmd.DialogEnrolment(semesterKey.Key, collegeId, email),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.courseCode,
                    columnProperties.courseName,
                    columnProperties.year,
                    columnProperties.isSecondSemester,
                    columnProperties.collegeName,
                    columnProperties.fee,
                    columnProperties.dateEnroled,
                    columnProperties.select_Hidden
                },
                ButtonColumns = new ButtonColumn[] {
                    columnProperties.enrol
                }
            };
            enrolView.Create();

            // Sundry functions
            DGV_DialogEnrol.CurrentCellDirtyStateChanged += new EventHandler(DGV_DialogEnrol_CurrentCellDirtyStateChanged);
        }
コード例 #8
0
        public DialogSubjectUnit(MainForm form, DataGridViewRow row)
        {
            InitializeComponent();

            // Add values to variables
            mainForm        = form;
            currentSemester = mainForm.currentSemester;
            semesterKey     = new SemesterKey(row.Cells["SemesterKey"].Value.ToString());
            semesterName    = row.Cells["SemesterName"].Value.ToString();
            collegeId       = (int)row.Cells["CollegeId"].Value;
            college         = row.Cells["CollegeName"].Value.ToString();
            courseCode      = row.Cells["CourseCode"].Value.ToString();
            courseName      = row.Cells["CourseName"].Value.ToString();

            // Create DataGridView
            comboBoxColumn           = columnProperties.subject;
            comboBoxColumn.ComboData = new MainDAL().ViewSubjectAssignments(semesterKey.Key, collegeId, courseCode, 0, "");
            subjectUnitView          = new BuildView()
            {
                GridView            = DGV_DialogSubjectUnit,
                TabledData          = cmd.SpecialSubjectUnit(semesterKey.Key, collegeId, courseCode),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.unitCode,
                    columnProperties.unitDescription,
                    columnProperties.subjectId_Hidden,
                    columnProperties.subjectName_Hidden,
                    columnProperties.core,
                    columnProperties.select_CheckBox
                },
                ComboBoxColumns = new ComboBoxColumn[] {
                    comboBoxColumn
                },
                EditMode = DataGridViewEditMode.EditOnEnter
            };
            comboBoxColumn.Create(); // Column must be added to grid on 'data binding complete'
            subjectUnitView.Create();

            // Sundry functions
            GetLoadedUnits();
            SelectCore();
            LBL_DialogSubjectUnit_Course.Text   = courseCode + " - " + courseName;
            LBL_DialogSubjectUnit_College.Text  = college;
            LBL_DialogSubjectUnit_Semester.Text = semesterName;
        }
コード例 #9
0
        public DialogCourseSubject(MainForm form, DataGridViewRow row)
        {
            InitializeComponent();

            // Add values to variables
            mainForm        = form;
            currentSemester = mainForm.currentSemester;
            semesterKey     = new SemesterKey((int)row.Cells["SemesterKey"].Value);
            semesterName    = row.Cells["SemesterName"].Value.ToString();
            collegeId       = (int)row.Cells["CollegeId"].Value;
            college         = row.Cells["CollegeName"].Value.ToString();
            courseCode      = row.Cells["CourseCode"].Value.ToString();
            courseName      = row.Cells["CourseName"].Value.ToString();

            // Create DataGridView
            comboBoxColumn    = columnProperties.teacher;
            courseSubjectView = new BuildView()
            {
                GridView            = DGV_DialogCourseSubject,
                TabledData          = cmd.SpecialCourseSubject(semesterKey.Key, collegeId, courseCode),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.semesterKey,
                    columnProperties.collegeId_Hidden,
                    columnProperties.courseCode_Hidden,
                    columnProperties.subjectId_Hidden,
                    columnProperties.subjectName,
                    columnProperties.teacherFullName_Hidden,
                    columnProperties.teacherEmail_Hidden,
                    columnProperties.select_CheckBox
                },
                ComboBoxColumns = new ComboBoxColumn[] {
                    comboBoxColumn
                },
                EditMode = DataGridViewEditMode.EditOnEnter
            };
            comboBoxColumn.Create(); // Column must be added on 'data binding complete'
            courseSubjectView.Create();

            // Sundry functions
            GetLoadedSubjects();
            LBL_DialogCourseSubject_Course.Text   = courseCode + " - " + courseName;
            LBL_DialogCourseSubject_College.Text  = college;
            LBL_DialogCourseSubject_Semester.Text = semesterName;
        }
コード例 #10
0
        public DialogGrade(MainForm form, DataGridViewRow row)
        {
            // Mainform currently unused - keeping dialog constructor params consistant

            InitializeComponent();

            semesterKey  = new SemesterKey((int)row.Cells["SemesterKey"].Value);
            collegeId    = (int)row.Cells["CollegeId"].Value;
            courseCode   = row.Cells["CourseCode"].Value.ToString();
            email        = row.Cells["StudentEmail"].Value.ToString();
            name         = row.Cells["StudentFullName"].Value.ToString();
            college      = row.Cells["CollegeName"].Value.ToString();
            semesterName = row.Cells["SemesterName"].Value.ToString();
            course       = row.Cells["CourseName"].Value.ToString();

            LBL_DialogGrade_Name.Text     = name;
            LBL_DialogGrade_College.Text  = college;
            LBL_DialogGrade_Semester.Text = semesterName;
            LBL_DialogGrade_Course.Text   = courseCode + " - " + course;

            ColumnProperties columnProperties = new ColumnProperties();

            gradesView = new BuildView()
            {
                GridView            = DGV_DialogGrade,
                TabledData          = cmd.DialogGrades(semesterKey.Key, collegeId, email, courseCode),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.unitCode,
                    columnProperties.unitDescription,
                    columnProperties.subjectName,
                    columnProperties.subjectId_Hidden,
                    columnProperties.competent_CheckBox,
                    columnProperties.rpl_CheckBox,
                    columnProperties.dateGraded
                },
                EditMode = DataGridViewEditMode.EditOnEnter
            };
            gradesView.Create();
            GetGradedUnits();
        }
コード例 #11
0
        public DialogCollegeCourse(MainForm form, DataGridViewRow row)
        {
            InitializeComponent();

            mainForm     = form;
            college      = row.Cells["CollegeName"].Value.ToString();
            semesterName = row.Cells["SemesterName"].Value.ToString();
            semesterKey  = new SemesterKey((int)row.Cells["SemesterKey"].Value);
            collegeId    = (int)row.Cells["CollegeId"].Value;

            ColumnProperties columnProperties  = new ColumnProperties();
            BuildView        collegeCourseView = new BuildView()
            {
                GridView            = DGV_DialogCollegeCourse,
                TabledData          = cmd.CoursesNotRunning(semesterKey.Key, collegeId),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.courseCode,
                    columnProperties.courseName
                }
            };

            collegeCourseView.Create();
            // TODO - On hold whilst deciding how TAB navigation should operate
            // collegeCourseView.GridView.TabStop = true;

            LBL_DialogCollegeCourse_College.Text  = college;
            LBL_DialogCollegeCourse_Semester.Text = semesterName;

            if (form.currentSemester.Key >= semesterKey.Key)
            {
                BTN_DialogCollegeCourseAdd.Enabled   = false;
                LBL_DialogCollegeCourse_Results.Text = string.Format("Cannot assign in the past {0} course(s)", collegeCourseView.ResultCount.ToString());
            }
            else
            {
                LBL_DialogCollegeCourse_Results.Text = string.Format("{0} available course(s)", collegeCourseView.ResultCount.ToString());
            }
        }
コード例 #12
0
        // From Student
        public DialogRegister(MainForm form, DataGridView dgv, int rowNumber)
        {
            InitializeComponent();

            // Add values to variables
            DataGridViewRow row = dgv.Rows[rowNumber];

            mainForm     = form;
            studentEmail = row.Cells["Email"].Value.ToString();
            student      = string.Format("{0} {1}", row.Cells["FirstName"].Value.ToString(), row.Cells["LastName"].Value.ToString());

            LBL_DialogRegister_Name.Text             = "Student:";
            LBL_DialogRegister_Value.Text            = student;
            LBL_DialogRegister_Semester.Visible      = false;
            LBL_DialogRegister_SemesterValue.Visible = false;

            // Create DataGridView
            ColumnProperties columnProperties = new ColumnProperties();
            BuildView        registerView     = new BuildView()
            {
                GridView            = DGV_DialogRegister,
                TabledData          = cmd.AvailableStudentRegistrations(studentEmail),
                DataGridViewColumns = new DataGridViewColumn[] {
                    columnProperties.year,
                    columnProperties.isSecondSemester,
                    columnProperties.semesterKey,
                    columnProperties.collegeId_Hidden,
                    columnProperties.collegeName
                }
            };

            registerView.Create();

            // Sundry functions
            LBL_DialogRegisterResults.Text = string.Format("Select an entry from {0} available registration(s)", registerView.ResultCount.ToString());
        }