private void addCourseToStudentButton_Click(object sender, RoutedEventArgs e) { try { int StudentId = GetSelectedStudentId(); int CourseId = GetSelectedCoursetId(); int RegisterYear = registerYearComboBox.SelectedIndex + 5774; BE.Semester RegisterSemester = (BE.Semester)registerSemesterComboBox.SelectedItem; bl.AddCourseToStudent(StudentId, CourseId, RegisterYear, RegisterSemester); refreshDataGrid(StudentId); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void GroupByCampusButton_Click(object sender, RoutedEventArgs e) { try { int CourseId = GetSelectedCoursetId(); int RegisterYear = registerYearComboBox.SelectedIndex + 5774; BE.Semester RegisterSemester = (BE.Semester)registerSemesterComboBox.SelectedItem; GroupByCampusUserControl uc = new GroupByCampusUserControl(); uc.Source = bl.GetAllStudentAtCourseGroupByCampuse (CourseId, RegisterYear, RegisterSemester); this.page.Content = uc; } catch (Exception ex) { MessageBox.Show(ex.Message); } }