diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index dbcb0e2d..d7c04497 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -664,6 +664,45 @@ namespace VEPROMS.CSLA.Library } } } + private Dictionary _dicROAPID = null; + public string GetROValueByAccPagID(string accPageID, string spDefault, string igDefault) + { + rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault); + if (child != null) return ((rochild)child).value; + return null; + } + public rochild? GetRoChildByAccPagID(string accPageID, string spDefault, string igDefault) + { + if (_dicROAPID == null) + BuildROAPIDDictionary(); + accPageID = accPageID.Replace("".ToCharArray()); // String < and > + if (_dicROAPID.ContainsKey(accPageID)) + return _dicROAPID[accPageID]; + return null; + } + private void BuildROAPIDDictionary() + { + if (dicRos == null) + ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); + _dicROAPID = new Dictionary(); + foreach (rodbi dbi in myHdr.myDbs) + { + if (dbi.children != null) + BuildROAPIDDictionary(dbi.dbiAP, dbi.children); + } + } + private void BuildROAPIDDictionary(string prefix, rochild[] children) + { + foreach (rochild child in children) + { + if (child.appid != null) + _dicROAPID.Add(string.Format("{0}-{1}", prefix, child.appid), child); + if (child.children != null) + BuildROAPIDDictionary(prefix, child.children); + } + } private void ProcessMultiReturnValues(string str, int len) { string tstr = str.Substring(0, len);