private void fillData() { try { //fill combobox this.cbbLoaiSanPham.DataSource = SanPhamDao.getListSanPhamCha(); this.cbbLoaiSanPham.ValueMember = "ID"; this.cbbLoaiSanPham.DisplayMember = "TEN_SAN_PHAM"; } catch (Exception ex) { MessageBox.Show("Exception" + ex.Message); } }
private void loadData() { //Load combobox DataTable dt = SanPhamDao.getListSanPhamCha(); DataRow row = dt.NewRow(); row["ID"] = 0; row["TEN_SAN_PHAM"] = "--- All ---"; dt.Rows.InsertAt(row, 0); this.cbbLoaiSanPham.DataSource = dt; this.cbbLoaiSanPham.ValueMember = "ID"; this.cbbLoaiSanPham.DisplayMember = "TEN_SAN_PHAM"; //reloadData(); }
private void loadData() { try { //load combobox DataTable dt = SanPhamDao.getListSanPhamCha(); this.comboBoxLoaiSanPham.DataSource = dt; this.comboBoxLoaiSanPham.ValueMember = "ID"; this.comboBoxLoaiSanPham.DisplayMember = "TEN_SAN_PHAM"; this.donGia.KeyPress += FormatLayoutUtil.AcceptNumber_KeyPress; this.addPageCost.KeyPress += FormatLayoutUtil.AcceptNumber_KeyPress; } catch (Exception ex) { MessageBox.Show("Exception" + ex.Message); } }