private void btnAddCourse_Click(object sender, EventArgs e) { if (!trainee.RegisterForCourse(cbCourses.Text, selectedLevel)) { MessageBox.Show("The trainee is already registered for that course!"); } }
private void btnAddCourse_Click(object sender, EventArgs e) { bool added = trainee.RegisterForCourse(cbCourses.Text, getSelectedLevel()); if (added == false) { MessageBox.Show("Trainee is already registered for course with such code."); } }
private void btnAddCourse_Click(object sender, EventArgs e) { CourseLevel lvl = CourseLevel.BEGINNER; if (rbIntermediate.Checked) { lvl = CourseLevel.INTERMEDIATE; } else if (rbAdvanced.Checked) { lvl = CourseLevel.ADVANCED; } bool addedCourse = trainee.RegisterForCourse(cbCourses.Text, lvl); if (!addedCourse) { MessageBox.Show("Trainee is already registered for course with such code."); } }