From 9909dcecf92741de668fb9768894c226917db020 Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 9 Nov 2009 20:22:00 +0000 Subject: [PATCH] Added code to retrieve RO values for MSWord --- .../Config/ROFSTLookup.cs | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) 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);