コード例 #1
0
        private void courseDepartmentRel_MouseUp(object sender, MouseButtonEventArgs e)
        {
            CourseDepartmentRel relationGrid = new CourseDepartmentRel();

            relationGrid.Owner = this;
            relationGrid.ShowDialog();
        }
コード例 #2
0
        private void validateTimetableOpen(LoadingPanel.LoadingPanel bar)
        {
            string Columns = " c.id AS course_id";
            string From    = "courses c" +
                             " LEFT JOIN course_teacher_rel ctr ON c.id=ctr.course_id ";
            string Conditions = " c.parent_id IS NOT NULL AND ctr.teacher_id IS NULL ";

            DataTable unasignedCoursesT = DBConnection.Select(From, Columns, Conditions);

            if (unasignedCoursesT.Rows.Count != 0)
            {
                MessageBox.Show("Every course should have a teacher assigned! In order to open Timetable window, you have to assign teachers to these courses first!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                CourseTeacherRelation relationGrid = new CourseTeacherRelation();
                relationGrid.Owner = this;
                relationGrid.checkBox.IsChecked = true;
                bar.Close();
                relationGrid.ShowDialog();
            }
            else
            {
                string ColumnsD = " c.id AS course_id";
                string FromD    = "courses c" +
                                  " LEFT JOIN course_department_rel cdr ON c.id=cdr.course_id ";
                string ConditionsD = " c.parent_id IS NOT NULL AND cdr.department_id IS NULL ";

                DataTable unasignedCoursesD = DBConnection.Select(FromD, ColumnsD, ConditionsD);
                if (unasignedCoursesD.Rows.Count != 0)
                {
                    MessageBox.Show("Every course should have at least a study program assigned! In order to open Timetable window, you have to assign study programs to these courses first!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                    CourseDepartmentRel relationGrid = new CourseDepartmentRel();
                    relationGrid.Owner = this;
                    relationGrid.checkBox.IsChecked = true;
                    bar.Close();
                    relationGrid.ShowDialog();
                }
                else
                {
                    TimetablingResultDisplay timetabling = new TimetablingResultDisplay();
                    timetabling.Owner = this;
                    bar.Close();
                    timetabling.ShowDialog();
                }
            }
        }