Use "GetItemAndChildren" to assure that the latest data is used.

Fixed logic if trying to create a PDF while a previous PDF is open.
This commit is contained in:
Rich
2012-11-05 21:58:02 +00:00
parent 127a917e1e
commit 7b5fdd9f74
3 changed files with 29 additions and 119 deletions

View File

@@ -393,11 +393,14 @@ namespace VEPROMS
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
pbPDFsStatus.Value = i;
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left,Bottom-50));
frmStatus.CloseWhenDone = true;
frmStatus.CancelStop = true;
frmStatus.ShowDialog();
if (frmStatus.CancelPrinting) break;
using (ProcedureInfo pi = ProcedureInfo.GetItemAndChildren(myProc.ItemID))
{
frmPDFStatusForm frmStatus = new frmPDFStatusForm(pi, RevNum, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50));
frmStatus.CloseWhenDone = true;
frmStatus.CancelStop = true;
frmStatus.ShowDialog();
if (frmStatus.CancelPrinting) break;
}
}
}
pbPDFsStatus.Visible = false;
@@ -429,8 +432,11 @@ namespace VEPROMS
// Also check that format allows override.
ChangeBarDefinition cbd = DetermineChangeBarSettings();
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNum, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50));
frmStatus.ShowDialog();
using (ProcedureInfo pi = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID))
{
frmPDFStatusForm frmStatus = new frmPDFStatusForm(pi, RevNum, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50));
frmStatus.ShowDialog();
}
this.Close();
ShowDebugFiles();
}