public void LuuThongTinHoaDon() { HienThiCT_PhieuXuatBLL hienThiCT_PhieuXuatBLL = new HienThiCT_PhieuXuatBLL(); foreach (CT_PhieuXuat ct in DanhSachDatHang) { hienThiCT_PhieuXuatBLL.ThemMoiChiTietPhieuXuat(ct); } }
private void gvDanhSachHoaDon_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { DataGridViewRow dataGridViewRow = gvDanhSachHoaDon.Rows[e.RowIndex]; texMaHoaDon.Text = dataGridViewRow.Cells[0].Value + ""; foreach (KhoHang kh in cbKhoHang.Items) { if (kh.TenKhoHang == dataGridViewRow.Cells[5].Value + "") { cbKhoHang.SelectedItem = kh; } } foreach (NhanVien nv in CbNhanViens.Items) { if (nv.MaNhanVien == dataGridViewRow.Cells[1].Value + "") { CbNhanViens.SelectedItem = nv; } } HienThiPhieuXuatBLL hienThiPhieuXuatBLL = new HienThiPhieuXuatBLL(); foreach (PhieuXuat px in hienThiPhieuXuatBLL.LayToanBoPhieuXuat()) { if (px.MaPhieuXuat == dataGridViewRow.Cells[0].Value + "") { DateNgayXuat.Value = px.NgayXuat; break; } } txtMaKhachHang.Text = dataGridViewRow.Cells[3].Value + ""; HienThiKhachHangTheoMa(txtMaKhachHang.Text); HienThiCT_PhieuXuatBLL HienThiCT_PhieuXuatBLL = new HienThiCT_PhieuXuatBLL(); HienThiDanhSachCT_PhieuXuat(HienThiCT_PhieuXuatBLL.HienThiChiTietPhieuXuatTheoMa (dataGridViewRow.Cells[0].Value + "")); } }