public void LoadDSLHP() { DSLHPbindingSource.DataSource = LopHocPhan_BUS.DanhSachLHP(); gcDSLHP.DataSource = DSLHPbindingSource; int soKhoa = cboKhoa.Items.Count; for (int i = 0; i < soKhoa; i++) { cboKhoa.Items.RemoveAt(0); } int soMonhoc = cboMonHoc.Items.Count; int soGiaoVien = cboGiaoVien.Items.Count; for (int i = 0; i < soMonhoc; i++) { repositoryItemComboBox1.Items.RemoveAt(0); cboMonHoc.Items.RemoveAt(0); } for (int i = 0; i < soGiaoVien; i++) { repositoryItemComboBox2.Items.RemoveAt(0); cboGiaoVien.Items.RemoveAt(0); } DataTable dtb = Khoa_BUS.LoadtenKhoa(); for (int i = 0; i < dtb.Rows.Count; i++) { string name = ChuanHoa(dtb.Rows[i][0].ToString().ToLower()); cboKhoa.Items.Add(name); } DataTable dtb1 = MonHoc_BUS.LoadtenMH(cboKhoa.Text); for (int i = 0; i < dtb1.Rows.Count; i++) { string name = ChuanHoa(dtb1.Rows[i][0].ToString().ToLower()); repositoryItemComboBox1.Items.Add(name); cboMonHoc.Items.Add(name); } DataTable dtb2 = GiaoVien_BUS.LoadtenGiaoVien(cboKhoa.Text); for (int i = 0; i < dtb2.Rows.Count; i++) { string name = ChuanHoa(dtb2.Rows[i][0].ToString().ToLower()); repositoryItemComboBox2.Items.Add(name); cboGiaoVien.Items.Add(name); } //cboMonHoc.ResetText(); //cboGiaoVien.ResetText(); }
//các môn học, giáo viên thuộc khoa ... private void cboKhoa_SelectedIndexChanged(object sender, EventArgs e) { int soMonhoc = cboMonHoc.Items.Count; int soGiaoVien = cboGiaoVien.Items.Count; for (int i = 0; i < soMonhoc; i++) { repositoryItemComboBox1.Items.RemoveAt(0); cboMonHoc.Items.RemoveAt(0); } for (int i = 0; i < soGiaoVien; i++) { repositoryItemComboBox2.Items.RemoveAt(0); cboGiaoVien.Items.RemoveAt(0); } cboMonHoc.ResetText(); cboGiaoVien.ResetText(); DataTable dtb = MonHoc_BUS.LoadtenMH(cboKhoa.Text); for (int i = 0; i < dtb.Rows.Count; i++) { string name = ChuanHoa(dtb.Rows[i][0].ToString().ToLower()); repositoryItemComboBox1.Items.Add(name); cboMonHoc.Items.Add(name); } DataTable dtb1 = GiaoVien_BUS.LoadtenGiaoVien(cboKhoa.Text); for (int i = 0; i < dtb1.Rows.Count; i++) { string name = ChuanHoa(dtb1.Rows[i][0].ToString().ToLower()); repositoryItemComboBox2.Items.Add(name); cboGiaoVien.Items.Add(name); } //cboMonHoc.SelectedIndex = 0; }