Exemple #1
0
        private void buttonApproveDrop_Click(object sender, EventArgs e)
        {
            string fullName    = comboBoxSelectCourse.Text;
            string nameCourse  = fullName.Remove(fullName.Length - 2, 2);
            string nameSection = comboBoxSelectCourse.Text;

            nameSection = "" + nameSection[fullName.Length - 1];

            CourseResults cr = new CourseResults();

            cr.CourseName = nameCourse;
            cr.Semester   = "Spring 17-18";
            cr.Section    = nameSection;
            cr.AccountId  = comboBoxSelectStudent.Text;
            cr.Quiz       = 0;
            cr.Term       = 0;
            cr.FinalMark  = 0;
            cr.Grade      = 0;
            cr.Status     = "Drop";

            CourseResultsRepository crr = new CourseResultsRepository();

            if (crr.UpdateStatus(cr))
            {
                MessageBox.Show("Student ID dropped from the course");
            }
            else
            {
                MessageBox.Show("OOPS!!! Something went wrong");
            }
        }