static void addTest() { foreach (var item in studentId) { bl.AddStudent( new Student { StudentId = item, StudentName = "user " + item, StudentCampus = item % 2 == 0 ? Campus.Lev : Campus.Tal, StudentGender = item % 2 == 0 ? Gender.male : Gender.female }); } foreach (var item in courseId) { bl.AddCourse( new Course { CourseId = item, CourseName = "course " + item, }); } bl.AddCourseToStudent(studentId[0], courseId[0], 5774, Semester.a); bl.AddCourseToStudent(studentId[0], courseId[2], 5774, Semester.a); bl.AddCourseToStudent(studentId[1], courseId[2], 5774, Semester.b); }
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); } }