Compare commits
5 Commits
B2025-064_
...
Developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| 81643e2aef | |||
| 8a186f9f0c | |||
| 14aa39976a | |||
| c077e0ddc2 | |||
| 7f36a33dea |
@@ -1312,7 +1312,15 @@ namespace VEPROMS
|
|||||||
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
|
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
|
||||||
if (si.IsApproved == 1)
|
if (si.IsApproved == 1)
|
||||||
{
|
{
|
||||||
dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (selectedSlave)); // "true tell export to convert ROs and Transitions to text
|
|
||||||
|
//B2026-016 - Fix error pulling Reference Object info into Export
|
||||||
|
if (pi.MyDocVersion.DocVersionAssociationCount == 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Prior to Approval you must set the Referenced Object Database", "No RO Database set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (selectedSlave)); // "true tell export to convert ROs and Transitions to text
|
||||||
dlg.DocReplace = frm.DocReplace; // this tells approval to prepare an export file with resolved transitions and ROs, word sections are saved with resolved ROs during approval PDF creation and saved in DocReplace
|
dlg.DocReplace = frm.DocReplace; // this tells approval to prepare an export file with resolved transitions and ROs, word sections are saved with resolved ROs during approval PDF creation and saved in DocReplace
|
||||||
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
|
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
|
||||||
dlg.ExportItem(xd, pi, "procedure");
|
dlg.ExportItem(xd, pi, "procedure");
|
||||||
|
|||||||
@@ -1618,8 +1618,15 @@ namespace VEPROMS
|
|||||||
|
|
||||||
public void ExportItem(XmlDocument xd, ItemInfo ii, string nodename)
|
public void ExportItem(XmlDocument xd, ItemInfo ii, string nodename)
|
||||||
{
|
{
|
||||||
XmlElement xe = xd.CreateElement(nodename);
|
//B2026-016 - Fix error pulling Reference Object info into Export
|
||||||
if (ii.IsProcedure)
|
if (ii.MyDocVersion.DocVersionAssociationCount == 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Prior to Exporting Procedures you must set the Referenced Object Database", "No RO Database set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlElement xe = xd.CreateElement(nodename);
|
||||||
|
if (ii.IsProcedure)
|
||||||
{
|
{
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID.ToString()));
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID.ToString()));
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofolderpath", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath));
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofolderpath", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath));
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
@@ -225,8 +226,8 @@ namespace Volian.Controls.Library
|
|||||||
// return internal and external for the procedure level)
|
// return internal and external for the procedure level)
|
||||||
if ((!MyItemInfo.IsProcedure && invalidTrans.Count == 0) || IsProcWithNoExternalTrans(MyItemInfo, invalidTrans))
|
if ((!MyItemInfo.IsProcedure && invalidTrans.Count == 0) || IsProcWithNoExternalTrans(MyItemInfo, invalidTrans))
|
||||||
{
|
{
|
||||||
// C2021 - 027: Procedure level PC/PC
|
// C2021 - 027: Procedure level PC/PC
|
||||||
if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
|
if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
|
||||||
{
|
{
|
||||||
ProcedureConfig sc = MyItemInfo.MyConfig as ProcedureConfig;
|
ProcedureConfig sc = MyItemInfo.MyConfig as ProcedureConfig;
|
||||||
sc.MasterSlave_Applicability = Volian.Base.Library.BigNum.MakeBigNum(MyApplicability);
|
sc.MasterSlave_Applicability = Volian.Base.Library.BigNum.MakeBigNum(MyApplicability);
|
||||||
@@ -284,26 +285,56 @@ namespace Volian.Controls.Library
|
|||||||
Volian.Base.Library.BigNum MasterSlave_ApplicabilityTmp;
|
Volian.Base.Library.BigNum MasterSlave_ApplicabilityTmp;
|
||||||
StepConfig sc = MyItemInfo.MyConfig as StepConfig;
|
StepConfig sc = MyItemInfo.MyConfig as StepConfig;
|
||||||
MasterSlave_ApplicabilityTmp = sc.MasterSlave_Applicability;
|
MasterSlave_ApplicabilityTmp = sc.MasterSlave_Applicability;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
ItemInfo startitm = MyItemInfo.FirstSibling;
|
|
||||||
|
ItemInfo startitm = MyItemInfo.FirstSibling;
|
||||||
while (startitm != null)
|
while (startitm != null)
|
||||||
{
|
{
|
||||||
StepConfig sc2 = startitm.MyConfig as StepConfig;
|
|
||||||
using (Content cnt = Content.Get(startitm.MyContent.ContentID))
|
// C2026-023: Check for Transitions when setting Applicability to all for a level
|
||||||
{
|
List<InvalidTransition> invalidTrans = WillTransitionsBeValidCommand.Execute(startitm.ItemID, MasterSlave_ApplicabilityTmp.ToString());
|
||||||
sc2.MasterSlave_Applicability = (MasterSlave_ApplicabilityTmp);
|
if (IsProcWithNoExternalTrans(startitm, invalidTrans))
|
||||||
cnt.Config = sc2.ToString();
|
{
|
||||||
cnt.Save();
|
StepConfig sc2 = startitm.MyConfig as StepConfig;
|
||||||
|
using (Content cnt = Content.Get(startitm.MyContent.ContentID))
|
||||||
|
{
|
||||||
|
sc2.MasterSlave_Applicability = (MasterSlave_ApplicabilityTmp);
|
||||||
|
cnt.Config = sc2.ToString();
|
||||||
|
cnt.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (sb.Length == 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine("The applicability for some Step(s) cannot be changed due to transition links.");
|
||||||
|
sb.AppendLine("Applicability settings for these steps will return to original settings when OK is selected.");
|
||||||
|
sb.AppendLine("Changing the applicability for would invalidate a transition in the following steps:");
|
||||||
|
sb.AppendLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (InvalidTransition inv in invalidTrans.Where(x => !x.TgtStep.StartsWith(x.SrcStep)))
|
||||||
|
{
|
||||||
|
sb.AppendLine(string.Format("{0} : From {1} to {2}.", startitm.MyTab.CleanTextNoSymbols.Trim(), inv.TgtStep, inv.SrcStep));
|
||||||
|
}
|
||||||
|
|
||||||
|
invalidTrans.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
startitm = startitm.GetNext();
|
startitm = startitm.GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
_MyDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure();
|
_MyDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure();
|
||||||
|
|
||||||
}
|
if (sb.Length > 0)
|
||||||
|
FlexibleMessageBox.Show(sb.ToString(), "Transitions Affected By Applicability Change");
|
||||||
|
|
||||||
// B2021-149: for procedure, only consider external transitions as invalid
|
|
||||||
private bool IsProcWithNoExternalTrans(ItemInfo ii, List<InvalidTransition> invalidTrans)
|
}
|
||||||
|
|
||||||
|
// B2021-149: for procedure, only consider external transitions as invalid
|
||||||
|
private bool IsProcWithNoExternalTrans(ItemInfo ii, List<InvalidTransition> invalidTrans)
|
||||||
{
|
{
|
||||||
if (invalidTrans.Count == 0) return true;
|
if (invalidTrans.Count == 0) return true;
|
||||||
foreach (InvalidTransition iT in invalidTrans)
|
foreach (InvalidTransition iT in invalidTrans)
|
||||||
|
|||||||
Reference in New Issue
Block a user