Added code to retrieve RO values for MSWord
This commit is contained in:
parent
36e4a5ee44
commit
9909dcecf9
@ -664,6 +664,45 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
private Dictionary<string, rochild> _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("<SP-", "<" + spDefault + "-");
|
||||
accPageID = accPageID.Replace("<IG-", "<" + igDefault + "-");
|
||||
accPageID = accPageID.Trim("<>".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<string, rochild>();
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user