private void buttonX2_Click(object sender, EventArgs e) { frmAddHangHoa frm = new frmAddHangHoa(); frm.ShowDialog(); dgvHangHoa.DataSource = hangBLL.LoadDanhSachHH(false); }
private void frmAddHoaDon_Load(object sender, EventArgs e) { hoaDon = new HoaDon(); dgvHangHoa.DataSource = hangBLL.LoadDanhSachHH(false); cboLoaiHang.DataSource = loaiBLL.LoadAll(); cboLoaiHang.DisplayMember = "TenLoai"; cboLoaiHang.ValueMember = "ID"; cboLoaiHang.SelectedIndex = -1; if (dgvHangHoa.Rows.Count > 0) { txtMaHang.Text = dgvHangHoa.Rows[0].Cells[0].Value.ToString(); txtTenHang.Text = dgvHangHoa.Rows[0].Cells[1].Value.ToString(); txtLoai.Text = dgvHangHoa.Rows[0].Cells[2].Value.ToString(); txtDonGia.Text = dgvHangHoa.Rows[0].Cells[3].Value.ToString(); txtSoLuong.Text = "1"; } }
private void frmHangHoa_Load(object sender, EventArgs e) { dgHangHoa.DataSource = hhBLL.LoadDanhSachHH(true); cboLoaiHang.DataSource = lhBLL.LoadAll(); cboLoaiHang.DisplayMember = "TenLoai"; cboLoaiHang.ValueMember = "ID"; cboLoaiHang.SelectedIndex = -1; cboLoaiTim.DataSource = lhBLL.LoadAll(); cboLoaiTim.DisplayMember = "TenLoai"; cboLoaiTim.ValueMember = "ID"; cboLoaiTim.SelectedIndex = -1; if (dgHangHoa.Rows.Count > 0) { string id = dgHangHoa.Rows[0].Cells[0].Value.ToString(); HangHoa hh = hhBLL.GetHangHoaByID(id); ShowInfoHang(hh); } }