/// <summary> Adds the child information to the item aggregation object from the datatable extracted from the database </summary>
        /// <param name="AggrInfo">Partially built item aggregation object</param>
        /// <param name="ChildInfo">Datatable from database calls with child item aggregation information ( either SobekCM_Get_Item_Aggregation or SobekCM_Get_All_Groups )</param>
        private static void add_children(Item_Aggregation AggrInfo, DataTable ChildInfo)
        {
            string childTypes = String.Empty;

            // Build a dictionary of nodes while building this tree
            Dictionary<string, Item_Aggregation_Related_Aggregations> nodes = new Dictionary<string, Item_Aggregation_Related_Aggregations>(ChildInfo.Rows.Count);

            // Step through each row of children
            foreach (DataRow thisRow in ChildInfo.Rows)
            {
                // pull some of the basic data out
                int hierarchyLevel = Convert.ToInt16(thisRow[5]);
                string code = thisRow[0].ToString().ToLower();
                string parentCode = thisRow[1].ToString().ToLower();

                // If this does not already exist, create it
                if (!nodes.ContainsKey(code))
                {
                    // Create the object
                    Item_Aggregation_Related_Aggregations childObject = new Item_Aggregation_Related_Aggregations(code, thisRow[2].ToString(), thisRow[4].ToString(), Convert.ToBoolean(thisRow[6]), Convert.ToBoolean(thisRow[7]));

                    // Add this object to the node dictionary
                    nodes.Add(code, childObject);

                    // If this is not ALL, no need to add the full hierarchy
                    if ((AggrInfo.Code == "all") || (hierarchyLevel == -1))
                    {
                        // Check for parent in the node list
                        if ((parentCode.Length > 0) && (AggrInfo.Code != parentCode) && (nodes.ContainsKey(parentCode)))
                        {
                            nodes[parentCode].Add_Child_Aggregation(childObject);
                        }
                    }

                    // If this is the first hierarchy, add to the main item aggregation object
                    if (hierarchyLevel == -1)
                    {
                        AggrInfo.Add_Child_Aggregation(childObject);

                        // If this is active and not hidden, check the type and save to list
                        if ((!childObject.Hidden) && (childObject.Active))
                        {
                            if (childTypes.Length == 0)
                                childTypes = childObject.Type + "s";
                            else if (childTypes != childObject.Type )
                                childTypes = "SubCollections";
                        }
                    }
                }
            }

            // Save the type for the child collections
            AggrInfo.Child_Types = childTypes;
        }
        /// <summary> Adds the child information to the item aggregation object from the datatable extracted from the database </summary>
        /// <param name="aggrInfo">Partially built item aggregation object</param>
        /// <param name="childInfo">Datatable from database calls with child item aggregation information ( either SobekCM_Get_Item_Aggregation or SobekCM_Get_All_Groups )</param>
        private static void add_children(Item_Aggregation aggrInfo, DataTable childInfo)
        {
            // Build a dictionary of nodes while building this tree
            Dictionary<string, Item_Aggregation_Related_Aggregations> nodes = new Dictionary<string, Item_Aggregation_Related_Aggregations>(childInfo.Rows.Count);

            // Step through each row of children
            foreach (DataRow thisRow in childInfo.Rows)
            {
                // pull some of the basic data out
                int hierarchyLevel = Convert.ToInt16(thisRow[5]);
                string code = thisRow[0].ToString().ToLower();
                string parentCode = thisRow[1].ToString().ToLower();

                // If this does not already exist, create it
                if (!nodes.ContainsKey(code))
                {
                    // Create the object
                    Item_Aggregation_Related_Aggregations childObject = new Item_Aggregation_Related_Aggregations(code, thisRow[2].ToString(), thisRow[4].ToString(), Convert.ToBoolean(thisRow[6]), Convert.ToBoolean(thisRow[7]));

                    // Add this object to the node dictionary
                    nodes.Add(code, childObject);

                    // If this is not ALL, no need to add the full hierarchy
                    if ((aggrInfo.Code == "all") || (hierarchyLevel == -1))
                    {
                        // Check for parent in the node list
                        if ((parentCode.Length > 0) && (aggrInfo.Code != parentCode) && (nodes.ContainsKey(parentCode)))
                        {
                            nodes[parentCode].Add_Child_Aggregation(childObject);
                        }
                    }

                    // If this is the first hierarchy, add to the main item aggregation object
                    if (hierarchyLevel == -1)
                    {
                        aggrInfo.Add_Child_Aggregation(childObject);
                    }
                }
            }
        }