private void dgvHD_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         int     index = e.RowIndex;
         frmCTPN fr    = new frmCTPN();
         fr.Mahd   = dgvHD.Rows[index].Cells[0].Value.ToString();
         fr.Ngayhd = dgvHD.Rows[index].Cells[1].Value.ToString();
         fr.Nv     = dgvHD.Rows[index].Cells[2].Value.ToString();
         fr.ShowDialog();
     }
     catch
     {
         return;
     }
 }
        private void gridPN_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int     id  = int.Parse(gridPN.CurrentRow.Cells[0].Value.ToString());
            frmCTPN frm = new frmCTPN();

            if (vitri)
            {
                frm.vitri     = true;
                frm.phieunhap = phieunhap_bll.get_PN(id);
                frm.Load_PN_CTPN();
                Program.frmquanly.openSubForm(frm);
            }
            else
            {
                frm.vitri     = false;
                frm.phieunhap = phieunhap_bll.get_PN(id);
                frm.Load_PN_CTPN();
                Program.main.openSubForm(frm);
            }
        }