Added a hidden check box which is used to generate a Continuous Action Summary

Continuous Action Summary logic
Continuous Action Summary logic – hooks for tree menu and ribbon button
This commit is contained in:
2015-10-23 18:10:31 +00:00
parent e30019797e
commit 17d4c2b26b
5 changed files with 514 additions and 393 deletions

View File

@@ -81,10 +81,40 @@ namespace VEPROMS
_SelectedStepTabPanel.MyStepTabRibbon.PrintRequest -= new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest);
_SelectedStepTabPanel.MyStepTabRibbon.PrintRequest += new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest);
_SelectedStepTabPanel.MyStepTabRibbon.ProgressBar = bottomProgBar;
_SelectedStepTabPanel.MyStepTabRibbon.ContActionSummaryRequest -= MyStepTabRibbon_ContActionSummaryRequest;
_SelectedStepTabPanel.MyStepTabRibbon.ContActionSummaryRequest += MyStepTabRibbon_ContActionSummaryRequest;
}
}
}
void MyStepTabRibbon_ContActionSummaryRequest(object sender, StepTabRibbonEventArgs args)
{
DialogResult dr = System.Windows.Forms.DialogResult.Yes;
ProcedureInfo piThis = null;
if (_CurrentItem != null) piThis = _CurrentItem.MyProcedure;
ProcedureInfo pi = args.Proc as ProcedureInfo;
if (piThis != null && pi.ItemID != piThis.ItemID) pi = piThis;
//added by jcb 20130718 to support create pdf button when multiunit and user selects a unit
pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave;
//end added by jcb 20130718
if (pi == null) return;
DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi);
//added by jcb 20130718 to support create pdf button when multiunit and user selects a unit
prnDlg.SelectedSlave = pi.ProcedureConfig.SelectedSlave == 0 ? -1 : pi.ProcedureConfig.SelectedSlave;
prnDlg.MySessionInfo = MySessionInfo;
//end added by jcb 20130718
prnDlg.Automatic = true;
prnDlg.CreateContinuousActionSummary = true;
prnDlg.OpenAfterCreate = (dr == System.Windows.Forms.DialogResult.Yes);
prnDlg.Prefix = "CASTMP_"; // A temporary procedure PDF is created to grab page numbers
prnDlg.SetupForProcedure();
prnDlg.CreatePDF();
//added by jcb 20130718 to support create pdf button when multiunit and user selects a unit
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
//end added by jcb 20130718
}
public DocVersionInfo SelectedDVI
{
get { return _SelectedDVI; }
@@ -307,7 +337,9 @@ namespace VEPROMS
tv.PrintTransitionReport += new vlnTreeViewEvent(tv_PrintTransitionReport);
tv.ProcessingComplete += tv_ProcessingComplete;
tv.Processing += tv_Processing;
tv.CreateContinuousActionSummary += new vlnTreeViewEvent(tv_CreateContinuousActionSummary);
}
private bool _SkipRefresh = false;
public bool SkipRefresh
{
@@ -511,11 +543,13 @@ namespace VEPROMS
if (pnl.ApplDisplayMode > 0)
{
pnl.MyStepTabPanel.MyStepTabRibbon.btnPdfCreate.Enabled = true;
pnl.MyStepTabPanel.MyStepTabRibbon.btnCASCreate.Enabled = true;
btnPrint.Visible = true;
}
else
{
pnl.MyStepTabPanel.MyStepTabRibbon.btnPdfCreate.Enabled = false;
pnl.MyStepTabPanel.MyStepTabRibbon.btnCASCreate.Enabled = false;
btnPrint.Visible = false;
}
//end added by jcb 20130718
@@ -707,6 +741,24 @@ namespace VEPROMS
prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
void tv_CreateContinuousActionSummary(object sender, vlnTreeEventArgs args)
{
DialogResult dr = System.Windows.Forms.DialogResult.Yes;
ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo;
pi.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex;
if (pi == null) return;
tc.SaveCurrentEditItem(pi);
DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi, true);
prnDlg.MySessionInfo = MySessionInfo;
prnDlg.SelectedSlave = args.UnitIndex;
prnDlg.Automatic = true;
prnDlg.CreateContinuousActionSummary = true;
prnDlg.OpenAfterCreate = (dr == System.Windows.Forms.DialogResult.Yes);
prnDlg.Prefix = "CASTMP_"; // prefix the temporary procedure PDF file that is generated (to grab page numbers)
prnDlg.SetupForProcedure();
prnDlg.CreatePDF();
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
void RefreshDisplayHistory(object sender)
{
displayHistory.RefreshChangeList();
@@ -1712,7 +1764,8 @@ namespace VEPROMS
private DialogResult ShowEULA()
{
string eulaFile = string.Format(@"\{0}", VlnSettings.EULAfile);
string strEULA = System.Environment.CurrentDirectory + eulaFile;
string strEULA = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + eulaFile;
//string strEULA = System.Environment.CurrentDirectory + eulaFile;
frmViewTextFile ViewFile = new frmViewTextFile(strEULA, RichTextBoxStreamType.PlainText);
ViewFile.Text = "End-User License Agreement";
ViewFile.ButtonText = "Agree";