diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs index 0e535696..ebf86b70 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs @@ -75,6 +75,7 @@ namespace VEPROMS.CSLA.Library private int TableID; private string fstPath; private HybridDictionary dicRos; + private HybridDictionary dicRosIntIDs; public ROFST(string path) { @@ -85,12 +86,15 @@ namespace VEPROMS.CSLA.Library return; } dicRos = new HybridDictionary(); + dicRosIntIDs = new HybridDictionary(); ParseIntoDictionary(); } public void Close() { // remove the dictionary + dicRosIntIDs.Clear(); + dicRosIntIDs = null; dicRos.Clear(); dicRos = null; } @@ -107,7 +111,30 @@ namespace VEPROMS.CSLA.Library } return null; } - + public rochild GetRoChild(string ROID) + { + // Use the ROID to get the value from the dictionary + if (dicRos.Contains(ROID)) + { + rochild rochld = (rochild)dicRos[ROID]; + return rochld; + } + rochild tmp = new rochild(); + tmp.ID = -1; + return tmp; + } + public rochild GetRoChildFromID(int id) + { + // Use the id to get the value from the dictionary + if (dicRosIntIDs.Contains(id)) + { + rochild rochld = (rochild)dicRosIntIDs[id]; + return rochld; + } + rochild tmp = new rochild(); + tmp.ID = -1; + return tmp; + } public rodbi[] GetRODatabaseList() { return myHdr.myDbs; @@ -146,6 +173,7 @@ namespace VEPROMS.CSLA.Library tmp.appid = tmpg.appid; tmp.roid = TableID.ToString("X4") + tmp.ID.ToString("X8"); dicRos.Add(tmp.roid, tmp); + if (!dicRosIntIDs.Contains(tmp.ID)) dicRosIntIDs.Add(tmp.ID, tmp); int j; for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--) {