From 69f77955de696530b21399ba149c893fd393b7ad Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 6 May 2015 14:37:16 +0000 Subject: [PATCH] Added parameters for PromsPrinter Added parameter for frmPDFStatusForm Added parameter for frmPDFStatusForm Added two properties to DlgPrintProcedure --- .../DlgPrintProcedure.cs | 38 ++++++++++++++++--- .../dlgApproveProcedure.cs | 2 +- PROMS/VEPROMS/PrintMSWord/frmPrintMsWord.cs | 2 +- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index be306a91..d473b778 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -15,6 +15,17 @@ namespace VEPROMS { public partial class DlgPrintProcedure : DevComponents.DotNetBar.Office2007Form { + private string _Prefix = ""; // RHM20150506 Multiline ItemID TextBox + public string Prefix + { + get { return _Prefix; } + set { _Prefix = value; } + } + public bool OpenAfterCreate // RHM20150506 Multiline ItemID TextBox + { + get { return cbxOpenAfterCreate2.Checked; } + set { cbxOpenAfterCreate2.Checked = value; } + } private SessionInfo _MySessionInfo; public SessionInfo MySessionInfo { @@ -111,6 +122,7 @@ namespace VEPROMS btnCreatePDF.Text = "Create PDFs"; HandleDocVersionSettings(); PrepForAllOrOne(false); + Rtf2iTextSharp.DoingComparison = cbxDebug.Checked; // RHM20150506 Multiline ItemID TextBox // don't open all PDFs if doing All Procedures //cbxOpenAfterCreate2.Checked = dvi.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; } @@ -157,8 +169,22 @@ namespace VEPROMS set { _UnitIndex = value; } } public DlgPrintProcedure(ProcedureInfo pi) + { + InitializeComponent(); + _AllProcedures = false; + _DocVersionConfig = pi.MyDocVersion.DocVersionConfig; + _MyProcedure = pi; + btnCreatePDF.Text = "Create PDF"; + HandleDocVersionSettings(); + PrepForAllOrOne(true); + cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; + cbxBlankPgsForDuplex.Checked = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; + } + public DlgPrintProcedure(ProcedureInfo pi, bool automatic) // RHM20150506 Multiline ItemID TextBox { InitializeComponent(); + Automatic = automatic; + Rtf2iTextSharp.DoingComparison = cbxDebug.Checked; _AllProcedures = false; _DocVersionConfig = pi.MyDocVersion.DocVersionConfig; _MyProcedure = pi; @@ -287,7 +313,7 @@ namespace VEPROMS } private Timer _MyTimer; - private void SetupForProcedure() + public void SetupForProcedure() // RHM20150506 Multiline ItemID TextBox { string PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix; string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix; @@ -557,7 +583,7 @@ namespace VEPROMS MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); string myPDFPath = GetMultiunitPDFPath(); // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),cbxBlankPgsForDuplex.Checked, _AllProcedures||Automatic); + frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),cbxBlankPgsForDuplex.Checked, _AllProcedures||Automatic,Prefix); frmStatus.CloseWhenDone = true; Application.DoEvents(); frmStatus.CancelStop = true; @@ -577,7 +603,7 @@ namespace VEPROMS // this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic); + frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic,Prefix); frmStatus.CloseWhenDone = true; Application.DoEvents(); frmStatus.CancelStop = true; @@ -600,7 +626,7 @@ namespace VEPROMS else MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID); ProfileTimer.Pop(profileDepth1); - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic); + frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic,Prefix); frmStatus.CloseWhenDone = true; Application.DoEvents(); frmStatus.CancelStop = true; @@ -653,7 +679,7 @@ namespace VEPROMS if (cbxDebugText.Checked) Volian.Base.Library.DebugText.Show(); } - private void CreatePDF() + public void CreatePDF() // RHM20150506 Multiline ItemID TextBox { if (VlnSettings.GetCommandFlag("PROFILE")) ProfileTimer.TurnOnTracking("Profile.txt"); VEPROMS.CSLA.Library.Database.TrackDBUsage = VlnSettings.GetCommandFlag("DBTrack"); @@ -680,7 +706,7 @@ namespace VEPROMS MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID); // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. ProfileTimer.Pop(profileDepth2); - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic); + frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic,Prefix); frmStatus.MakePlaceKeeper = cbxGeneratePlacekeeper.Checked; int profileDepth3 = ProfileTimer.Push(">>>> frmStatus"); frmStatus.ShowDialog(); diff --git a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs index 596da35b..ed0b0768 100644 --- a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs @@ -1100,7 +1100,7 @@ namespace VEPROMS //ProcedureInfo myproc = pi; //frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location); //myproc.ChangeBarDate = myDTS; - frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts, true); + frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts, true,""); frm.AllowAllWatermarks = true; frm.CloseWhenDone = !ViewPDF; frm.ShowDialog(); diff --git a/PROMS/VEPROMS/PrintMSWord/frmPrintMsWord.cs b/PROMS/VEPROMS/PrintMSWord/frmPrintMsWord.cs index 6316362f..e66ff358 100644 --- a/PROMS/VEPROMS/PrintMSWord/frmPrintMsWord.cs +++ b/PROMS/VEPROMS/PrintMSWord/frmPrintMsWord.cs @@ -87,7 +87,7 @@ namespace PrintMSWord changeBarData.ChangeBarMessage == "None" ? PrintChangeBarText.None : changeBarData.ChangeBarMessage == "RevNum" ? PrintChangeBarText.RevNum : PrintChangeBarText.UserDef; PromsPrinter pp = new PromsPrinter(myProcedure, tbRev.Text, cbWatermark.Text, cbDebugOutput.Checked, false, @"C:\TEMP\32Bit\Compare", openPdf, true, cbd, - myProcedure.DisplayNumber.Replace('/','_').Replace('\\','_'),false); + myProcedure.DisplayNumber.Replace('/','_').Replace('\\','_'),false,false,""); pp.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged); _ElapsedTime = new Dictionary(); DateTime tStart = DateTime.Now;