//private void comboBox1_Click(object sender, EventArgs e) //{ // gv2_Load_1(sender, e); //} private void gv2_Load_1(object sender, EventArgs e) { if (gv1.mcd.ToString() != "-1") { comboBox1.Text = gv1.mcd.ToString(); } //MessageBox.Show(gv1.mcd.ToString()); if (gv1.tencd.ToString() != "") { bunifuMetroTextbox2.Text = gv1.tencd.ToString(); } List <ChuyenDe_DTO> listCD = ChuyenDe_BUS.loadChuyenDe1(); 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 = gv1.namhoc1; String[] itemshk = { "1", "2" }; bunifuDropdown2.Items = itemshk; bunifuDropdown2.selectedIndex = gv1.hocky1; }
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 static void InitDataBase() { BUS.SQLDataContext.CreateDataContext(); BaoCao = new BaoCao_BUS(); Diem = new Diem_BUS(); GiaoVien = new GiaoVien_BUS(); HocKy = new HocKy_BUS(); HocSinh = new HocSinh_BUS(); Lop = new Lop_BUS(); MonHoc = new MonHoc_BUS(); NamHoc = new NamHoc_BUS(); User = new User_BUS(); CaiDatBus = new CaiDat_BUS(); Data = new Data_BUS(); CaiDat = CaiDatBus.LoadDuLieuCaiDat(); IsLoaded = true; }
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; }
private void bunifuThinButton21_Click(object sender, EventArgs e) { int k = 1; if (comboBox1.Text == "" && bunifuMetroTextbox2.Text == "") { MessageBox.Show("Nhap ma chuyen de hoac ten chuyen de"); k = 0; } if (comboBox2.Text == "" && bunifuMetroTextbox1.Text == "") { MessageBox.Show("Nhap ma sinh vien hoac ten sinh vien"); k = 0; } if (comboBox1.Text == "" && bunifuMetroTextbox2.Text != "") { comboBox1.Text = ChuyenDe_BUS.laymacd(bunifuMetroTextbox2.Text).ToString(); } if (comboBox2.Text == "" && bunifuMetroTextbox1.Text != "") { comboBox2.Text = SinhVien_BUS.layMaSV(bunifuMetroTextbox1.Text).ToString(); } if (k == 1) { List <KetQua_DTO> listKQ = KetQua_BUS.loadKetQua(int.Parse(comboBox2.Text), int.Parse(comboBox1.Text), HocKy_BUS.layMaHK(namhoc.selectedValue, bunifuDropdown2.selectedIndex + 1)); thongtintracuudtgd.AutoGenerateColumns = false; thongtintracuudtgd.DataSource = listKQ; } }