diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index 0f3bf43d..8cc2cc4a 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -659,6 +659,7 @@ namespace VEPROMS // 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); frmStatus.ShowDialog(); + MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0; this.Close(); ShowDebugFiles(); } diff --git a/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs index 4f4344c0..10130875 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs @@ -857,7 +857,16 @@ namespace VEPROMS.CSLA.Library public int SelectedSlave { get { return _SelectedSlave; } - set { _SelectedSlave = value; }//Volian.Base.Library.vlnStackTrace.ShowStackLocal("SelectedSlave = {0}", _SelectedSlave.ToString()); } + set + { + if (_SelectedSlave == value) return; + _SelectedSlave = value; + // if(_DocVersion != null) + // Volian.Base.Library.vlnStackTrace.ShowStackLocal("SelectedSlave {0} = {1}", _DocVersion.MyDocVersionUnique, _SelectedSlave.ToString()); + // else + // Volian.Base.Library.vlnStackTrace.ShowStackLocal("SelectedSlaveInfo {0} = {1}", _DocVersionInfo.MyDocVersionInfoUnique, _SelectedSlave.ToString()); + + } } [Category("Unit")] [DisplayName("Unit Number")] diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs index 7a522a4c..a71e2f9d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs @@ -1611,14 +1611,8 @@ namespace VEPROMS.CSLA.Library foreach (ContentRoUsage ro in cont.ContentRoUsages) { RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID); - ROFSTLookup.rochild rocc = mylookup.GetRoChild12(rou.ROID); - if (rocc.value == null) - rocc = mylookup.GetRoChild(rou.ROID); - string myvalue = rocc.value; - //if (myvalue == null) - //{ - // myvalue = rocc.children[0].value; - //} + string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID); int mytype = rocc.type; cont.FixContentText(rou, myvalue, mytype, null); } @@ -1810,14 +1804,8 @@ namespace VEPROMS.CSLA.Library ROFSTLookup mylookup = myrofst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion); foreach(RoUsageInfo rou in tmp.ContentRoUsages) { - ROFSTLookup.rochild rocc = mylookup.GetRoChild12(rou.ROID); - if (rocc.value == null) - rocc = mylookup.GetRoChild(rou.ROID); - string myvalue = rocc.value; - //if (myvalue == null) - //{ - // myvalue = rocc.children[0].value; - //} + string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ContentItems[0].ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID); int mytype = rocc.type; ctmp.FixContentText(rou, myvalue, mytype, null); } diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs index 5b793475..1ce9a392 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs @@ -624,6 +624,7 @@ namespace VEPROMS.CSLA.Library { } } + DocVersionConfig.SelectedSlave = 0; } return _UnitNames; } diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 72b6ded0..4f0fbcae 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -4733,9 +4733,17 @@ namespace VEPROMS.CSLA.Library ProcedureInfo tmp = DataPortal.Fetch(new ItemAndChildrenByUnitCriteria(args.ProcID, 0, args.UnitID)); if (tmp.MyDocVersion != null) { - tmp.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitID; - (tmp.MyConfig as ProcedureConfig).SelectedSlave = args.UnitID; - ItemInfo.SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion); + if (tmp.MyDocVersion.VersionID == args.MyDocVersion.VersionID) + { + (tmp.MyConfig as ProcedureConfig).SelectedSlave = args.UnitID; + ItemInfo.SetParentSectionAndDocVersion(tmp, args.MyDocVersion, null, tmp, args.MyDocVersion); + } + else + { + tmp.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitID; + (tmp.MyConfig as ProcedureConfig).SelectedSlave = args.UnitID; + ItemInfo.SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion); + } } return tmp; } diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs index 5e1ebe73..8464a2f2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs @@ -170,12 +170,13 @@ namespace VEPROMS.CSLA.Library // return _ROFSTLookup; // } //} - private Dictionary dicLookups = new Dictionary(); + private Dictionary dicLookups = new Dictionary(); public ROFSTLookup GetROFSTLookup(DocVersionInfo dvi) { - if (!dicLookups.ContainsKey(dvi.VersionID)) - dicLookups.Add(dvi.VersionID, new ROFSTLookup(this, dvi)); - return dicLookups[dvi.VersionID]; + string key = string.Format("{0}.{1}",dvi.DocVersionAssociations[0].ROFstID,dvi.DocVersionConfig.SelectedSlave); + if (!dicLookups.ContainsKey(key)) + dicLookups.Add(key, new ROFSTLookup(this, dvi)); + return dicLookups[key]; } #endregion #region AppSupport