private void xem_Click(object sender, EventArgs e) { namhoc1 = namhoc.selectedIndex; hocky1 = bunifuDropdown2.selectedIndex; List <ChuyenDe_DTO> listCD = ChuyenDe_BUS.loadChuyenDeXem(bunifuDropdown2.selectedIndex + 1, namhoc.selectedValue); ttcd_dtgv.AutoGenerateColumns = false; ttcd_dtgv.DataSource = listCD; List <string> items; items = HocKy_BUS.loadNamHoc(); int n = items.Count, i = 0; string[] a = new string[n]; foreach (String it in items) { a[i] = it; i++; } namhoc.Items = a; //namhoc.selectedIndex = namhoc.selectedIndex; namhoc.selectedIndex = namhoc1; String[] itemshk = { "1", "2" }; bunifuDropdown2.Items = itemshk; //bunifuDropdown2.selectedIndex = bunifuDropdown2.selectedIndex; bunifuDropdown2.selectedIndex = hocky1; string taikhoan = Form1.taikhoan; int magv = ChuyenDe_BUS.layMaGV(taikhoan); List <ChuyenDe_DTO> listCD2 = ChuyenDe_BUS.loadChuyenDe2(magv, namhoc.selectedValue, (hocky1 + 1)); bunifuCustomDataGrid1.AutoGenerateColumns = false; bunifuCustomDataGrid1.DataSource = listCD2; //ttcd_dtgv.Show(); }
public void loadThongTinChuyenDe() { List <ChuyenDe_DTO> listCD = ChuyenDe_BUS.loadChuyenDe1(); ttcd_dtgv.AutoGenerateColumns = false; ttcd_dtgv.DataSource = listCD; List <string> items; items = HocKy_BUS.loadNamHoc(); int n = items.Count, i = 0; string[] a = new string[n]; foreach (String it in items) { a[i] = it; i++; } namhoc.Items = a; namhoc.selectedIndex = items.Count() - 1; namhoc1 = items.Count() - 1; namhoc11 = namhoc.selectedValue; hocky1 = 0; String[] itemshk = { "1", "2" }; bunifuDropdown2.Items = itemshk; if (n % 2 == 0) { bunifuDropdown2.selectedIndex = 1; hocky1 = 1; } else { bunifuDropdown2.selectedIndex = 0; hocky1 = 0; } string taikhoan = Form1.taikhoan; int magv = ChuyenDe_BUS.layMaGV(taikhoan); List <ChuyenDe_DTO> listCD2 = ChuyenDe_BUS.loadChuyenDe2(magv, namhoc11, (hocky1 + 1)); bunifuCustomDataGrid1.AutoGenerateColumns = false; bunifuCustomDataGrid1.DataSource = listCD2; }