// combokey click 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 = ""; } } 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ã nhà cung cấp") { cmbKey.DataSource = BUS_NCC.laymancc(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "MaNCC"; } else if (sl == "Tên nhà cung cấp") { cmbKey.DataSource = BUS_NCC.laytenncc(); //cmbKey.DisplayMember = "TENTD"; cmbKey.ValueMember = "TenNCC"; } 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) { } }