public EditCourseInfo() { InitializeComponent(); CourseRepository cRepo = new CourseRepository(); this.dataGridViewCourse.DataSource = cRepo.GetAllCourses2(); SemesterRepository sRepo = new SemesterRepository(); this.comboBoxSemester.DataSource = sRepo.GetAllSemesterNames2(); this.radioButtonTheory.Checked = true; }
public AssignCourseInfo() { InitializeComponent(); AccountRepository aRepo = new AccountRepository(); this.comboBoxAccount.DataSource = aRepo.GetAccountIdAndNames2("Faculty"); //CourseRepository cRepo = new CourseRepository(); //this.comboBoxAssignedCourse.DataSource = cRepo.GetCourseNames2(); //this.comboBoxSection.DataSource = cRepo.GetALLSections2(); SemesterRepository sRepo = new SemesterRepository(); this.comboBoxSemesterName.DataSource = sRepo.GetAllSemesterNames2(); CourseAssignRepository asRepo = new CourseAssignRepository(); this.dataGridViewAssignedCourses.DataSource = asRepo.GetAllAssignedCourses2(); }
public ExamInfo() { InitializeComponent(); SemesterRepository sRepo = new SemesterRepository(); this.comboBoxSemesterName.DataSource = sRepo.GetAllSemesterNames2(); CourseRepository cRepo = new CourseRepository(); this.comboBoxCourseId.DataSource = cRepo.GetCourseIdNameSectionsBySemester2(this.comboBoxSemesterName.Text); AccountRepository aRepo = new AccountRepository(); this.comboBoxFacultyId.DataSource = aRepo.GetAccountIdAndNames2("Faculty"); ExamRepository eRepo = new ExamRepository(); this.dataGridViewExam.DataSource = eRepo.GetAllExams2(); }
private void dataGridViewExamCellDoubleClicked(object sender, DataGridViewCellEventArgs e) { SemesterRepository sRepo = new SemesterRepository(); this.comboBoxSemesterName.DataSource = sRepo.GetAllSemesterNames2(); CourseRepository cRepo = new CourseRepository(); this.comboBoxCourseId.DataSource = cRepo.GetCourseIdNameSectionsBySemester2(this.comboBoxSemesterName.Text); AccountRepository aRepo = new AccountRepository(); this.comboBoxFacultyId.DataSource = aRepo.GetAccountIdAndNames2("Faculty"); this.comboBoxSemesterName.SelectedIndex = this.comboBoxSemesterName.FindString(this.dataGridViewExam.CurrentRow.Cells[1].Value.ToString()); this.comboBoxCourseId.SelectedIndex = this.comboBoxCourseId.FindString(this.dataGridViewExam.CurrentRow.Cells[0].Value.ToString()); this.textBoxRoom.Text = this.dataGridViewExam.CurrentRow.Cells[4].Value.ToString(); this.comboBoxFacultyId.SelectedIndex = this.comboBoxFacultyId.FindString(this.dataGridViewExam.CurrentRow.Cells[5].Value.ToString()); if (this.radioButton1.Text == this.dataGridViewExam.CurrentRow.Cells[2].Value.ToString()) { this.radioButton1.Checked = true; } else if (this.radioButton2.Text == this.dataGridViewExam.CurrentRow.Cells[2].Value.ToString()) { this.radioButton2.Checked = true; } else if (this.radioButton3.Text == this.dataGridViewExam.CurrentRow.Cells[2].Value.ToString()) { this.radioButton3.Checked = true; } else if (this.radioButton4.Text == this.dataGridViewExam.CurrentRow.Cells[2].Value.ToString()) { this.radioButton4.Checked = true; } else if (this.radioButton5.Text == this.dataGridViewExam.CurrentRow.Cells[2].Value.ToString()) { this.radioButton5.Checked = true; } else { this.radioButton6.Checked = true; } if (this.radioButtonSlot1.Text == this.dataGridViewExam.CurrentRow.Cells[3].Value.ToString()) { this.radioButtonSlot1.Checked = true; } else if (this.radioButtonSlot2.Text == this.dataGridViewExam.CurrentRow.Cells[3].Value.ToString()) { this.radioButtonSlot2.Checked = true; } else if (this.radioButtonSlot3.Text == this.dataGridViewExam.CurrentRow.Cells[3].Value.ToString()) { this.radioButtonSlot3.Checked = true; } else { this.radioButtonSlot4.Checked = true; } }