From 0cb99bcf5e9939370d9d3a733aace6afd7f54f55 Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 7 Dec 2009 15:53:16 +0000 Subject: [PATCH] Added code to get ROs by AccPageID and GetChildren by ROType --- .../Config/ROFSTLookup.cs | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index d7c04497..0540dbf1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -671,6 +671,12 @@ namespace VEPROMS.CSLA.Library if (child != null) return ((rochild)child).value; return null; } + public int? GetROTypeByAccPagID(string accPageID, string spDefault, string igDefault) + { + rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault); + if (child != null) return ((rochild)child).type; + return null; + } public rochild? GetRoChildByAccPagID(string accPageID, string spDefault, string igDefault) { if (_dicROAPID == null) @@ -743,7 +749,30 @@ namespace VEPROMS.CSLA.Library idx = str.IndexOfAny(delim.ToCharArray()); return idx; } - + public List GetRoChildrenByType(int type) + { + List children = new List(); + AddRoChildByType(children, type); + return children; + } + private void AddRoChildByType(List children, int type) + { + foreach (rodbi dbi in myHdr.myDbs) + { + if (dbi.children != null) + AddRoChildByType(dbi.children,children,type); + } + } + private void AddRoChildByType(rochild[] roChildren, List children, int type) + { + foreach (rochild child in roChildren) + { + if (child.type == type && child.value != null) + children.Add(child); + if (child.children != null) + AddRoChildByType(child.children,children,type); + } + } #endregion } }