public SubgroupValInfo()
 {
     this._Age = new SubgroupInfo();
     this._Location = new SubgroupInfo();
     this._Others = new SubgroupInfo();
     this._Sex = new SubgroupInfo();
 }
Example #2
0
        /// <summary>
        /// Get_Subgroup_Collection method..
        /// </summary>
        /// <param name="this._DSDStructure"></param>
        /// <returns></returns>
        private void Get_Subgroup()
        {
            //'Dictionary<string, int> RetVal = new Dictionary<string, int>();
            //DI6SubgroupBuilder BuilderObj = new DI6SubgroupBuilder(this.DBConnection, this.DBQueries);
            string Name            = string.Empty;
            string SubgroupTypeGID = string.Empty;
            string SubgroupGID     = string.Empty;
            string LanguageCode    = this._LanguageCode;
            int    NID             = 0;
            bool   ISGlobal        = false;
            string SubgroupDimID   = string.Empty;

            this.SubgroupDetails = new Dictionary <string, SubgroupInfo>();

            foreach (SDMXObjectModel.Structure.CodelistType CodeListObj in this._DSDStructure.Structures.Codelists)
            {
                if (CodeListObj.id == SDMXConstants.CodeList.SubgroupType.Id)
                {
                    foreach (SDMXObjectModel.Structure.CodeType IndCode in CodeListObj.Items)
                    {
                        SubgroupTypeGID = IndCode.id;
                        SubgroupDimID   = "CL_" + SubgroupTypeGID;

                        foreach (SDMXObjectModel.Structure.CodelistType SCodeListObj in this._DSDStructure.Structures.Codelists)
                        {
                            if (SCodeListObj.id == SubgroupDimID)
                            {
                                foreach (SDMXObjectModel.Structure.CodeType SGCode in SCodeListObj.Items)
                                {
                                    foreach (TextType IndTextType in SGCode.Name)
                                    {
                                        SubgroupGID = SGCode.id;
                                        Name        = string.Empty;
                                        ISGlobal    = false;
                                        if (IndTextType.lang.Trim('_') == this._LanguageCode)
                                        {
                                            Name = IndTextType.Value;
                                            break;
                                        }
                                    }

                                    foreach (AnnotationType AnnType in SGCode.Annotations)
                                    {
                                        if (AnnType.AnnotationTitle == SDMXConstants.Annotations.IsGlobal)
                                        {
                                            foreach (TextType AnnTextType in AnnType.AnnotationText)
                                            {
                                                ISGlobal = Convert.ToBoolean(AnnTextType.Value);
                                                break;
                                            }
                                        }
                                    }

                                    if (!this.SubgroupDetails.ContainsKey(SubgroupGID))
                                    {
                                        SubgroupInfo TableInfoObj = new SubgroupInfo();
                                        TableInfoObj.GID    = SubgroupGID;
                                        TableInfoObj.Name   = Name;
                                        TableInfoObj.Type   = GetSubgroupTypeByName(SubgroupTypeGID);
                                        TableInfoObj.Global = ISGlobal;
                                        this.SubgroupDetails.Add(SubgroupGID, TableInfoObj);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        /// Get_Subgroup_Collection method..
        /// </summary>
        /// <param name="this._DSDStructure"></param>
        /// <returns></returns>
        private void Get_Subgroup()
        {
            //'Dictionary<string, int> RetVal = new Dictionary<string, int>();
            //DI6SubgroupBuilder BuilderObj = new DI6SubgroupBuilder(this.DBConnection, this.DBQueries);
            string Name = string.Empty;
            string SubgroupTypeGID = string.Empty;
            string SubgroupGID = string.Empty;
            string LanguageCode = this._LanguageCode;
            int NID = 0;
            bool ISGlobal = false;
            string SubgroupDimID = string.Empty;
            this.SubgroupDetails = new Dictionary<string, SubgroupInfo>();

            foreach (SDMXObjectModel.Structure.CodelistType CodeListObj in this._DSDStructure.Structures.Codelists)
            {
                if (CodeListObj.id == SDMXConstants.CodeList.SubgroupType.Id)
                {
                    foreach (SDMXObjectModel.Structure.CodeType IndCode in CodeListObj.Items)
                    {
                        SubgroupTypeGID = IndCode.id;
                        SubgroupDimID = "CL_" + SubgroupTypeGID;

                        foreach (SDMXObjectModel.Structure.CodelistType SCodeListObj in this._DSDStructure.Structures.Codelists)
                        {
                            if (SCodeListObj.id == SubgroupDimID)
                            {
                                foreach (SDMXObjectModel.Structure.CodeType SGCode in SCodeListObj.Items)
                                {
                                    foreach (TextType IndTextType in SGCode.Name)
                                    {
                                        SubgroupGID = SGCode.id;
                                        Name = string.Empty;
                                        ISGlobal = false;
                                        if (IndTextType.lang.Trim('_') == this._LanguageCode)
                                        {
                                            Name = IndTextType.Value;
                                            break;
                                        }
                                    }

                                    foreach (AnnotationType AnnType in SGCode.Annotations)
                                    {
                                        if (AnnType.AnnotationTitle == SDMXConstants.Annotations.IsGlobal)
                                        {
                                            foreach (TextType AnnTextType in AnnType.AnnotationText)
                                            {
                                                ISGlobal = Convert.ToBoolean(AnnTextType.Value);
                                                break;
                                            }
                                        }
                                    }

                                    if (!this.SubgroupDetails.ContainsKey(SubgroupGID))
                                    {
                                        SubgroupInfo TableInfoObj = new SubgroupInfo();
                                        TableInfoObj.GID = SubgroupGID;
                                        TableInfoObj.Name = Name;
                                        TableInfoObj.Type = GetSubgroupTypeByName(SubgroupTypeGID);
                                        TableInfoObj.Global = ISGlobal;
                                        this.SubgroupDetails.Add(SubgroupGID, TableInfoObj);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }