// // // // combokeyclick : private void cmbKey_Click(object sender, EventArgs e) { string sl = cboTimKiem.Text; try { if (sl == "Mã kho") { cmbKey.DataSource = BUS_Kho.laymakho(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "MaKho"; } else if (sl == "Tên kho") { cmbKey.DataSource = BUS_Kho.laytenkho(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "TenKho"; } else { cmbKey.Text = ""; } } catch (Exception ex) { } }
private void cmbKey_Click(object sender, EventArgs e) { string sl = cboTimKiem.Text; try { if (sl == "Mã hàng hóa") { cmbKey.DataSource = BUS_HangHoa.laymahh(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "MaHH"; } else if (sl == "Tên hàng hóa") { cmbKey.DataSource = BUS_HangHoa.laytenhh(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "TenHH"; } else { cmbKey.Text = ""; } // // if (sl == "Mã khách hàng") { cmbKey.DataSource = BUS_KhachHang.laymakhachhang(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "MaKH"; } else if (sl == "Tên khách hàng") { cmbKey.DataSource = BUS_KhachHang.laytenkhachhang(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "TenKH"; } else { cmbKey.Text = ""; } // // if (sl == "Mã kho") { cmbKey.DataSource = BUS_Kho.laymakho(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "MaKho"; } else if (sl == "Tên kho") { cmbKey.DataSource = BUS_Kho.laytenkho(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "TenKho"; } else { cmbKey.Text = ""; } } catch (Exception ex) { } }