Example #1
0
 private void RefreshTab()
 {
     CoursesGridView.Columns[7].DefaultCellStyle.Format = "C";
     CoursesGridView.DataSource = CoursesRequests.GetCourseStudentViews(StudentId);
     if (CoursesGridView.RowCount == 0)
     {
         CallDBStudentForm.Enabled = false;
     }
     else
     {
         CallDBStudentForm.Enabled = true;
     }
 }
Example #2
0
        private void RefreshTab(string name)
        {
            switch (name)
            {
            case "TeachersPage":
            {
                TeachersGridView.DataSource = CoursesRequests.GetCourseTeachersViews(course.CoursesTeachers.ToList());
                if (TeachersGridView.RowCount == 0)
                {
                    CallDBTeacherForm.Enabled = false;
                }
                else
                {
                    CallDBTeacherForm.Enabled = true;
                }
                break;
            }

            case "TopicsPage":
            {
                TopicsGridView.DataSource = CoursesRequests.GetTopics(course.Id);
                if (TopicsGridView.RowCount == 0)
                {
                    CallDTopicForm.Enabled = CallETopicForm.Enabled = false;
                }
                else
                {
                    CallDTopicForm.Enabled = CallETopicForm.Enabled = true;
                }
                break;
            }

            case "StudentsPage":
            {
                StudentsGridView.DataSource = CoursesRequests.GetCourseStudentViews(course.CoursesStudents.ToList());
                if (StudentsGridView.RowCount == 0)
                {
                    CallDBStudentForm.Enabled = CallEBStudentForm.Enabled = false;
                }
                else
                {
                    CallDBStudentForm.Enabled = CallEBStudentForm.Enabled = true;
                }
                break;
            }

            default: break;
            }
        }