private void buttonCustomerRepaid_Click(object sender, EventArgs e) { DataTable dt = Utils.Utils.GetDataTableFromDGV(dgvProductList); if (dt != null && dt.Rows.Count > 0) { ProductDAO productDAO = new Controllers.ProductDAO(); long inputvoucherid = productDAO.InputVoucherAdd(1, 2); if (inputvoucherid < 0) { MessageBox.Show("Có lỗi trong quá kết nối dữ liệu để tạo phiếu nhập. Vui lòng tắt app mở lại hoặc liên hệ it."); return; } bool result = productDAO.InputVoucherDetailAdd(dt, inputvoucherid); if (!result) { MessageBox.Show("Không thể tạo phiếu xuất. Liên hệ it để biết chi tiết"); return; } else { MessageBox.Show("Tạo phiếu xuất thành công"); } dgvProductList.Rows.Clear(); intStep = 1; } }