private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawString("PHIẾU NHẬP SÁCH", new Font("Times New Roman", 20), Brushes.Black, new Point(300, 25));
            e.Graphics.DrawString("Ngày nhập: " + DateTime.Now, new Font("Times New Roman", 15), Brushes.Black, new Point(275, 75));
            e.Graphics.DrawString("Mã phiếu nhập sách: " + txtMaPN.Text, new Font("Times New Roman", 15), Brushes.Black, new Point(300, 125));
            e.Graphics.DrawString("STT", new Font("Times New Roman", 15), Brushes.Black, new Point(25, 175));
            e.Graphics.DrawString("Mã Sách", new Font("Times New Roman", 15), Brushes.Black, new Point(75, 175));
            e.Graphics.DrawString("Tên Sách", new Font("Times New Roman", 15), Brushes.Black, new Point(200, 175));
            // e.Graphics.DrawString("Tác giả", new Font("Times New Roman", 15), Brushes.Black, new Point(400, 175));
            e.Graphics.DrawString("Số lượng", new Font("Times New Roman", 15), Brushes.Black, new Point(400, 175));
            e.Graphics.DrawString("Đơn giá nhập", new Font("Times New Roman", 15), Brushes.Black, new Point(600, 175));
            e.Graphics.DrawString("----------------------------------------------------------------------------------------------------------------",
                                  new Font("Times New Roman", 15), Brushes.Black, new Point(25, 200));
            int h = 200;

            for (int i = 0; i < dgvCTPN.Rows.Count; i++)
            {
                h += 25;
                e.Graphics.DrawString((i + 1).ToString(), new Font("Times New Roman", 13), Brushes.Black, new Point(25, h));
                e.Graphics.DrawString(dgvCTPN.Rows[i].Cells[2].Value.ToString(), new Font("Times New Roman", 13), Brushes.Black, new Point(75, h));
                e.Graphics.DrawString(dgvCTPN.Rows[i].Cells[6].Value.ToString(), new Font("Times New Roman", 13), Brushes.Black, new Point(200, h));
                //   e.Graphics.DrawString(listSach[i].TacGia, new Font("Times New Roman", 13), Brushes.Black, new Point(400, h));
                e.Graphics.DrawString(dgvCTPN.Rows[i].Cells[3].Value.ToString(), new Font("Times New Roman", 13), Brushes.Black, new Point(400, h));
                e.Graphics.DrawString(dgvCTPN.Rows[i].Cells[4].Value.ToString(), new Font("Times New Roman", 13), Brushes.Black, new Point(600, h));
            }
            e.Graphics.DrawString("----------------------------------------------------------------------------------------------------------------",
                                  new Font("Times New Roman", 15), Brushes.Black, new Point(25, h + 25));
            PhieuNhap pn = PhieuNhapBUS.getThongTinPhieuNhap(txtMaPN.Text);

            e.Graphics.DrawString("Tổng tiền: " + pn.TongTien.ToString("###,###,###' 'VNĐ"), new Font("Times New Roman", 15), Brushes.Black, new Point(25, h + 75));
            e.Graphics.DrawString("** Lưu ý: Phiếu nhập sách chỉ có giá trị trong ngày!", new Font("Times New Roman", 14, FontStyle.Italic), Brushes.Black, new Point(25, h + 125));
        }
        public void UpdateTongTien_Xoa_Sua()
        {
            // txtMaPN.Text = GetMaPN.getMaPN;
            PhieuNhap pn = PhieuNhapBUS.getThongTinPhieuNhap(txtMaPN.Text);

            TongTienNhap = pn.TongTien - Int32.Parse(txtTongTien.Text);
            PhieuNhapBUS.UpdateTongtien(txtMaPN.Text, TongTienNhap);
        }