示例#1
0
 private void btnAddCourse_Click(object sender, EventArgs e)
 {
     if (!trainee.RegisterForCourse(cbCourses.Text, selectedLevel))
     {
         MessageBox.Show("The trainee is already registered for that course!");
     }
 }
示例#2
0
        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.");
            }
        }
示例#3
0
        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.");
            }
        }