private ArtefactInfo Generate_DSD_ConceptScheme()
        {
            ArtefactInfo RetVal;
            ConceptSchemeType ConceptScheme;
            ConceptType Concept;
            string ConceptId, ConceptName, ConceptDescription;
            DataTable DtSubgroupType;
            DIQueries DIQueriesLanguage;

            RetVal = null;

            try
            {
                ConceptScheme = new ConceptSchemeType(Constants.ConceptScheme.DSD.Id, this.AgencyId, Constants.ConceptScheme.DSD.Version, Constants.ConceptScheme.DSD.Name, Constants.ConceptScheme.DSD.Description, Constants.DefaultLanguage, null);

                Concept = new ConceptType(Constants.Concept.TIME_PERIOD.Id, Constants.Concept.TIME_PERIOD.Name, Constants.Concept.TIME_PERIOD.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.OBS_VALUE.Id, Constants.Concept.OBS_VALUE.Name, Constants.Concept.OBS_VALUE.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.AREA.Id, Constants.Concept.AREA.Name, Constants.Concept.AREA.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.INDICATOR.Id, Constants.Concept.INDICATOR.Name, Constants.Concept.INDICATOR.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.UNIT.Id, Constants.Concept.UNIT.Name, Constants.Concept.UNIT.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.PERIODICITY.Id, Constants.Concept.PERIODICITY.Name, Constants.Concept.PERIODICITY.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.SOURCE.Id, Constants.Concept.SOURCE.Name, Constants.Concept.SOURCE.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.NATURE.Id, Constants.Concept.NATURE.Name, Constants.Concept.NATURE.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.DENOMINATOR.Id, Constants.Concept.DENOMINATOR.Name, Constants.Concept.DENOMINATOR.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.FOOTNOTES.Id, Constants.Concept.FOOTNOTES.Name, Constants.Concept.FOOTNOTES.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.CONFIDENCE_INTERVAL_UPPER.Id, Constants.Concept.CONFIDENCE_INTERVAL_UPPER.Name, Constants.Concept.CONFIDENCE_INTERVAL_UPPER.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                Concept = new ConceptType(Constants.Concept.CONFIDENCE_INTERVAL_LOWER.Id, Constants.Concept.CONFIDENCE_INTERVAL_LOWER.Name, Constants.Concept.CONFIDENCE_INTERVAL_LOWER.Description, Constants.DefaultLanguage, string.Empty, null);
                ConceptScheme.Items.Add(Concept);

                DIQueriesLanguage = new DIQueries(this.DIQueries.DataPrefix, this.Language);
                DtSubgroupType = this.DIConnection.ExecuteDataTable(DIQueriesLanguage.SubgroupTypes.GetSubgroupTypes(FilterFieldType.None, string.Empty));
                foreach (DataRow DrSubgroupType in DtSubgroupType.Rows)
                {
                    ConceptId = DrSubgroupType[SubgroupTypes.SubgroupTypeGID].ToString();
                    ConceptName = DrSubgroupType[SubgroupTypes.SubgroupTypeName].ToString();

                    switch (ConceptId)
                    {
                        case Constants.Concept.SUBGROUP.AGE.Id:
                            ConceptDescription = Constants.Concept.SUBGROUP.AGE.Description;
                            break;
                        case Constants.Concept.SUBGROUP.SEX.Id:
                            ConceptDescription = Constants.Concept.SUBGROUP.SEX.Description;
                            break;
                        case Constants.Concept.SUBGROUP.LOCATION.Id:
                            ConceptDescription = Constants.Concept.SUBGROUP.LOCATION.Description;
                            break;
                        default:
                            ConceptDescription = Constants.Concept.SUBGROUP.Description;
                            break;
                    }

                    Concept = new ConceptType(ConceptId, ConceptName, ConceptDescription, this.Language, string.Empty, null);
                    ConceptScheme.Items.Add(Concept);
                }

                RetVal = this.Prepare_ArtefactInfo_From_ConceptScheme(ConceptScheme, Constants.ConceptScheme.DSD.FileName);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }

            return RetVal;
        }
        private void Handle_All_Languages(ConceptType Concept, string CategoryGId)
        {
            DataTable DtTable;
            string Query, Language;

            Query = string.Empty;

            if (this._multiLanguageHandlingRequired)
            {
                foreach (DataRow LanguageRow in this.DIConnection.DILanguages(this.DIQueries.DataPrefix).Rows)
                {
                    Language = LanguageRow[DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Language.LanguageCode].ToString();
                    if (Language != this.Language)
                    {
                        if (!string.IsNullOrEmpty(CategoryGId))
                        {
                            Query = "SELECT * FROM UT_Metadata_Category_" + Language + " WHERE CategoryGId = '" + CategoryGId + "'";
                            DtTable = this.DIConnection.ExecuteDataTable(Regex.Replace(Query, "UT_", this._diConnection.DIDataSetDefault(), RegexOptions.IgnoreCase));

                            if (DtTable != null && DtTable.Rows.Count > 0)
                            {
                                Concept.Name.Add(new SDMXObjectModel.Common.TextType(Language, DtTable.Rows[0]["CategoryName"].ToString()));
                                Concept.Description.Add(new SDMXObjectModel.Common.TextType(Language, DtTable.Rows[0]["CategoryDescription"].ToString()));
                            }
                        }
                    }
                }
            }
        }
        private void Fill_ConceptScheme(ConceptSchemeType ConceptScheme, DataTable DtMetadataCategory)
        {
            ConceptType Concept;
            string CategoryGId, CategoryName, CategoryDescription, ParentCategoryNId, ParentCategoryGId;

            Concept = null;
            CategoryGId = string.Empty;
            CategoryName = string.Empty;
            CategoryDescription = string.Empty;
            ParentCategoryNId = string.Empty;
            ParentCategoryGId = string.Empty;

            foreach (DataRow DrMetadataCategory in DtMetadataCategory.Rows)
            {
                CategoryGId = DrMetadataCategory["CategoryGId"].ToString();
                CategoryName = DrMetadataCategory["CategoryName"].ToString();
                CategoryDescription = DrMetadataCategory["CategoryDescription"].ToString();
                ParentCategoryNId = DrMetadataCategory["ParentCategoryNId"].ToString();
                ParentCategoryGId = this.Get_ParentCategoryGId(ParentCategoryNId, DtMetadataCategory);

                Concept = new ConceptType(CategoryGId, CategoryName, CategoryDescription, this.Language, ParentCategoryGId, null);
                this.Handle_All_Languages(Concept, CategoryGId);
                ConceptScheme.Items.Add(Concept);
            }
        }