Added code to handle Table ROs.
Used generic (static) VlnFlexGrid.ROTableUpdate to determine if the table contents are updated. Added Error Handling around the code that shuts down PROMs Added function to ROFSTLookup to retrieve the Accessory Page ID. Corrected code to handle value changes for Table ROs Created generic (static) VlnFlexGrid.ROTableUpdate to determine if the table contents are updated.
This commit is contained in:
@@ -161,6 +161,22 @@ namespace VEPROMS.CSLA.Library
|
||||
if (dicRos != null)dicRos.Clear();
|
||||
dicRos = null;
|
||||
}
|
||||
private Dictionary<string, string> _dicROAPIDLookup;
|
||||
public string GetAccPageID(string roid)
|
||||
{
|
||||
if(_dicROAPIDLookup==null)
|
||||
{
|
||||
_dicROAPIDLookup = new Dictionary<string,string>();
|
||||
if (_dicROAPID == null)
|
||||
BuildROAPIDDictionary();
|
||||
foreach (string appid in _dicROAPID.Keys)
|
||||
_dicROAPIDLookup.Add(_dicROAPID[appid].roid,appid);
|
||||
}
|
||||
String roidkey = roid.Substring(0, 12).ToUpper();
|
||||
if(_dicROAPIDLookup.ContainsKey(roidkey))
|
||||
return _dicROAPIDLookup[roidkey];
|
||||
return null;
|
||||
}
|
||||
public List<string> GetValueDifferences(ROFSTLookup origROFst, ref List<string> delList)
|
||||
{
|
||||
// use this list to see what differences are between it and the original
|
||||
|
@@ -1550,12 +1550,12 @@ namespace VEPROMS.CSLA.Library
|
||||
if (InfoRestored != null)
|
||||
InfoRestored(this);
|
||||
}
|
||||
public ItemInfo RestoreSibling(ItemAuditInfo iai)
|
||||
public ItemInfo RestoreSibling(ItemAuditInfo iai,ROFstInfo myRoFst)
|
||||
{
|
||||
if (iai.DeleteStatus == 0)
|
||||
return null;
|
||||
int nextID = iai.Level == 0 ? ItemID : NextItem == null ? 0 : NextItem.ItemID;
|
||||
ItemInfo tmp = RestoreItem(iai);
|
||||
ItemInfo tmp = RestoreItem(iai, myRoFst);
|
||||
if(nextID > 0)
|
||||
using (Item item = Item.Get(nextID)) ItemInfo.Refresh(item);
|
||||
if (iai.Level == 0)
|
||||
@@ -1567,7 +1567,7 @@ namespace VEPROMS.CSLA.Library
|
||||
tmp.OnInfoRestored(tmp);
|
||||
return tmp;
|
||||
}
|
||||
public ItemInfo RestoreItem(ItemAuditInfo iai)
|
||||
public ItemInfo RestoreItem(ItemAuditInfo iai, ROFstInfo myRoFst)
|
||||
{
|
||||
ItemInfo tmp2 = null;
|
||||
try
|
||||
@@ -1606,15 +1606,15 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
if (cont.ContentRoUsageCount > 0)
|
||||
{
|
||||
ROFstInfo myrofst = tmp.MyContent.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup mylookup = myrofst.GetROFSTLookup(tmp.MyContent.ContentItems[0].MyProcedure.MyDocVersion);
|
||||
//ROFstInfo myrofst = tmp.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup mylookup = myRoFst.GetROFSTLookup(tmp.MyContent.ContentItems[0].MyProcedure.MyDocVersion);
|
||||
foreach (ContentRoUsage ro in cont.ContentRoUsages)
|
||||
{
|
||||
RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID);
|
||||
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);
|
||||
cont.FixContentText(rou, myvalue, mytype, myRoFst);
|
||||
}
|
||||
Content cctmp = cont;
|
||||
if (cont.IsDirty)
|
||||
@@ -1770,7 +1770,7 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
public partial class ContentInfo
|
||||
{
|
||||
public static ContentInfo RestoreContent(ContentAuditInfo cai)
|
||||
public static ContentInfo RestoreContent(ContentAuditInfo cai,ROFstInfo myRoFst)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1800,14 +1800,14 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
ctmp.Save();
|
||||
}
|
||||
ROFstInfo myrofst = tmp.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup mylookup = myrofst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion);
|
||||
//ROFstInfo myrofst = tmp.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup mylookup = myRoFst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion);
|
||||
foreach(RoUsageInfo rou in tmp.ContentRoUsages)
|
||||
{
|
||||
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);
|
||||
ctmp.FixContentText(rou, myvalue, mytype, myRoFst);
|
||||
}
|
||||
Content cctmp = ctmp;
|
||||
if (ctmp.IsDirty)
|
||||
|
@@ -79,9 +79,17 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
if (rotype == (int)E_ROValueType.Table) // if change in rotable data...
|
||||
{
|
||||
List<string> retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data));
|
||||
if (Text != retlist[0]) Text = retlist[0];
|
||||
if (MyGrid.Data != retlist[1]) MyGrid.Data = retlist[1];
|
||||
if (origROFstInfo != null)
|
||||
{
|
||||
List<string> retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data));
|
||||
if (MyGrid.Data != retlist[1])
|
||||
{
|
||||
MyGrid.Data = retlist[1];
|
||||
retval = Text;
|
||||
if (Text != retlist[0])
|
||||
Text = retlist[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user