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; } }