Changed how ROFSTLookup object was obtained based on correct DocVersion

Added support for passing an override DocVersion ID as a 1-time fix to Braidwood data
This commit is contained in:
Rich 2014-02-07 17:43:04 +00:00
parent 2cf8e67bd7
commit ffd5191ffc
2 changed files with 13 additions and 7 deletions

View File

@ -75,7 +75,7 @@ namespace Volian.Controls.Library
_MyDVI = procInfo.ActiveParent as DocVersionInfo;
// added jcb 20121221 to support set ro from word doc
if (_MyDVI.DocVersionAssociations != null && _MyDVI.DocVersionAssociations.Count > 0)
MyLookup = _MyDVI.DocVersionAssociations[0].MyROFst.ROFSTLookup;
MyLookup = _MyDVI.DocVersionAssociations[0].MyROFst.GetROFSTLookup(_MyDVI);
else
MyLookup = null;
return _MyDVI;
@ -295,10 +295,10 @@ namespace Volian.Controls.Library
// the roid may be 12 or 16 chars long, with the last 4 set if there is unit specific
// menuing. Pad to 12 to store in the rousage table.
string padroid = (myroid.Length <= 12) ? myroid + "0000" : myroid;
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", padroid, MyLookup.DocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID);
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", padroid, MyLookup.MyDocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID);
// Resolve symbols and scientific notation in the RO return value
string valtxt = MyLookup.GetTranslatedRoValue(padroid, MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); //ConvertSymbolsAndStuff(selectedChld.value);
MyStepRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, myvalue, linktxt, padroid, MyLookup.DocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID));
MyStepRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, myvalue, linktxt, padroid, MyLookup.MyDocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID));
}
private void SaveROWithAnnotation_Click(object sender, EventArgs e)
{
@ -312,10 +312,10 @@ namespace Volian.Controls.Library
// the roid may be 12 or 16 chars long, with the last 4 set if there is unit specific
// menuing. Pad to 12 to store in the rousage table.
string padroid = (myroid.Length <= 12) ? myroid + "0000" : myroid;
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", padroid, MyLookup.DocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID);
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", padroid, MyLookup.MyDocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID);
// Resolve symbols and scientific notation in the RO return value
string valtxt = MyLookup.GetTranslatedRoValue(padroid, MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); //ConvertSymbolsAndStuff(selectedChld.value);
MyStepRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, myvalue, linktxt, padroid, MyLookup.DocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID));
MyStepRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, myvalue, linktxt, padroid, MyLookup.MyDocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID));
}
private void NoROFound_Click(object sender, EventArgs e)
{
@ -1747,7 +1747,7 @@ namespace Volian.Controls.Library
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
{
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo);
ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo, null);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST");
MyEditItem.MyStepPanel.OnTabDisplay(sender, args);

View File

@ -317,6 +317,12 @@ namespace Volian.Controls.Library
#endregion
public partial class vlnTreeView : TreeView
{
private int _OverrideDocVersionID = 0;
public int OverrideDocVersionID
{
get { return _OverrideDocVersionID; }
set { _OverrideDocVersionID = value; }
}
private SessionInfo _MySessionInfo;
public SessionInfo MySessionInfo
{
@ -1293,7 +1299,7 @@ namespace Volian.Controls.Library
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
{
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo);
ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo, OverrideDocVersionID > 0 ? DocVersionInfo.Get(OverrideDocVersionID) : null);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST");
}