Compare commits
15 Commits
037c82e22e
...
B2024-062_
Author | SHA1 | Date | |
---|---|---|---|
e5d5528b19 | |||
7713f0cd63 | |||
![]() |
2711520666 | ||
![]() |
4a6c0ba447 | ||
3f3281e2f4 | |||
0eadd3fe33 | |||
4bf42be80a | |||
d7f829737a | |||
25cc62c7c6 | |||
47596c7bca | |||
7129853902 | |||
![]() |
f08466f702 | ||
4248d40917 | |||
![]() |
7cf28366f4 | ||
![]() |
a891a62ffa |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -97,12 +97,12 @@ namespace VEPROMS
|
||||
this.expandableSplitter1 = new DevComponents.DotNetBar.ExpandableSplitter();
|
||||
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
|
||||
this.groupPag = new DevComponents.DotNetBar.Controls.GroupPanel();
|
||||
this.cbxGenerateTimeCritActSum = new System.Windows.Forms.CheckBox();
|
||||
this.expPrnSetting = new DevComponents.DotNetBar.ExpandablePanel();
|
||||
this.ppGpDuplex = new DevComponents.DotNetBar.Controls.GroupPanel();
|
||||
this.tbBlankPage = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||
this.lblBlPg = new DevComponents.DotNetBar.LabelX();
|
||||
this.swtbtnPDFdtPrefixSuffix = new DevComponents.DotNetBar.Controls.SwitchButton();
|
||||
this.cbxGenerateTimeCritActSum = new System.Windows.Forms.CheckBox();
|
||||
this.gpnlDebug.SuspendLayout();
|
||||
this.grpDateSelector.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit();
|
||||
@@ -1285,6 +1285,23 @@ namespace VEPROMS
|
||||
this.groupPag.TabIndex = 111;
|
||||
this.groupPag.Text = "Print using standard PROMS pagination rules by:";
|
||||
//
|
||||
// cbxGenerateTimeCritActSum
|
||||
//
|
||||
this.cbxGenerateTimeCritActSum.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cbxGenerateTimeCritActSum.AutoSize = true;
|
||||
this.cbxGenerateTimeCritActSum.BackColor = System.Drawing.Color.Transparent;
|
||||
this.cbxGenerateTimeCritActSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.cbxGenerateTimeCritActSum.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.cbxGenerateTimeCritActSum.Location = new System.Drawing.Point(240, 273);
|
||||
this.cbxGenerateTimeCritActSum.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.cbxGenerateTimeCritActSum.Name = "cbxGenerateTimeCritActSum";
|
||||
this.cbxGenerateTimeCritActSum.Size = new System.Drawing.Size(294, 17);
|
||||
this.cbxGenerateTimeCritActSum.TabIndex = 102;
|
||||
this.cbxGenerateTimeCritActSum.Text = "Generate Time Critical Action Summary (hidden but used)";
|
||||
this.cbxGenerateTimeCritActSum.UseVisualStyleBackColor = false;
|
||||
this.cbxGenerateTimeCritActSum.Visible = false;
|
||||
//
|
||||
// expPrnSetting
|
||||
//
|
||||
this.expPrnSetting.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
@@ -1421,23 +1438,6 @@ namespace VEPROMS
|
||||
this.swtbtnPDFdtPrefixSuffix.TabIndex = 111;
|
||||
this.swtbtnPDFdtPrefixSuffix.ValueChanged += new System.EventHandler(this.swtbtnPDFdtPrefixSuffix_ValueChanged);
|
||||
//
|
||||
// cbxGenerateTimeCritActSum
|
||||
//
|
||||
this.cbxGenerateTimeCritActSum.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cbxGenerateTimeCritActSum.AutoSize = true;
|
||||
this.cbxGenerateTimeCritActSum.BackColor = System.Drawing.Color.Transparent;
|
||||
this.cbxGenerateTimeCritActSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.cbxGenerateTimeCritActSum.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.cbxGenerateTimeCritActSum.Location = new System.Drawing.Point(240, 273);
|
||||
this.cbxGenerateTimeCritActSum.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.cbxGenerateTimeCritActSum.Name = "cbxGenerateTimeCritActSum";
|
||||
this.cbxGenerateTimeCritActSum.Size = new System.Drawing.Size(294, 17);
|
||||
this.cbxGenerateTimeCritActSum.TabIndex = 102;
|
||||
this.cbxGenerateTimeCritActSum.Text = "Generate Time Critical Action Summary (hidden but used)";
|
||||
this.cbxGenerateTimeCritActSum.UseVisualStyleBackColor = false;
|
||||
this.cbxGenerateTimeCritActSum.Visible = false;
|
||||
//
|
||||
// DlgPrintProcedure
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@@ -1096,6 +1096,15 @@ namespace VEPROMS
|
||||
}
|
||||
private void btnCreatePDF_Click(object sender, EventArgs e)
|
||||
{
|
||||
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||
if (txbRevDate.Visible)
|
||||
{
|
||||
if (!validateDate(txbRevDate))
|
||||
{
|
||||
//txbRevDate.Focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
DoCreatePDF();
|
||||
}
|
||||
|
||||
@@ -1193,16 +1202,42 @@ namespace VEPROMS
|
||||
if (_Initializing) return;
|
||||
ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef;
|
||||
}
|
||||
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||
private bool validateDate(TextBox txtDate)
|
||||
{
|
||||
DateTime dDate;
|
||||
if (DateTime.TryParse(txtDate.Text, out dDate))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
string txtDate2 = txtDate.Text;
|
||||
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
||||
string txtTitle = "Invalid Format";
|
||||
MessageBox.Show(message, txtTitle);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void txbRevDate_Enter(object sender, EventArgs e)
|
||||
{
|
||||
txbDate = txbRevDate;
|
||||
grpDateSelector.Text = "Select Revision Date";
|
||||
grpDateSelector.Visible = calDateSelector.Visible = true;
|
||||
//C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date
|
||||
DateTime initSelDate =(txbDate.Text != null && txbDate.Text.Length != 0)? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
|
||||
calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate;
|
||||
DateTime dDate;
|
||||
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||
if (!validateDate(txbDate))
|
||||
{
|
||||
txbRevDate.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
DateTime initSelDate = (txbDate.Text != null && txbDate.Text.Length != 0) ? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
|
||||
calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate;
|
||||
}
|
||||
}
|
||||
|
||||
private void txbRevDate_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if (_Initializing) return;
|
||||
@@ -1375,6 +1410,7 @@ namespace VEPROMS
|
||||
_NewRevForAllProcs = null;
|
||||
}
|
||||
|
||||
|
||||
//private void cbxDebug_CheckedChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// cbxCmpPRMSpfd.Visible = cbxDebug.Checked;
|
||||
|
@@ -295,7 +295,10 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
}
|
||||
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
|
||||
// B2024-062 Added check for EmptyProcedure. We don't need to show the Try Again message if the procedure
|
||||
// is empty, as it would be just be a waste of time for the user.
|
||||
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && !MyPromsPrinter.EmptyProcedure &&
|
||||
MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
|
||||
|
||||
|
||||
if (_PdfFile == null)
|
||||
|
@@ -951,7 +951,10 @@ namespace VEPROMS.CSLA.Library
|
||||
// it is pasted into a section without enhanced data, then clear it.
|
||||
|
||||
// config data can only be on hls/notes/cautions for pasted steps.
|
||||
if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote) return;
|
||||
// B2024-059: clear links on a source section. When a paste occurs, the section is copied with the links but not
|
||||
// new section is created in the enhanced document, so the links point to the original section (copied). These
|
||||
// need to be removed.
|
||||
if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote && !pasteItem.IsSection) return;
|
||||
|
||||
// See if the pasted step's section is enhanced with enhanced steps, and if not, clear it
|
||||
// Also, if pasting into a source section, don't clear (B2017-225), the 'isSourceSection' portion of the code.
|
||||
@@ -974,6 +977,12 @@ namespace VEPROMS.CSLA.Library
|
||||
// of the pasted step.
|
||||
if (pasteItem.HasEnhancedLinkedStep) pasteItem.RemoveEnhancedFromConfig();
|
||||
}
|
||||
// B2024-059: clear links on a source section
|
||||
if (isSourceSection)
|
||||
{
|
||||
EnhancedDocuments seleds = pasteItem.GetMyEnhancedDocuments();
|
||||
foreach (EnhancedDocument ed in seleds) pasteItem.DoUnlinkEnhanced(pasteItem, ed.Type, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Insert Child
|
||||
|
@@ -672,8 +672,10 @@ namespace Volian.Controls.Library
|
||||
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
|
||||
{
|
||||
DisplayTabItem pg = _MyDisplayTabItems[key];
|
||||
// B2024-038: if section, refresh the editor even if the section is not expanded.
|
||||
bool isSec = myItemInfo.IsSection;
|
||||
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
|
||||
pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID].Expanded)
|
||||
(pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID].Expanded || isSec))
|
||||
{
|
||||
EditItem edtitm = pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID];
|
||||
switch (pasteType)
|
||||
@@ -710,7 +712,8 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
|
||||
{
|
||||
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||
// B2024-038: changed tab key to procedure (was item, which caused crash if section)
|
||||
CloseTabItem(_MyDisplayTabItems["Item - " + proc.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||
return false; //B2017-179 PasteReplace will return null if was aborted
|
||||
}
|
||||
return false;
|
||||
|
@@ -1740,10 +1740,13 @@ namespace Volian.Controls.Library
|
||||
// 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced)
|
||||
// can do Before/After/Replace
|
||||
// 2) 'to' section is 'source' and 'from' section is 'non' (has no MyEnhancedDocuments)
|
||||
// can do Before/After - no links exist in pasted section.
|
||||
// cannot do Replace
|
||||
// can do Before/After - no links exist in pasted section so cannot do Replace
|
||||
// 3) 'to' section is 'source' and 'from' section is same docversion 'source'
|
||||
// can do Before/After/Replace
|
||||
// can do Before/After (B2024-038 removes replace)
|
||||
// 4) 'to' section is not 'source' and 'from' section is source
|
||||
// can do Before/After but not replace - would have to manage
|
||||
// links for 'from' section (B2024-038 added this case)
|
||||
|
||||
SectionConfig secToCfg = iiPasteHere.MyConfig as SectionConfig;
|
||||
SectionConfig secFromCfg = iiClipboard.MyConfig as SectionConfig;
|
||||
|
||||
@@ -1752,13 +1755,22 @@ namespace Volian.Controls.Library
|
||||
bool secFromIsEnhanced = iiClipboard.IsEnhancedSection;
|
||||
bool secFromIsSource = secFromCfg.MyEnhancedDocuments != null && secFromCfg.MyEnhancedDocuments.Count > 0 && secFromCfg.MyEnhancedDocuments[0].Type != 0;
|
||||
bool secCanPaste = false;
|
||||
if (!secToIsEnhanced && !secToIsSource && !secFromIsEnhanced && !secFromIsSource) secCanPaste = true; // 1)
|
||||
else if (secToIsSource && !secFromIsEnhanced && !secFromIsSource) // 2)
|
||||
if (!secToIsEnhanced && !secToIsSource && !secFromIsEnhanced && !secFromIsSource) secCanPaste = true; // 1)
|
||||
else if (secToIsSource && !secFromIsEnhanced && !secFromIsSource) // 2)
|
||||
{
|
||||
secCanPaste = true;
|
||||
okToReplace = false;
|
||||
}
|
||||
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) secCanPaste = true; // 3)
|
||||
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID)
|
||||
{
|
||||
secCanPaste = true; // 3)
|
||||
okToReplace = false;
|
||||
}
|
||||
else if (!secToIsSource && secFromIsSource)
|
||||
{
|
||||
secCanPaste = true; // 4
|
||||
okToReplace = false;
|
||||
}
|
||||
if (iiClipboard.IsRtfRaw) secCanPaste = okToReplace = false; // never paste an equation.
|
||||
if (secCanPaste) cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click));
|
||||
if (okToReplace && secCanPaste) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click));
|
||||
|
@@ -138,6 +138,15 @@ namespace Volian.Print.Library
|
||||
get { return _Prefix; }
|
||||
set { _Prefix = value; }
|
||||
}
|
||||
|
||||
// B2024-062 Set to true when the procedure being printed has no content.
|
||||
// When set to true, will prevent the "Try Again" dialog from appearing
|
||||
// and simply exit the print function
|
||||
private bool _EmptyProcedure = false;
|
||||
public bool EmptyProcedure
|
||||
{
|
||||
get { return _EmptyProcedure; }
|
||||
}
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public event PromsPrinterStatusEvent StatusChanged;
|
||||
internal void OnStatusChanged(object sender, PromsPrintStatusArgs args)
|
||||
@@ -933,6 +942,9 @@ namespace Volian.Print.Library
|
||||
{
|
||||
MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
// B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message
|
||||
// from appearing after the user clicks on the OK button from the Empty Procedure message
|
||||
_EmptyProcedure = true;
|
||||
return null;
|
||||
}
|
||||
OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count);
|
||||
|
Reference in New Issue
Block a user