Created
March 21, 2011 14:11
-
-
Save thinkt4nk/879498 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Dictionary<string,Object> getChildrenRecursive() | |
{ | |
Dictionary<string,Object> categoryDictionary = new Dictionary<string, Object>(); | |
Dictionary<string, Object>[] children; | |
if (this.hasChildren()) | |
{ | |
// Get child nodes | |
Duke.CategoryDataTable ChildTable = this.CategoryAdapter.GetAllByParentCategory(categoryCode); | |
children = new Dictionary<string, Object>[ChildTable.Rows.Count]; | |
for (int i = 0; i < ChildTable.Rows.Count; i++) | |
{ | |
BAL.Category ChildCategory = new BAL.Category((String)ChildTable.Rows[i]["categoryCode"]); | |
children[i] = ChildCategory.getChildrenRecursive(); | |
} | |
} | |
else | |
{ | |
children = new Dictionary<string, Object>[0]; | |
} | |
categoryDictionary.Add(this.categoryCode,children); | |
return categoryDictionary; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment