private List<string> Get_ChildAttribute_CategoryGIds(ReportedAttributeType ReportedAttribute)
        {
            List<string> RetVal;

            RetVal = new List<string>();

            if (ReportedAttribute.AttributeSet != null && ReportedAttribute.AttributeSet.ReportedAttribute != null && ReportedAttribute.AttributeSet.ReportedAttribute.Count > 0)
            {
                foreach (ReportedAttributeType ChildReportedAttribute in ReportedAttribute.AttributeSet.ReportedAttribute)
                {
                    RetVal.Add(ChildReportedAttribute.id);
                    RetVal.AddRange(this.Get_ChildAttribute_CategoryGIds(ChildReportedAttribute));
                }
            }
            else
            {
                RetVal = new List<string>();
            }

            return RetVal;
        }
        private void Fill_AttributeSet_Structure(AttributeSetType AttributeSet, DataTable DtMetadataCategory)
        {
            ReportedAttributeType ReportedAttribute;
            DataRow[] ParentRows;
            string CategoryNId, CategoryGId;

            AttributeSet.ReportedAttribute = new List<ReportedAttributeType>();
            ParentRows = DtMetadataCategory.Select("ParentCategoryNId = -1", "CategoryOrder ASC");

            foreach (DataRow ParentRow in ParentRows)
            {
                CategoryNId = ParentRow["CategoryNId"].ToString();
                CategoryGId = ParentRow["CategoryGId"].ToString();

                ReportedAttribute = new ReportedAttributeType();
                ReportedAttribute.id = CategoryGId;
                ReportedAttribute.Annotations = null;

                this.Add_Children_Attributes(ReportedAttribute, CategoryNId, DtMetadataCategory);
                AttributeSet.ReportedAttribute.Add(ReportedAttribute);
            }
        }
        private void Fill_Children_Attribute_Values(ReportedAttributeType ReportedAttribute, Dictionary<string, string> DictCategoryGIdValue, string Language)
        {
            if (ReportedAttribute.AttributeSet != null && ReportedAttribute.AttributeSet.ReportedAttribute != null && ReportedAttribute.AttributeSet.ReportedAttribute.Count > 0)
            {
                foreach (ReportedAttributeType ChildReportedAttribute in ReportedAttribute.AttributeSet.ReportedAttribute)
                {
                    if (ChildReportedAttribute.Items == null)
                    {
                        ChildReportedAttribute.Items = new List<object>();
                    }
                    else if (ChildReportedAttribute.Items.Count == 0)
                    {
                        ChildReportedAttribute.Items = new List<object>();
                    }

                    if (DictCategoryGIdValue.ContainsKey(ChildReportedAttribute.id))
                    {
                        ChildReportedAttribute.Items.Add(new TextType(Language, DictCategoryGIdValue[ChildReportedAttribute.id]));
                    }

                    this.Fill_Children_Attribute_Values(ChildReportedAttribute, DictCategoryGIdValue, Language);
                }
            }
        }
        private void Add_Children_Attributes(ReportedAttributeType ReportedAttribute, string CategoryNId, DataTable DtMetadataCategory)
        {
            ReportedAttributeType ChildReportedAttribute;
            DataRow[] ChildRows;
            string ChildCategoryNId, ChildCategoryGId;

            ChildRows = DtMetadataCategory.Select("ParentCategoryNId = " + CategoryNId, "CategoryOrder ASC");

            if (ChildRows.Length > 0)
            {
                ReportedAttribute.AttributeSet = new AttributeSetType();
                ReportedAttribute.AttributeSet.ReportedAttribute = new List<ReportedAttributeType>();

                foreach (DataRow ChildRow in ChildRows)
                {
                    ChildCategoryNId = ChildRow["CategoryNId"].ToString();
                    ChildCategoryGId = ChildRow["CategoryGId"].ToString();

                    ChildReportedAttribute = new ReportedAttributeType();
                    ChildReportedAttribute.id = ChildCategoryGId;
                    ChildReportedAttribute.Annotations = null;

                    this.Add_Children_Attributes(ChildReportedAttribute, ChildCategoryNId, DtMetadataCategory);
                    ReportedAttribute.AttributeSet.ReportedAttribute.Add(ChildReportedAttribute);
                }
            }
            else
            {
                ReportedAttribute.AttributeSet = null;
            }
        }