Example #1
0
        /// <summary>
        /// Get_Unit_Collection method..
        /// </summary>
        /// <param name="this._DSDStructure"></param>
        /// <returns></returns>
        private void Get_Units()
        {
            //Dictionary<string, int> RetVal = new Dictionary<string, int>();

            string Name = string.Empty;
            string GID = string.Empty;
            string LanguageCode = this._LanguageCode;
            int NID = 0;
            bool UnitGlobal = false;

            this.UnitDetails = new Dictionary<string, CommonInfo>();

            foreach (SDMXObjectModel.Structure.CodelistType CodeListObj in this._DSDStructure.Structures.Codelists)
            {
                if (CodeListObj.id == SDMXConstants.CodeList.Unit.Id)
                {
                    foreach (SDMXObjectModel.Structure.CodeType IndCode in CodeListObj.Items)
                    {
                        GID = IndCode.id;
                        Name = string.Empty;
                        UnitGlobal = false;
                        foreach (TextType IndTextType in IndCode.Name)
                        {
                            if (IndTextType.lang.Trim('_') == this._LanguageCode)
                            {
                                Name = IndTextType.Value;
                                break;
                            }
                        }

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

                        //  SDMXUtility.Raise_Set_Process_Name_Event(IndicatorName, IndicatorGID, 0);

                        if (!UnitDetails.ContainsKey(GID))
                        {
                            CommonInfo TableInfoObj = new CommonInfo();
                            TableInfoObj.GID = GID;
                            TableInfoObj.Name = Name;
                            TableInfoObj.Global = UnitGlobal;
                            UnitDetails.Add(GID, TableInfoObj);
                        }
                    }
                }
            }

            //return RetVal;
        }
Example #2
0
        private void Get_Source()
        {
            //'Dictionary<string, int> RetVal = new Dictionary<string, int>();
            SourceBuilder SrcBuilderObj = null;
            string Name = string.Empty;
            string GID = string.Empty;
            string LanguageCode = this._LanguageCode;
            int NID = 0;
            string ParentID = string.Empty;
            ICType icICType = ICType.Sector;
            this.SourceDetails = new Dictionary<string, CommonInfo>();
            //SrcBuilderObj = new SourceBuilder(this.DBConnection, this.DBQueries);

            foreach (SDMXObjectModel.Structure.CategorySchemeType CodeListObj in this._DSDStructure.Structures.CategorySchemes)
            {
                icICType = (ICType)DIQueries.ICTypeText.Values.IndexOf("'" + CodeListObj.id.Substring(3) + "'");

                if (icICType == ICType.Source)
                {
                    foreach (SDMXObjectModel.Structure.CategoryType CatTypeCode in CodeListObj.Items)
                    {
                        GID = CatTypeCode.id;
                        string ParentName = string.Empty;

                        foreach (TextType IndTextType in CatTypeCode.Name)
                        {
                            if (IndTextType.lang.Trim('_') == this._LanguageCode)
                            {
                                ParentName = IndTextType.Value;
                            }

                        }

                        foreach (SDMXObjectModel.Structure.CategoryType SubCatTypeCode in CatTypeCode.Items)
                        {
                            GID = CatTypeCode.id;
                            Name = string.Empty;

                            foreach (TextType IndTextType in SubCatTypeCode.Name)
                            {
                                if (IndTextType.lang.Trim('_') == this._LanguageCode)
                                {
                                    Name = IndTextType.Value;
                                    break;
                                }
                            }
                        }
                        ParentID = "-1";

                        //NID = SrcBuilderObj.CheckNCreateSource(Name);

                        //if (!RetVal.ContainsKey(GID) && NID > 0)
                        //{
                        //    RetVal.Add(GID, NID);
                        //}

                        if (!this.SourceDetails.ContainsKey(Name))
                        {
                            CommonInfo TableInfoObj = new CommonInfo();
                            TableInfoObj.GID = GID;
                            TableInfoObj.Name = Name;
                            this.SourceDetails.Add(Name, TableInfoObj);
                        }
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        /// Get_SubgroupType_Collection method..
        /// </summary>
        /// <param name="this._DSDStructure"></param>
        /// <returns></returns>
        private void Get_SubgroupType()
        {
            //'Dictionary<string, int> RetVal = new Dictionary<string, int>();
            //  DI6SubgroupTypeBuilder BuilderObj = new DI6SubgroupTypeBuilder(this.DBConnection, this.DBQueries);
            string Name = string.Empty;
            string GID = string.Empty;
            string LanguageCode = this._LanguageCode;
            int NID = 0;
            bool ISGlobal = false;
            this.SubgroupTypeDetails = new Dictionary<string, CommonInfo>();

            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)
                    {
                        GID = IndCode.id;
                        Name = string.Empty;
                        ISGlobal = false;
                        foreach (TextType IndTextType in IndCode.Name)
                        {
                            if (IndTextType.lang.Trim('_') == this._LanguageCode)
                            {
                                Name = IndTextType.Value;
                                break;
                            }
                        }

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

                        if (!this.SubgroupTypeDetails.ContainsKey(GID))
                        {
                            CommonInfo TableInfoObj = new CommonInfo();
                            TableInfoObj.GID = GID;
                            TableInfoObj.Name = Name;
                            TableInfoObj.Global = ISGlobal;
                            this.SubgroupTypeDetails.Add(GID, TableInfoObj);
                        }
                    }
                }
            }

            //  return RetVal;
        }
Example #4
0
        /// <summary>
        /// Get_Indicator_Collection method..
        /// </summary>
        /// <param name="this._DSDStructure"></param>
        /// <returns></returns>
        private void Get_Indicators()
        {
            //'Dictionary<string, int> RetVal = new Dictionary<string, int>();
            string IndicatorName = string.Empty;
            string IndicatorGID = string.Empty;
            //string LanguageCode = this._LanguageCode;
            int IndicatorNID = 0;
            bool IndicatorGlobal = false;

            IndicatorDetails = new Dictionary<string, CommonInfo>();

            foreach (SDMXObjectModel.Structure.CodelistType CodeListObj in this._DSDStructure.Structures.Codelists)
            {
                if (CodeListObj.id == SDMXConstants.CodeList.Indicator.Id)
                {
                    foreach (SDMXObjectModel.Structure.CodeType IndCode in CodeListObj.Items)
                    {
                        IndicatorGID = IndCode.id;
                        IndicatorName = string.Empty;
                        IndicatorGlobal = false;
                        foreach (TextType IndTextType in IndCode.Name)
                        {
                            if (IndTextType.lang.Trim('_') == this._LanguageCode)
                            {
                                IndicatorName = IndTextType.Value;
                                break;
                            }
                        }

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

                        if (!IndicatorDetails.ContainsKey(IndicatorGID))
                        {
                            CommonInfo TableInfoObj = new CommonInfo();
                            TableInfoObj.GID = IndicatorGID;
                            TableInfoObj.Name = IndicatorName;
                            TableInfoObj.Global = IndicatorGlobal;
                            IndicatorDetails.Add(IndicatorGID, TableInfoObj);
                        }
                    }
                }
            }

            // return RetVal;
        }