private void cmbMajors_SelectionChangeCommitted(object sender, EventArgs e) { if (cboStudent.SelectedValue != null) { string cboStu = cboStudent.SelectedValue.ToString(); int intStuID = int.Parse(cboStudent.SelectedValue.ToString()); CourseBusiness cb = new CourseBusiness(); List <CoursesTakenPreviously> cp = cb.GetCourseTakenPrev(intStuID); } }
private void cboStudents_SelectedIndexChanged(object sender, EventArgs e) { CourseBusiness cb = new CourseBusiness(); int stuID = int.Parse(cboStudents.SelectedItem.ToString()); CList = cb.GetCoursesEnrolled(stuID); cboCourses.DataSource = CList; cboCourses.Refresh(); }
private void btnTest_Click(object sender, EventArgs e) { int resulIns; CourseBusiness cb = new CourseBusiness(); int stuID = Int32.Parse(txtStudentID.Text.ToString()); string cboCo = cboCourse.SelectedValue.ToString(); resulIns = cb.RegisterStudent(stuID, cboCo); MessageBox.Show("Student Registered"); }
private void Form3_Load(object sender, EventArgs e) { try { CourseBusiness cb = new CourseBusiness(); List <Course> CList = cb.GetAllCourses(); cboCourses.DataSource = CList; cboCourses.ValueMember = "CourseNum"; cboCourses.DisplayMember = "CourseNum"; cboCourses.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnUnRegister_Click(object sender, EventArgs e) { int stuID = int.Parse(cboStudents.SelectedValue.ToString()); string cnum = cboCourses.SelectedValue.ToString(); CourseBusiness cb = new CourseBusiness(); int res = cb.UnregisterStudent(stuID, cnum); MessageBox.Show("Student " + stuID.ToString() + " Unregistered for " + cnum); CList.Remove(cnum); cboCourses.DataSource = null; cboCourses.Items.Clear(); cboCourses.DataSource = CList; cboCourses.Refresh(); }
private void Form5_Load(object sender, EventArgs e) { try { CourseBusiness cb = new CourseBusiness(); StudentBusiness sb = new StudentBusiness(); List <int> SList = sb.GetStudentEnrolledIDs(); noDupSList = SList.Distinct().ToList(); cboStudents.DataSource = noDupSList; cboStudents.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void cboStudent_SelectedIndexChanged(object sender, EventArgs e) { dg1.DataSource = null; dg1.Rows.Clear(); if (cboStudent.SelectedValue != null) { string cboStu = cboStudent.SelectedValue.ToString(); int intStuID; bool parseOK = Int32.TryParse(cboStudent.SelectedValue.ToString(), out intStuID); if (parseOK) { CourseBusiness cb = new CourseBusiness(); List <CoursesTakenPreviously> cp = cb.GetCourseTakenPrev(intStuID); dg1.DataSource = cp; dg1.Refresh(); } } }