Added lookup by value
This commit is contained in:
parent
a646c399a3
commit
52b74f47ed
@ -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<string, List<roChild>> _ValueLookupDictionary = null;
|
||||
public List<roChild> 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<string, List<roChild>>();
|
||||
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<roChild> children = new List<roChild>();
|
||||
children.Add(new roChild(child));
|
||||
_ValueLookupDictionary.Add(value, children);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ProcessMultiReturnValues(string str, int len)
|
||||
{
|
||||
string tstr = str.Substring(0, len);
|
||||
|
Loading…
x
Reference in New Issue
Block a user