Added parameters for PromsPrinter

Added parameter for frmPDFStatusForm
Added parameter for frmPDFStatusForm
Added two properties to DlgPrintProcedure
This commit is contained in:
Rich 2015-05-06 14:37:16 +00:00
parent 759a4c1362
commit 69f77955de
3 changed files with 34 additions and 8 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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<PromsPrinterStatusType, TimeSpan>();
DateTime tStart = DateTime.Now;