diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 38495246..eae53a15 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -61,6 +61,23 @@ namespace VEPROMS.CSLA.Library public string value; public rochild[] children; }; + public class roChild + { + rochild _MyChild; + public rochild MyChild + { + get { return _MyChild; } + set { _MyChild = value; } + } + public roChild(rochild myChild) + { + _MyChild = myChild; + } + public override string ToString() + { + return _MyChild.title; + } + }; #endregion #region Local Data private string _ROValue = ""; @@ -595,7 +612,38 @@ namespace VEPROMS.CSLA.Library } return rtnstr; } - + private Dictionary> _ValueLookupDictionary = null; + public List GetRosByValue(string value) + { + if (_ValueLookupDictionary == null) + BuildValueDictionary(); + if (value == string.Empty) + return null; + if(_ValueLookupDictionary.ContainsKey(value.ToUpper())) + return _ValueLookupDictionary[value.ToUpper()]; + return null; + } + private void BuildValueDictionary() + { + _ValueLookupDictionary = new Dictionary>(); + if (dicRos == null) + ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); + foreach (rochild child in dicRos.Values) + { + if (child.value != null) + { + string value = child.value.ToUpper(); + if (_ValueLookupDictionary.ContainsKey(value)) + _ValueLookupDictionary[value].Add(new roChild(child)); + else + { + List children = new List(); + children.Add(new roChild(child)); + _ValueLookupDictionary.Add(value, children); + } + } + } + } private void ProcessMultiReturnValues(string str, int len) { string tstr = str.Substring(0, len);