private bool CreateCodelistsForUploadedDSD(SDMXApi_2_0.Message.StructureType UploadedDSDStructure, string CodelistsFolderPath, int DbNId)
    {
        bool RetVal;
        SDMXApi_2_0.Message.StructureType CodelistStructure;
        int CodelistIndex;
        string CodelistName;
        string CodelistId;
        string CodelistAgencyId;
        string CodelistVersion;

        RetVal = true;
        CodelistIndex = 0;
        CodelistName = string.Empty;
        CodelistId = string.Empty;
        CodelistAgencyId = string.Empty;
        CodelistVersion = string.Empty;
        try
        {
            foreach (SDMXApi_2_0.Structure.CodeListType CodeList in UploadedDSDStructure.CodeLists)
            {
                CodelistStructure = new SDMXApi_2_0.Message.StructureType();
                CodelistStructure.CodeLists = new List<SDMXApi_2_0.Structure.CodeListType>();
                CodelistStructure.CodeLists.Add(UploadedDSDStructure.CodeLists[CodelistIndex]);
                CodelistId = UploadedDSDStructure.CodeLists[CodelistIndex].id;
                CodelistAgencyId = UploadedDSDStructure.CodeLists[CodelistIndex].agencyID;
                CodelistVersion = UploadedDSDStructure.CodeLists[CodelistIndex].version;
                CodelistName = UploadedDSDStructure.CodeLists[CodelistIndex].Name[0].Value.ToString();

                CodelistStructure.Header = UploadedDSDStructure.Header;
                CodelistStructure.OrganisationSchemes = null;
                CodelistStructure.HierarchicalCodelists = null;
                CodelistStructure.Concepts = null;
                CodelistStructure.Metadataflows = null;
                CodelistStructure.MetadataStructureDefinitions = null;
                CodelistStructure.Processes = null;
                CodelistStructure.ReportingTaxonomies = null;
                CodelistStructure.StructureSets = null;
                CodelistStructure.CategorySchemes = null;
                CodelistStructure.KeyFamilies = null;
                CodelistStructure.Dataflows = null;

                SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), CodelistStructure, CodelistsFolderPath + "\\" + CodelistName + ".xml");
                this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, CodelistId, CodelistAgencyId, CodelistVersion, string.Empty, ArtefactTypes.CL, CodelistsFolderPath + "\\" + CodelistName + ".xml", CodelistName + ".xml");

                CodelistIndex = CodelistIndex + 1;

            }

        }
        catch (Exception ex)
        {
            //Global.WriteErrorsInLog("Creating Codelists For Uploaded DSD from Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);
            RetVal = false;
            Global.CreateExceptionString(ex, null);
        }
        finally
        {

        }

        return RetVal;
    }
    private static Dictionary<string, string> Validate_Obs(SDMXApi_2_0.CompactData.ObsType Obs, List<string> ListNature, List<string> ListUnitMult)
    {
        Dictionary<string, string> RetVal;
        string ObsNature = string.Empty;
        string ObsUnitMult = string.Empty;
        int AttributeCounter = 0;

        RetVal = new Dictionary<string, string>();
        while (AttributeCounter < Obs.AnyAttr.Count)
        {
            if (!((Obs.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Nature.Id) || (Obs.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.UnitMult.Id) || (Obs.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.TimePeriod.Id) || (Obs.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.ObsVal.Id) || (Obs.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.TimeDetail.Id) || (Obs.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.SourceDetail.Id) || (Obs.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Footnotes.Id)))
            {
                RetVal.Add(SDMXValidationStatus.Dimension_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Dimension + Obs.AnyAttr[AttributeCounter].Name);
                break;
            }
            else
            {
                switch (Obs.AnyAttr[AttributeCounter].Name)
                {
                    case Constants.UNSD.Concept.Nature.Id:
                        ObsNature = Obs.AnyAttr[AttributeCounter].Value;
                        break;
                    case Constants.UNSD.Concept.UnitMult.Id:
                        ObsUnitMult = Obs.AnyAttr[AttributeCounter].Value;
                        break;
                    default:
                        break;
                }
            }

            AttributeCounter = AttributeCounter + 1;
        }
        if (RetVal.Keys.Count == 0)
        {
            if (!ListNature.Contains(ObsNature))
            {
                RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + ObsNature);
            }
        }

        if (RetVal.Keys.Count == 0)
        {
            if (!ListUnitMult.Contains(ObsUnitMult))
            {
                RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + ObsUnitMult);
            }
        }

        return RetVal;
    }
    private bool CreateCategorySchemeForUploadedDSD(SDMXApi_2_0.Message.StructureType UploadedDSDStructure, string sdmxFolderPath, int DbNId, int AssociatedDbNId, string UserNId)
    {
        bool RetVal;
        RetVal = true;
        string AgencyId, Language, OutputFolder;
        DIConnection DIConnection;
        DIQueries DIQueries;
        List<ArtefactInfo> Artefacts;
        Dictionary<string, string> DictIndicator, DictIndicatorMapping;

        DIConnection = Global.GetDbConnection(AssociatedDbNId);
        DIQueries = new DIQueries(DIConnection.DIDataSetDefault(), DIConnection.DILanguageCodeDefault(DIConnection.DIDataSetDefault()));
        OutputFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId.ToString() + "\\sdmx");
        Language = DIConnection.DILanguageCodeDefault(DIConnection.DIDataSetDefault()).Substring(1);
        AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + UserNId;

        try
        {
            DictIndicator = RegTwoZeroFunctionality.Get_Indicator_GIds(Path.Combine(OutputFolder, "Complete.xml"));
            DictIndicatorMapping = RegTwoZeroFunctionality.Get_Indicator_Mapping_Dict(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId.ToString() + Constants.FolderName.SDMX.Mapping + DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.FileName), Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId.ToString() + Constants.FolderName.SDMX.Mapping + "IUSMapping.xml"));

            Artefacts = SDMXUtility.Generate_CategoryScheme(SDMXSchemaType.Two_One, CategorySchemeTypes.ALL, AgencyId, Language, null, Path.Combine(OutputFolder, "Categories"), DictIndicator, DictIndicatorMapping, DIConnection, DIQueries);

            this.Save_Artefacts_Details_In_Database(Artefacts, DbNId);
        }
        catch (Exception ex)
        {
            RetVal = false;
            Global.CreateExceptionString(ex, null);
            //Global.WriteErrorsInLog("Creating CategoryScheme For Uploaded DSD From Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);
        }
        finally
        {

        }

        return RetVal;
    }
    private bool UpdateArtefactsForUploadedDSDWithHeader(SDMXApi_2_0.Message.HeaderType Header, string DbNId, string UserNId, string sdmxFolderPath, string DatabaseNIDVersion2_1)
    {
        bool RetVal;
        SDMXApi_2_0.Message.StructureType DSD;
        SDMXApi_2_0.Message.StructureType MSD;
        SDMXApi_2_0.Message.StructureType MSDConcepts;
        SDMXApi_2_0.Message.StructureType Summary;
        string AgencyId, AgencyName, Language, MFDDFolderPathInMetadataFolder;
        string AppPhysicalPath;
        string SummaryFile;
        string DSDFile;
        string DbFolder;
        string ConsumerFileName, ProviderFileName;
        string ConceptSchemeFolder;
        string MSDFolder;

        string[] conceptSchemes;
        string[] MSDS;
        RetVal = true;
        AgencyId = string.Empty;
        AgencyName = string.Empty;
        Language = string.Empty;
        MFDDFolderPathInMetadataFolder = string.Empty;
        ConsumerFileName = string.Empty;
        ProviderFileName = string.Empty;
        ConceptSchemeFolder = string.Empty;
        MSDFolder = string.Empty;

        try
        {

            AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + UserNId;
            AgencyName = Global.GetDbDetails(DbNId.ToString(), Language)[0];
            AppPhysicalPath = HttpContext.Current.Request.PhysicalApplicationPath;
            DbFolder = Constants.FolderName.Data + DbNId.ToString() + "\\";

            DSD = new SDMXApi_2_0.Message.StructureType();
            DSDFile = sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.DSD.FileName;
            DSD = (SDMXApi_2_0.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), DSDFile);
            DSD.Header = Header;
            DSD.OrganisationSchemes = null;
            DSD.HierarchicalCodelists = null;
            DSD.Concepts = null;
            DSD.Metadataflows = null;
            DSD.MetadataStructureDefinitions = null;
            DSD.Processes = null;
            DSD.ReportingTaxonomies = null;
            DSD.StructureSets = null;
            DSD.CategorySchemes = null;
            DSD.CodeLists = null;
            DSD.Dataflows = null;

            Remove_Extra_Annotations(DSD);
            //Creating DSD and saving its information in the Database.mdb
            SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), DSD, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.DSD.FileName);

            SummaryFile = sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Summary_XML.FileName;
            Summary = new SDMXApi_2_0.Message.StructureType();
            Summary = (SDMXApi_2_0.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), SummaryFile);

            ConceptSchemeFolder = sdmxFolderPath + "/" + "Concepts";
            MSDFolder = sdmxFolderPath + "/" + "MSD";
            Summary.Header = Header;
            Summary.OrganisationSchemes = null;
            Summary.HierarchicalCodelists = null;
            Summary.Metadataflows = null;
            Summary.Processes = null;
            Summary.ReportingTaxonomies = null;
            Summary.StructureSets = null;
            Summary.CategorySchemes = null;
            Summary.Dataflows = null;

            //Creating Summary file and saving its information in the Database.mdb
            SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), Summary, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Summary_XML.FileName);

            MSDS = Directory.GetFiles(MSDFolder);
            foreach (string msdfile in MSDS)
            {
                MSD = new SDMXApi_2_0.Message.StructureType();
                MSD = (SDMXApi_2_0.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), msdfile);
                MSD.Header = Header;
                MSD.OrganisationSchemes = null;
                MSD.HierarchicalCodelists = null;
                MSD.Concepts = null;
                MSD.Metadataflows = null;
                MSD.KeyFamilies = null;
                MSD.Processes = null;
                MSD.ReportingTaxonomies = null;
                MSD.StructureSets = null;
                MSD.CategorySchemes = null;
                MSD.CodeLists = null;
                MSD.Dataflows = null;
                //Creating MSD and saving its information in the Database.mdb

                SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), MSD, msdfile);//sdmxFolderPath + "\\MSD\\"
            }

            conceptSchemes = Directory.GetFiles(ConceptSchemeFolder);
            foreach (string conceptSchemeFile in conceptSchemes)
            {
                MSDConcepts = new SDMXApi_2_0.Message.StructureType();
                MSDConcepts = (SDMXApi_2_0.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), conceptSchemeFile);
                MSDConcepts.Header = Header;
                MSDConcepts.MetadataStructureDefinitions = null;
                MSDConcepts.OrganisationSchemes = null;
                MSDConcepts.HierarchicalCodelists = null;
                MSDConcepts.Metadataflows = null;
                MSDConcepts.KeyFamilies = null;
                MSDConcepts.Processes = null;
                MSDConcepts.ReportingTaxonomies = null;
                MSDConcepts.StructureSets = null;
                MSDConcepts.CategorySchemes = null;
                MSDConcepts.CodeLists = null;
                MSDConcepts.Dataflows = null;

                //Creating MSDConcepts and saving its information in the Database.mdb
                SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), MSDConcepts, conceptSchemeFile);//sdmxFolderPath + "\\Concepts\\" +

            }
        }
        catch (Exception ex)
        {
            //Global.WriteErrorsInLog("Creating Artefacts For Uploaded DSD From Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);
            RetVal = false;
            Global.CreateExceptionString(ex, null);
        }
        finally
        {

        }

        return RetVal;
    }
    //updating header on generated artifacts for dsd
    //private void Update_MFD_WithHeader(string MFDId, string MFDAgencyId, string MFDVersion, string MFDName, string MFDDescription, string MFDLanguage, string DSDId, string DSDAgencyId, string DSDVersion, string sdmxFolderPath, int DbNId)
    //{
    //    SDMXObjectModel.Message.StructureType MFD;
    //    SDMXObjectModel.Structure.MetadataflowType Metadataflow;
    //    Metadataflow = null;
    //    try
    //    {
    //        MFD = new SDMXObjectModel.Message.StructureType();
    //        //MFD.Header = Header;
    //        SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.StructureType), MFD, sdmxFolderPath + "\\Provisioning Metadata\\" + MFDId + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);
    //    }
    //    catch (Exception ex)
    //    {
    //        Global.CreateExceptionString(ex, null);
    //        throw ex;
    //    }
    //    finally
    //    {
    //    }
    //}
    private bool UpdateCompleteWithHeader(SDMXApi_2_0.Message.HeaderType Header, string DbNId, string UserNId, string sdmxFolderPath)
    {
        bool RetVal = false;
        SDMXApi_2_0.Message.StructureType Complete;

        string completePath = sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName;
        Complete = (SDMXApi_2_0.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), completePath);
        Complete.Header = Header;
        Complete.OrganisationSchemes = null;
        Complete.HierarchicalCodelists = null;
        Complete.Metadataflows = null;
        Complete.Processes = null;
        Complete.ReportingTaxonomies = null;
        Complete.StructureSets = null;
        Complete.CategorySchemes = null;
        Complete.Dataflows = null;

        foreach (SDMXApi_2_0.Structure.CodeListType CodeList in Complete.CodeLists)
        {
            foreach (SDMXApi_2_0.Structure.CodeType Code in CodeList.Code)
            {
                Code.Annotations = null;
            }
        }

        SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), Complete, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName);
        RetVal = true;
        return RetVal;
    }
    private DIExcel GenerateCodelistWorksheets(DIExcel ReportExcel, int SheetIndex, SDMXApi_2_0.Message.StructureType CompleteStructure)
    {
        int i, j;
        IWorksheet CodelistWorkSheet = null;
        SDMXApi_2_0.Structure.CodeListType Codelist;
        SDMXApi_2_0.Structure.CodeType Code;
        string CodelistName = string.Empty;
        string CodeValue = string.Empty;
        string CodeDescription = string.Empty;

        int rowindex = 0;
        string Language = string.Empty;

        try
        {
            if (CompleteStructure.Concepts.Concept.Count > 0)
            {
                Language = CompleteStructure.Concepts.Concept[0].Name[0].lang;
            }
            else if (CompleteStructure.Concepts.ConceptScheme.Count > 0)
            {
                Language = CompleteStructure.Concepts.ConceptScheme[0].Name[0].lang;
            }

            for (i = 1; i <= CompleteStructure.CodeLists.Count; i++)
            {

                Codelist = CompleteStructure.CodeLists[i - 1];
                CodelistName = GetLangSpecificValueFor_Version_2_0(Codelist.Name, Language);
                ReportExcel.InsertWorkSheet(CodelistName);
                CodelistWorkSheet = ReportExcel.GetWorksheet(i);
                rowindex = 1;
                this.WriteValueInCell(ReportExcel, CodelistName, rowindex, 1, 12, true, 30, 0, i);
                rowindex = rowindex + 2;

                this.WriteValueInCell(ReportExcel, "Code", rowindex, 1, 10, true, 60, 0, i);
                this.WriteValueInCell(ReportExcel, "Description", rowindex, 2, 10, true, 250, 0, i);

                rowindex = rowindex + 2;
                //Binding Codelist

                for (j = 0; j < Codelist.Code.Count; j++)
                {
                    Code = new SDMXApi_2_0.Structure.CodeType();
                    Code = Codelist.Code[j];
                    CodeValue = Code.value;
                    CodeDescription = GetLangSpecificValueFor_Version_2_0(Code.Description, Language);
                    if ((CodeValue.Length + 1) <= 30)
                    {
                        this.WriteValueInCell(ReportExcel, CodeValue, rowindex, 1, 10, false, 30, 0, i);
                    }
                    else
                    {
                        this.WriteValueInCell(ReportExcel, CodeValue, rowindex, 1, 10, false, CodeValue.Length + 1, 0, i);
                    }

                    this.WriteValueInCell(ReportExcel, CodeDescription, rowindex, 2, 10, false, 250, 0, i);
                    rowindex = rowindex + 1;

                }
            }

        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);
            throw ex;
        }
        finally
        {
        }

        return ReportExcel;
    }
    private void Remove_Extra_Annotations(SDMXApi_2_0.Message.StructureType Structure)
    {
        if (Structure.CodeLists != null)
        {
            foreach (SDMXApi_2_0.Structure.CodeListType Codelist in Structure.CodeLists)
            {
                foreach (SDMXApi_2_0.Structure.CodeType Code in Codelist.Code)
                {
                    Code.Annotations = null;
                }
            }
        }

        if (Structure.CategorySchemes != null)
        {
            foreach (SDMXApi_2_0.Structure.CategorySchemeType CategoryScheme in Structure.CategorySchemes)
            {
                CategoryScheme.Annotations = null;

                foreach (SDMXApi_2_0.Structure.CategoryType Category in CategoryScheme.Category)
                {
                    Category.Annotations = null;
                    this.Remove_Extra_Annotations_From_Child_Categories(Category);
                }
            }
        }

        if (Structure.KeyFamilies != null)
        {
            foreach (SDMXApi_2_0.Structure.KeyFamilyType Kef in Structure.KeyFamilies)
            {
                Kef.Components.Dimension[0].Annotations = null;

            }
        }

        // Removing annotation at ConceptScheme level
        if (Structure.Concepts != null)
        {
            //SDMXApi_2_0.Structure.ConceptSchemeType ConceptScheme in Structure.Concepts
            foreach (SDMXApi_2_0.Structure.ConceptType ConceptScheme in Structure.Concepts.Concept)
            {
                ConceptScheme.Annotations = null;

            }
        }

        // Removing annotation at MetadataStructure level
        //if (Structure.MetadataStructureDefinitions != null)
        //{
        //    foreach (SDMXApi_2_0.Structure.MetadataStructureDefinitionsType MetadataStructure in Structure.MetadataStructureDefinitions.)
        //    {
        //        MetadataStructure.MetadataStructureDefinition[0].Annotations = null;

        //        // Removing annotation at MetadataTarget level
        //        MetadataStructure.Item.Items[0].Annotations = null;

        //        // Removing annotation at IdentifiableObjectTarget level
        //        MetadataStructure.Item.Items[0].Items[0].Annotations = null;

        //        // Removing annotation at ReportStructure level
        //        MetadataStructure.Item.Items[1].Annotations = null;

        //        // Removing annotation at MetadataAttribute level
        //        foreach (MetadataAttributeType MetadataAttribute in MetadataStructure.Item.Items[1].Items)
        //        {
        //            MetadataAttribute.Annotations = null;
        //        }
        //    }
        //}
    }
Beispiel #8
0
    private bool GenerateCodelistMappingXmlArtefact(string DbNId, string AgencyId, string Language, string CodelistMappingData, StructureType SourceCodelistStructure, SDMXApi_2_0.Message.StructureType TargetCodelistStructure, string SelectedAgeCodelist, string SelectedSexCodelist, string SelectedLocationCodelist)
    {
        bool RetVal;
        string FileNameWPath, OutputFolder;
        string SourceCodelistId, TargetCodelistId;
        string SourceId, SourceAgencyId, SourceVersion, TargetId, TargetAgencyId, TargetVersion, CodelistName;
        string AreaCodelistId, IndicatorCodelistId, UnitCodelistId, AgeCodelist, SexCodelist, LocationCodelist;
        Dictionary<string, Dictionary<string, string>> DictMappingPerCodelist;
        Dictionary<string, string> DictMapping;

        RetVal = false;
        FileNameWPath = string.Empty;
        OutputFolder = string.Empty;
        SourceCodelistId = string.Empty;
        TargetCodelistId = string.Empty;
        CodelistName = string.Empty;
        DictMappingPerCodelist = null;
        DictMapping = null;
        IndicatorCodelistId = string.Empty;
        UnitCodelistId = string.Empty;
        AreaCodelistId = string.Empty;
        AgeCodelist = string.Empty;
        SexCodelist = string.Empty;
        LocationCodelist = string.Empty;
        try
        {
            FileNameWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId + "\\" + Constants.FolderName.SDMX.Mapping + DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.FileName);
            OutputFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId + "\\" + Constants.FolderName.SDMX.Mapping);

            if (File.Exists(FileNameWPath))
            {
                File.Delete(FileNameWPath);
            }

            foreach (SDMXApi_2_0.Structure.DimensionType Dimensions in TargetCodelistStructure.KeyFamilies[0].Components.Dimension)
            {
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Indicator.Id)
                {
                    IndicatorCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Unit.Id)
                {
                    UnitCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Area.Id)
                {
                    AreaCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Age.Id)
                {
                    AgeCodelist = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Sex.Id)
                {
                    SexCodelist = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Location.Id)
                {
                    LocationCodelist = Dimensions.codelist;
                }

            }
            if (!string.IsNullOrEmpty(CodelistMappingData))
            {
                DictMappingPerCodelist = new Dictionary<string, Dictionary<string, string>>();

                foreach (string RowMappingData in CodelistMappingData.Split(new string[] { Constants.Delimiters.RowDelimiter }, StringSplitOptions.None))
                {
                    if (DictMappingPerCodelist.ContainsKey(RowMappingData.Split(new string[] { Constants.Delimiters.ColumnDelimiter }, StringSplitOptions.None)[0]))
                    {
                        DictMappingPerCodelist[RowMappingData.Split(new string[] { Constants.Delimiters.ColumnDelimiter }, StringSplitOptions.None)[0]].Add(RowMappingData.Split(new string[] { Constants.Delimiters.ColumnDelimiter }, StringSplitOptions.None)[1], RowMappingData.Split(new string[] { Constants.Delimiters.ColumnDelimiter }, StringSplitOptions.None)[2]);
                    }
                    else
                    {
                        DictMapping = new Dictionary<string, string>();
                        DictMapping.Add(RowMappingData.Split(new string[] { Constants.Delimiters.ColumnDelimiter }, StringSplitOptions.None)[1], RowMappingData.Split(new string[] { Constants.Delimiters.ColumnDelimiter }, StringSplitOptions.None)[2]);

                        DictMappingPerCodelist.Add(RowMappingData.Split(new string[] { Constants.Delimiters.ColumnDelimiter }, StringSplitOptions.None)[0], DictMapping);
                    }
                }

                foreach (string Key in DictMappingPerCodelist.Keys)
                {
                    DictMapping = DictMappingPerCodelist[Key];

                    switch (Key)
                    {
                        case "Indicator":
                            SourceCodelistId = DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Indicator.Id;
                            //TargetCodelistId = Constants.UNSD.CodeList.Indicator.Id;
                            TargetCodelistId = IndicatorCodelistId;
                            CodelistName = DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Indicator.Id;
                            break;
                        case "Unit":
                            SourceCodelistId = DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Unit.Id;
                            // TargetCodelistId = Constants.UNSD.CodeList.Unit.Id;
                            TargetCodelistId = UnitCodelistId;
                            CodelistName = DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Unit.Id;
                            break;
                        case "Age":
                            SourceCodelistId = SelectedAgeCodelist;//DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + AGE
                            // TargetCodelistId = Constants.UNSD.CodeList.Age.Id;
                            TargetCodelistId = AgeCodelist;
                            CodelistName = DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + "AGE";
                            break;
                        case "Sex":
                            SourceCodelistId = SelectedSexCodelist;//SEX
                            // TargetCodelistId = Constants.UNSD.CodeList.Sex.Id;
                            TargetCodelistId = SexCodelist;
                            CodelistName = DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + "SEX";
                            break;
                        case "Location":
                            SourceCodelistId = SelectedLocationCodelist;//LOCATION
                            //TargetCodelistId = Constants.UNSD.CodeList.Location.Id;
                            TargetCodelistId = LocationCodelist;
                            CodelistName = DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + "LOCATION";
                            break;
                        case "Area":
                            SourceCodelistId = DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + "AREA";
                            // TargetCodelistId = Constants.UNSD.CodeList.Area.Id;
                            TargetCodelistId = AreaCodelistId;
                            CodelistName = DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + "AREA";
                            break;
                        default:
                            break;
                    }

                    this.Get_SourceIdAgencyIdVersionCodelist(SourceCodelistId, out SourceId, out SourceAgencyId, out SourceVersion, SourceCodelistStructure);
                    this.Get_TargetIdAgencyIdVersionCodelist(TargetCodelistId, out TargetId, out TargetAgencyId, out TargetVersion, TargetCodelistStructure);

                    if (File.Exists(FileNameWPath))
                    {
                        SDMXUtility.Generate_Mapping(SDMXSchemaType.Two_One, DevInfo.Lib.DI_LibSDMX.MappingType.Codelist, DictMapping, SourceId, SourceAgencyId, SourceVersion, TargetId, TargetAgencyId, TargetVersion, AgencyId, Language, null, FileNameWPath, string.Empty, CodelistName);
                    }
                    else
                    {
                        SDMXUtility.Generate_Mapping(SDMXSchemaType.Two_One, DevInfo.Lib.DI_LibSDMX.MappingType.Codelist, DictMapping, SourceId, SourceAgencyId, SourceVersion, TargetId, TargetAgencyId, TargetVersion, AgencyId, Language, null, string.Empty, OutputFolder, CodelistName);
                    }
                }
            }

            RetVal = true;
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }

        return RetVal;
    }
Beispiel #9
0
    private string GetAllMappedCodeLists(string DbNId, string Language, StructureType SourceCodelistStructure, SDMXApi_2_0.Message.StructureType TargetCodelistStructure, StructureType MappingCodelistStructure, string SelectedAgeCodelist, string SelectedSexCodelist, string SelectedLocationCodelist, string SelectedAreaLevel)
    {
        string RetVal;
        RetVal = string.Empty;

        RetVal = this.GetIndicatorMappingList(DbNId, Language, SourceCodelistStructure, TargetCodelistStructure, MappingCodelistStructure);
        RetVal += Constants.Delimiters.ParamDelimiter;
        RetVal += this.GetUnitMappingList(DbNId, Language, SourceCodelistStructure, TargetCodelistStructure, MappingCodelistStructure);
        RetVal += Constants.Delimiters.ParamDelimiter;
        RetVal += this.GetAgeMappingList(DbNId, Language, SelectedAgeCodelist, SourceCodelistStructure, TargetCodelistStructure, MappingCodelistStructure);
        RetVal += Constants.Delimiters.ParamDelimiter;
        RetVal += this.GetSexMappingList(DbNId, Language, SelectedSexCodelist, SourceCodelistStructure, TargetCodelistStructure, MappingCodelistStructure);
        RetVal += Constants.Delimiters.ParamDelimiter;
        RetVal += this.GetLocationMappingList(DbNId, Language, SelectedLocationCodelist, SourceCodelistStructure, TargetCodelistStructure, MappingCodelistStructure);
        RetVal += Constants.Delimiters.ParamDelimiter;
        RetVal += this.GetAreaMappingList(DbNId, Language, SourceCodelistStructure, TargetCodelistStructure, MappingCodelistStructure, SelectedAreaLevel);
        return RetVal;
    }
Beispiel #10
0
    /// <summary>
    /// Returning the deserialized objects on the basis of dsds and codelistmappingxml
    /// </summary>
    /// <param name="DbNId">The Database Id which has been selected</param>
    /// <param name="SourceCodelistStructure"></param>
    /// <param name="TargetCodelistStructure"></param>
    /// <param name="MappingCodelistStructure"></param>
    public void Get_Codelist_Source_Target_Mapping_Structure(string DbNId, out StructureType SourceCodelistStructure, out SDMXApi_2_0.Message.StructureType TargetCodelistStructure, out StructureType MappingCodelistStructure)
    {
        string CodelistMappingFileNameWPath;

        CodelistMappingFileNameWPath = string.Empty;

        MappingCodelistStructure = null;

        try
        {
            CodelistMappingFileNameWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId + "\\" + Constants.FolderName.SDMX.Mapping + DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.FileName);

            if (File.Exists(CodelistMappingFileNameWPath))
            {
                MappingCodelistStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), CodelistMappingFileNameWPath);
            }

            this.Get_Codelist_Source_Target_Structure(DbNId, out SourceCodelistStructure, out TargetCodelistStructure);
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }
    }
Beispiel #11
0
    public Dictionary<string, string> Get_DictTargetCodelist(string Language, string CodelistId, SDMXApi_2_0.Message.StructureType Structure)
    {
        Dictionary<string, string> RetVal;
        string CodeId, CodeDescription;
        SDMXApi_2_0.Structure.CodeListType TargetCodelist;

        RetVal = new Dictionary<string, string>();
        CodeId = string.Empty;
        CodeDescription = string.Empty;
        TargetCodelist = null;

        try
        {
            if (Structure != null && Structure.CodeLists != null && Structure.CodeLists.Count > 0)
            {
                foreach (SDMXApi_2_0.Structure.CodeListType Codelist in Structure.CodeLists)
                {
                    if (Codelist.id == CodelistId)
                    {
                        TargetCodelist = Codelist;
                        break;
                    }
                }

                if (TargetCodelist != null && TargetCodelist.Code != null && TargetCodelist.Code.Count > 0)
                {
                    foreach (SDMXApi_2_0.Structure.CodeType Code in TargetCodelist.Code)
                    {
                        CodeId = Code.value;
                        CodeDescription = this.GetLangSpecificValueFor_Version_2_0(Code.Description, Language);

                        RetVal.Add(CodeId, CodeDescription);
                    }
                }

                if (RetVal != null && RetVal.Keys.Count > 0)
                {
                    RetVal = this.Sort_Dictionary(RetVal);
                }
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }

        return RetVal;
    }
    private string GetIUSMappingList(string DbNId, string Language, SDMXObjectModel.Message.StructureType SourceCodelistStructure, SDMXApi_2_0.Message.StructureType TargetCodelistStructure, SDMXObjectModel.Message.StructureType MappingCodelistStructure, string FileName)
    {
        string RetVal;
        string IndicatorGId;
        string IndicatorCodelistId;
        Dictionary<string, string> DictTargetIndicator, DictSourceIndicator;
        StringBuilder Builder;

        RetVal = string.Empty;
        IndicatorGId = string.Empty;

        DictTargetIndicator = null;
        IndicatorCodelistId = string.Empty;

        Builder = new StringBuilder(RetVal);
        string TargetIndicatorGid = string.Empty;

        string SourceIndicatorGid = string.Empty;
        string[] FileNameArray = null;
        string[] DI_IUSFileNameArray = null;
        string TargetIndicatorPart = string.Empty;
        string SourceIndicatorPart = string.Empty;
        string SourceIndicatorName = string.Empty;
        try
        {
            Global.GetAppSetting();

            if (TargetCodelistStructure != null)
            {
                foreach (SDMXApi_2_0.Structure.DimensionType Dimensions in TargetCodelistStructure.KeyFamilies[0].Components.Dimension)
                {
                    if (Dimensions.conceptRef == Constants.UNSD.Concept.Indicator.Id)
                    {
                        IndicatorCodelistId = Dimensions.codelist;
                    }

                }

                DictTargetIndicator = this.Get_DictTargetCodelist(Language, IndicatorCodelistId, TargetCodelistStructure);
            }
            DictSourceIndicator = GetSourceIndicatorCodeListMapping(Language, DbNId);
            if (string.IsNullOrEmpty(FileName) == false)
            {
                FileName = FileName.Replace(".xml", "");
                if (FileName.Contains("_DI_") || FileName.Contains("_DIMD_"))
                {
                    if (FileName.Contains("_DI_"))
                    {
                        FileNameArray = Global.SplitString(FileName, "_DI_");
                    }
                    else
                    {
                        FileNameArray = Global.SplitString(FileName, "_DIMD_");
                    }
                    TargetIndicatorPart = FileNameArray[0];
                    SourceIndicatorPart = FileNameArray[1];
                }
                else
                {
                    FileNameArray = Global.SplitString(FileName, "_" + Language + "_");
                    TargetIndicatorPart = FileNameArray[1];
                    DI_IUSFileNameArray = Global.SplitString(FileNameArray[0], "_");
                    SourceIndicatorPart = DI_IUSFileNameArray[0];
                    //  SourceIndicatorPart = FileName;
                }
                foreach (KeyValuePair<string, string> SourceIndicator in DictSourceIndicator)
                {

                    if (SourceIndicator.Key.Contains(SourceIndicatorPart))
                    {
                        SourceIndicatorName = SourceIndicator.Value;
                    }
                }
            }

        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }

        RetVal = SourceIndicatorName.ToString();
        return RetVal;
    }
Beispiel #13
0
    private string BindChildMetadatAttributes_For_Version_2_0(StringBuilder sb, SDMXApi_2_0.Structure.MetadataAttributeType ParentMetadataAttribute, SDMXApi_2_0.Message.StructureType SummaryStructure, string lngcodedb)
    {
        string RetVal = string.Empty;
        string ConceptName = string.Empty;
        string ConceptDescription = string.Empty;
        SDMXApi_2_0.Structure.MetadataAttributeType ChildMetadataAttribute;

        int i, j, k;
        if (ParentMetadataAttribute.MetadataAttribute != null && ParentMetadataAttribute.MetadataAttribute.Count > 0)
        {
            sb.Append("<ul>");
            for (i = 0; i < ParentMetadataAttribute.MetadataAttribute.Count; i++)
            {
                sb.Append("<li>");
                ChildMetadataAttribute = ParentMetadataAttribute.MetadataAttribute[i];
                for (j = 0; j < SummaryStructure.Concepts.ConceptScheme.Count; j++)
                {
                    if (ChildMetadataAttribute.conceptSchemeRef == SummaryStructure.Concepts.ConceptScheme[j].id)
                    {
                        for (k = 0; k < SummaryStructure.Concepts.ConceptScheme[j].Concept.Count; k++)
                        {
                            if (ChildMetadataAttribute.conceptRef == SummaryStructure.Concepts.ConceptScheme[j].Concept[k].id)
                            {

                                ConceptName = GetLangSpecificValueFor_Version_2_0(SummaryStructure.Concepts.ConceptScheme[j].Concept[k].Name, lngcodedb).ToUpper();
                                ConceptDescription = GetLangSpecificValueFor_Version_2_0(SummaryStructure.Concepts.ConceptScheme[j].Concept[k].Description, lngcodedb);
                                if (ConceptName != string.Empty)
                                {
                                    sb.Append(ConceptName);
                                }
                                if (ConceptDescription != string.Empty)
                                {
                                    sb.Append("<span class=\"reg_li_brac_txt\">(");
                                    sb.Append(ConceptDescription);
                                    sb.Append(")</span> ");
                                }
                                break;
                            }
                        }
                        break;
                    }
                }
                if (ChildMetadataAttribute.MetadataAttribute != null && ChildMetadataAttribute.MetadataAttribute.Count > 0)
                {
                    BindChildMetadatAttributes_For_Version_2_0(sb, ChildMetadataAttribute, SummaryStructure, lngcodedb);
                }
                sb.Append("</li>");
            }
            sb.Append("</ul>");
        }
        RetVal = sb.ToString();

        return RetVal;
    }
    private static Dictionary<string, string> Validate_Series(SDMXApi_2_0.CompactData.SeriesType Series, List<string> ListFrequency, List<string> ListIndicator, List<string> ListUnit,
                                                 List<string> ListLocation, List<string> ListAge, List<string> ListSex, List<string> ListArea,
                                                 List<string> ListSourceType, List<string> ListNature, List<string> ListUnitMult)
    {
        Dictionary<string, string> RetVal;
        SDMXApi_2_0.CompactData.ObsType Obs;
        int Counter = 0;
        int AttributeCounter = 0;
        string SeriesFrequency = string.Empty;
        string SeriesSeries = string.Empty;
        string SeriesUnit = string.Empty;
        string SeriesLocation = string.Empty;
        string SeriesAge = string.Empty;
        string SeriesSex = string.Empty;
        string SeriesArea = string.Empty;
        string SeriesSourceType = string.Empty;

        RetVal = new Dictionary<string, string>();

        while (AttributeCounter < Series.AnyAttr.Count)
        {

            if (!((Series.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Frequency.Id) || (Series.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Indicator.Id) || (Series.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Unit.Id) || (Series.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Location.Id) || (Series.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Age.Id) || (Series.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Sex.Id) || (Series.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.Area.Id) || (Series.AnyAttr[AttributeCounter].Name == Constants.UNSD.Concept.SourceType.Id)))
            {
                RetVal.Add(SDMXValidationStatus.Dimension_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Dimension + Series.AnyAttr[AttributeCounter].Name);
                break;
            }
            else
            {
                switch (Series.AnyAttr[AttributeCounter].Name)
                {
                    case Constants.UNSD.Concept.Frequency.Id:
                        SeriesFrequency = Series.AnyAttr[AttributeCounter].Value;
                        break;
                    case Constants.UNSD.Concept.Indicator.Id:
                        SeriesSeries = Series.AnyAttr[AttributeCounter].Value;
                        break;
                    case Constants.UNSD.Concept.Unit.Id:
                        SeriesUnit = Series.AnyAttr[AttributeCounter].Value;
                        break;
                    case Constants.UNSD.Concept.Location.Id:
                        SeriesLocation = Series.AnyAttr[AttributeCounter].Value;
                        break;
                    case Constants.UNSD.Concept.Age.Id:
                        SeriesAge = Series.AnyAttr[AttributeCounter].Value;
                        break;
                    case Constants.UNSD.Concept.Sex.Id:
                        SeriesSex = Series.AnyAttr[AttributeCounter].Value;
                        break;
                    case Constants.UNSD.Concept.Area.Id:
                        SeriesArea = Series.AnyAttr[AttributeCounter].Value;
                        break;
                    case Constants.UNSD.Concept.SourceType.Id:
                        SeriesSourceType = Series.AnyAttr[AttributeCounter].Value;
                        break;
                    default:
                        break;
                }

            }

            AttributeCounter = AttributeCounter + 1;
        }
        if (RetVal.Keys.Count == 0)
        {
            if (!ListFrequency.Contains(SeriesFrequency))
            {
                RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + SeriesFrequency);
            }
            else
            {
                if (!ListIndicator.Contains(SeriesSeries))
                {
                    RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + SeriesSeries);
                }
                else
                {

                    if (!ListUnit.Contains(SeriesUnit))
                    {
                        RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + SeriesUnit);
                    }
                    else
                    {

                        if (!string.IsNullOrEmpty(SeriesLocation) && !ListLocation.Contains(SeriesLocation))
                        {
                            RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + SeriesLocation);
                        }
                        else
                        {

                            if (!string.IsNullOrEmpty(SeriesAge) && !ListAge.Contains(SeriesAge))
                            {
                                RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + SeriesAge);
                            }
                            else
                            {

                                if (!string.IsNullOrEmpty(SeriesSex) && !ListSex.Contains(SeriesSex))
                                {
                                    RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + SeriesSex);
                                }
                                else
                                {
                                    if (!string.IsNullOrEmpty(SeriesArea) && !ListArea.Contains(SeriesArea))
                                    {
                                        RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + SeriesArea);
                                    }
                                    else
                                    {
                                        if (!string.IsNullOrEmpty(SeriesSourceType) && !ListSourceType.Contains(SeriesSourceType))
                                        {
                                            RetVal.Add(SDMXValidationStatus.Code_Invalid.ToString(), DevInfo.Lib.DI_LibSDMX.Constants.ValidationMessages.Invalid_Code + SeriesSourceType);
                                        }
                                        else
                                        {
                                            Counter = 0;
                                            while (RetVal.Keys.Count == 0 && Counter < Series.ListObs.Count)
                                            {
                                                // 1. Extracting an Obs object from the Series' object.
                                                Obs = Series.ListObs[Counter];

                                                // 2. Validating an Obs object at a time against the various lists.
                                                RetVal = Validate_Obs(Obs, ListNature, ListUnitMult);
                                                Counter++;
                                            }
                                        }

                                    }

                                }
                            }
                        }
                    }
                }

            }
        }

        return RetVal;
    }
    private bool CreateCompleteFileForUploadedDSD(SDMXApi_2_0.Message.StructureType UploadedDSDStructure, string sdmxFolderPath, int DbNId, string UserNId)
    {
        bool RetVal;
        SDMXApi_2_0.Message.StructureType Complete;
        string AgencyId;
        string AppPhysicalPath;
        string DbFolder;

        RetVal = true;
        AgencyId = string.Empty;
        try
        {
            AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + UserNId;
            AppPhysicalPath = HttpContext.Current.Request.PhysicalApplicationPath;
            DbFolder = Constants.FolderName.Data + DbNId.ToString() + "\\";

            Complete = new SDMXApi_2_0.Message.StructureType();

            Complete.Header = UploadedDSDStructure.Header;

            Complete.Concepts = UploadedDSDStructure.Concepts;
            Complete.KeyFamilies = UploadedDSDStructure.KeyFamilies;
            Complete.CodeLists = UploadedDSDStructure.CodeLists;
            Complete.MetadataStructureDefinitions = UploadedDSDStructure.MetadataStructureDefinitions;
            Complete.OrganisationSchemes = null;
            Complete.HierarchicalCodelists = null;
            Complete.Metadataflows = null;
            Complete.Processes = null;
            Complete.ReportingTaxonomies = null;
            Complete.StructureSets = null;
            Complete.CategorySchemes = null;
            Complete.Dataflows = null;

            foreach (SDMXApi_2_0.Structure.CodeListType CodeList in Complete.CodeLists)
            {
                foreach (SDMXApi_2_0.Structure.CodeType Code in CodeList.Code)
                {
                    Code.Annotations = null;
                }
            }

            //Creating Complete file and saving its information in the Database.mdb
            SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), Complete, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName);
            this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.Id, AgencyId, DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.Version, string.Empty, ArtefactTypes.Complete, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName, DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName);

        }
        catch (Exception ex)
        {
            //Global.WriteErrorsInLog("Creating Artefacts For Uploaded DSD From Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);
            RetVal = false;
            Global.CreateExceptionString(ex, null);
        }
        finally
        {

        }

        return RetVal;
    }
Beispiel #16
0
    private string GetIUSMappingList(string DbNId, string Language, StructureType SourceCodelistStructure, SDMXApi_2_0.Message.StructureType TargetCodelistStructure, StructureType MappingCodelistStructure, string SelectedAgeCodelist, string SelectedSexCodelist, string SelectedLocationCodelist)
    {
        string RetVal;
        string IndicatorGId, UnitGId, SubgroupValGId, AgeGId, SexGId, LocationGId, Indicator, Unit, SubgroupVal;
        string OriginalRowColor, OriginalRowStatus, OriginalRowState;
        string IndicatorCodelistId, UnitCodelistId, AreaCodelistId, AgeCodelistId, SexCodelistId, LocationCodelistId, NatureCodelistId, FreqCodelistId, SourceTypeCodelistId, UnitMultCodelistId;
        Dictionary<string, string> DictSourceIUS, DictTargetIndicator, DictTargetUnit, DictTargetAge, DictTargetSex, DictTargetLocation, DictTargetFrequency, DictTargetSourceType, DictTargetNature, DictTargetUnitMult, DictMappingIUS, DictMappingIndicator, DictMappingUnit, DictMappingAge, DictMappingSex, DictMappingLocation;
        StringBuilder Builder;

        RetVal = string.Empty;
        IndicatorGId = string.Empty;
        UnitGId = string.Empty;
        SubgroupValGId = string.Empty;
        AgeGId = string.Empty;
        SexGId = string.Empty;
        LocationGId = string.Empty;
        Indicator = string.Empty;
        Unit = string.Empty;
        SubgroupVal = string.Empty;

        OriginalRowColor = string.Empty;
        OriginalRowStatus = string.Empty;
        OriginalRowState = string.Empty;

        DictSourceIUS = null;
        DictTargetIndicator = null;
        DictTargetUnit = null;
        DictTargetAge = null;
        DictTargetSex = null;
        DictTargetLocation = null;
        DictTargetFrequency = null;
        DictTargetSourceType = null;
        DictTargetNature = null;
        DictTargetUnitMult = null;

        DictMappingIUS = null;
        DictMappingIndicator = null;
        DictMappingUnit = null;
        DictMappingAge = null;
        DictMappingSex = null;
        DictMappingLocation = null;
        IndicatorCodelistId = string.Empty;
        UnitCodelistId = string.Empty;
        AreaCodelistId = string.Empty;
        AgeCodelistId = string.Empty;
        SexCodelistId = string.Empty;
        LocationCodelistId = string.Empty;
        NatureCodelistId = string.Empty;
        FreqCodelistId = string.Empty;
        SourceTypeCodelistId = string.Empty;
        UnitMultCodelistId = string.Empty;
        Builder = new StringBuilder(RetVal);
        string NoRecordsFound = string.Empty;
        try
        {
            Global.GetAppSetting();

            foreach (SDMXApi_2_0.Structure.DimensionType Dimensions in TargetCodelistStructure.KeyFamilies[0].Components.Dimension)
            {
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Indicator.Id)
                {
                    IndicatorCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Unit.Id)
                {
                    UnitCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Area.Id)
                {
                    AreaCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Age.Id)
                {
                    AgeCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Sex.Id)
                {
                    SexCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Location.Id)
                {
                    LocationCodelistId = Dimensions.codelist;
                }
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Frequency.Id)
                {
                    FreqCodelistId = Dimensions.codelist;
                }

                if (Dimensions.conceptRef == Constants.UNSD.Concept.SourceType.Id)
                {
                    SourceTypeCodelistId = Dimensions.codelist;
                }

            }
            foreach (SDMXApi_2_0.Structure.AttributeType Attributes in TargetCodelistStructure.KeyFamilies[0].Components.Attribute)
            {
                if (Attributes.conceptRef == Constants.UNSD.Concept.Nature.Id)
                {
                    NatureCodelistId = Attributes.codelist;
                }
                if (Attributes.conceptRef == Constants.UNSD.Concept.UnitMult.Id)
                {
                    UnitMultCodelistId = Attributes.codelist;
                }
            }
            DictSourceIUS = this.Get_DictSourceIUS(Language, SourceCodelistStructure, MappingCodelistStructure);
            //DictTargetUnit = this.Get_DictTargetCodelist(Language, Constants.UNSD.CodeList.Unit.Id, TargetCodelistStructure);
            //DictTargetAge = this.Get_DictTargetCodelist(Language, Constants.UNSD.CodeList.Age.Id, TargetCodelistStructure);
            //DictTargetSex = this.Get_DictTargetCodelist(Language, Constants.UNSD.CodeList.Sex.Id, TargetCodelistStructure);
            //DictTargetLocation = this.Get_DictTargetCodelist(Language, Constants.UNSD.CodeList.Location.Id, TargetCodelistStructure);
            //DictTargetFrequency = this.Get_DictTargetCodelist(Language, Constants.UNSD.CodeList.Frequency.Id, TargetCodelistStructure);
            //DictTargetSourceType = this.Get_DictTargetCodelist(Language, Constants.UNSD.CodeList.SourceType.Id, TargetCodelistStructure);
            //DictTargetNature = this.Get_DictTargetCodelist(Language, Constants.UNSD.CodeList.Nature.Id, TargetCodelistStructure);
            //DictTargetUnitMult = this.Get_DictTargetCodelist(Language, Constants.UNSD.CodeList.UnitMult.Id, TargetCodelistStructure);

            DictTargetIndicator = this.Get_DictTargetCodelist(Language, IndicatorCodelistId, TargetCodelistStructure);
            DictTargetUnit = this.Get_DictTargetCodelist(Language, UnitCodelistId, TargetCodelistStructure);
            DictTargetAge = this.Get_DictTargetCodelist(Language, AgeCodelistId, TargetCodelistStructure);
            DictTargetSex = this.Get_DictTargetCodelist(Language, SexCodelistId, TargetCodelistStructure);
            DictTargetLocation = this.Get_DictTargetCodelist(Language, LocationCodelistId, TargetCodelistStructure);
            DictTargetFrequency = this.Get_DictTargetCodelist(Language, FreqCodelistId, TargetCodelistStructure);
            DictTargetSourceType = this.Get_DictTargetCodelist(Language, SourceTypeCodelistId, TargetCodelistStructure);
            DictTargetNature = this.Get_DictTargetCodelist(Language, NatureCodelistId, TargetCodelistStructure);
            DictTargetUnitMult = this.Get_DictTargetCodelist(Language, UnitMultCodelistId, TargetCodelistStructure);

            DictMappingIUS = this.Get_DictMappingIUS(DbNId);
            DictMappingIndicator = this.Get_DictMappingCodelist(DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.Indicator.id, MappingCodelistStructure);
            DictMappingUnit = this.Get_DictMappingCodelist(DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.Unit.id, MappingCodelistStructure);
            DictMappingAge = this.Get_DictMappingCodelist(DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.Age.id, MappingCodelistStructure);
            DictMappingSex = this.Get_DictMappingCodelist(DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.Sex.id, MappingCodelistStructure);
            DictMappingLocation = this.Get_DictMappingCodelist(DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.Location.id, MappingCodelistStructure);
            Builder.Append("<div style=\"overflow-x:hidden;\">");
            if (DictMappingIndicator.Count == 0)
            {
                NoRecordsFound = "NRF";
                RetVal = NoRecordsFound;
                return RetVal;
            }

            Builder.Append("<table>");
            Builder.Append("<tr>");

            Builder.Append("<td>");
            Builder.Append("<table id=\"tblIUSHeader\" style=\"width:100%; \">");//table-layout:fixed;
            Builder.Append("<col width=\"110\"/>");
            Builder.Append("<col width=\"60\"/>");
            Builder.Append("<col width=\"60\"/>");
            Builder.Append("<col width=\"23\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"33\"/>");

            Builder.Append("<tr style=\"height:30px;\">");

            Builder.Append("<td colspan=\"7\" style=\"width:542px; align:left; overflow:hidden;\">");
            Builder.Append("<a id=\"aShowIUSAll\" href=\"javascript:void(0);\" style=\"color:#000000;\" onclick=\"FilterRowsByStatus('tblIUS', 'aShowIUSAll', 'aShowIUSMapped', 'aShowIUSUnMapped', 'aShowIUSUnSaved', 'all');\"></a>");
            Builder.Append("   |   ");
            Builder.Append("<a id=\"aShowIUSMapped\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblIUS', 'aShowIUSAll', 'aShowIUSMapped', 'aShowIUSUnMapped', 'aShowIUSUnSaved', 'mapped');\"></a>&nbsp;");
            Builder.Append("<span style=\"background-color:#bbffbb;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            Builder.Append("   |   ");
            Builder.Append("<a id=\"aShowIUSUnMapped\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblIUS', 'aShowIUSAll', 'aShowIUSMapped', 'aShowIUSUnMapped', 'aShowIUSUnSaved', 'unmapped');\"></a>&nbsp;");
            Builder.Append("<span style=\"background-color:#ffbbbb;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            Builder.Append("   |   ");
            Builder.Append("<a id=\"aShowIUSUnSaved\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblIUS', 'aShowIUSAll', 'aShowIUSMapped', 'aShowIUSUnMapped', 'aShowIUSUnSaved', 'unsaved');\"></a>&nbsp;");
            Builder.Append("<span style=\"background-color:#bbbbff;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            Builder.Append("</td>");

            Builder.Append("<td colspan=\"6\" style=\"width:358px; align:left; overflow:hidden;\">");
            Builder.Append("<div id=\"divIUSSearch\">");
            Builder.Append("<input id=\"txtIUSSearch\" type=\"text\"/>");
            Builder.Append("</div>");
            Builder.Append("</td>");

            Builder.Append("</tr>");

            //Grid Header
            Builder.Append("<tr style=\"height:30px; width:100%; background: #dddddd;\">");
            Builder.Append("<td style=\"text-align: left; width: 11.4% ! important;\"><b id=\"lang_Indicator\"></b></td>");
            Builder.Append("<td style=\"width: 6%; text-align: left;\"><b id=\"lang_Unit\"></b></td>");
            Builder.Append("<td style=\"text-align: left; width: 6.2%;\"><b id=\"lang_Subgroup\"></b></td>");
            Builder.Append("<td style=\"text-align: left; width: 2.5%;\"><b id=\"lang_Mapped\"></b></td>");
            Builder.Append("<td style=\"text-align: left; width: 8%;\"><b id=\"lang_Indicator\">Indicator</b></td>");
            Builder.Append("<td style=\"text-align: left; width: 8%;\">");
            Builder.Append("<b id=\"lang_Unit_UNSD\"></b>");
            Builder.Append("</td>");
            Builder.Append("<td style=\"text-align: left; width: 8%;\">");
            Builder.Append("<b id=\"lang_Age\"></b>");
            Builder.Append("</td>");
            Builder.Append("<td style=\"text-align: left; width: 8%;\">");
            Builder.Append("<b id=\"lang_Sex\"></b>");
            Builder.Append("</td>");
            Builder.Append("<td style=\"text-align: left; width: 8%;\">");
            Builder.Append("<b id=\"lang_Location\"></b>");
            Builder.Append("</td>");
            Builder.Append("<td style=\"text-align: left; width: 8%;\">");
            Builder.Append("<b id=\"lang_Frequency\"></b>");
            Builder.Append("</td>");
            Builder.Append("<td style=\"text-align: left; width: 8%;\">");
            Builder.Append("<b id=\"lang_SourceType\"></b>");
            Builder.Append("</td>");
            Builder.Append("<td style=\"text-align: left; width: 8%;\">");
            Builder.Append("<b id=\"lang_Nature\"></b>");
            Builder.Append("</td>");
            Builder.Append("<td style=\"text-align: left; width: 10%;\">");
            Builder.Append("<b id=\"lang_UnitMultiplier\"></b>");
            Builder.Append("</td>");

            Builder.Append("</tr>");

            Builder.Append("</table>");
            Builder.Append("</td>");

            Builder.Append("</tr>");
            Builder.Append("<tr>");

            Builder.Append("<td>");
            //Grid Data
            Builder.Append("<div style=\"height:200px; overflow-y:scroll!important;\">");

            Builder.Append("<table id=\"tblIUS\" style=\"width:100%; table-layout:fixed;\">");

            //moved
            #region DIV
            Builder.Append("<tr>");//style=\"height:30px; background-color:#dddddd;\"
            Builder.Append("<td style=\"width:110px; align:left; overflow:hidden;\"></td>");
            Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\"></td>");
            Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\"></td>");
            Builder.Append("<td style=\"width:23px; align:left; overflow:hidden;\"><b id=\"lang_Mapped\" ></b></td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");

            Builder.Append("<select id=\"ddlUNSDIUSIndicator\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetIndicator in DictTargetIndicator)
            {
                Builder.Append("<option value=\"" + TargetIndicator.Key + "\" title=\"" + TargetIndicator.Value + "\">" + this.Get_TrimmedInnerHTML(TargetIndicator.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            //Builder.Append("<b id=\"lang_Unit_UNSD\"></b>");

            Builder.Append("<select id=\"ddlUNSDIUSUnit\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetUnit in DictTargetUnit)
            {
                Builder.Append("<option value=\"" + TargetUnit.Key + "\" title=\"" + TargetUnit.Value + "\">" + this.Get_TrimmedInnerHTML(TargetUnit.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            //Builder.Append("<b id=\"lang_Age\"></b>");

            Builder.Append("<select id=\"ddlUNSDIUSAge\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetAge in DictTargetAge)
            {
                Builder.Append("<option value=\"" + TargetAge.Key + "\" title=\"" + TargetAge.Value + "\">" + this.Get_TrimmedInnerHTML(TargetAge.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            //Builder.Append("<b id=\"lang_Sex\"></b>");

            Builder.Append("<select id=\"ddlUNSDIUSSex\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetSex in DictTargetSex)
            {
                Builder.Append("<option value=\"" + TargetSex.Key + "\" title=\"" + TargetSex.Value + "\">" + this.Get_TrimmedInnerHTML(TargetSex.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            //Builder.Append("<b id=\"lang_Location\"></b>");

            Builder.Append("<select id=\"ddlUNSDIUSLocation\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetLocation in DictTargetLocation)
            {
                Builder.Append("<option value=\"" + TargetLocation.Key + "\" title=\"" + TargetLocation.Value + "\">" + this.Get_TrimmedInnerHTML(TargetLocation.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            //Builder.Append("<b id=\"lang_Frequency\"></b>");

            Builder.Append("<select id=\"ddlUNSDIUSFrequency\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetFrequency in DictTargetFrequency)
            {
                Builder.Append("<option value=\"" + TargetFrequency.Key + "\" title=\"" + TargetFrequency.Value + "\">" + this.Get_TrimmedInnerHTML(TargetFrequency.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            //Builder.Append("<b id=\"lang_SourceType\"></b>");

            Builder.Append("<select id=\"ddlUNSDIUSSourceType\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetSourceType in DictTargetSourceType)
            {
                Builder.Append("<option value=\"" + TargetSourceType.Key + "\" title=\"" + TargetSourceType.Value + "\">" + this.Get_TrimmedInnerHTML(TargetSourceType.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            //Builder.Append("<b id=\"lang_Nature\"></b>");

            Builder.Append("<select id=\"ddlUNSDIUSNature\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetNature in DictTargetNature)
            {
                Builder.Append("<option value=\"" + TargetNature.Key + "\" title=\"" + TargetNature.Value + "\">" + this.Get_TrimmedInnerHTML(TargetNature.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            //Builder.Append("<b id=\"lang_UnitMultiplier\"></b>");

            Builder.Append("<select id=\"ddlUNSDIUSUnitMult\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetUnitMult in DictTargetUnitMult)
            {
                Builder.Append("<option value=\"" + TargetUnitMult.Key + "\" title=\"" + TargetUnitMult.Value + "\">" + this.Get_TrimmedInnerHTML(TargetUnitMult.Value, 75) + "</option>");
            }

            Builder.Append("</select>");
            Builder.Append("</td>");

            // Builder.Append("<td style=\"width:33px; align:left; overflow:hidden;\"></td>");

            Builder.Append("</tr>");

            #endregion DIV
            //till here

            Builder.Append("<col width=\"110\"/>");
            Builder.Append("<col width=\"60\"/>");
            Builder.Append("<col width=\"60\"/>");
            Builder.Append("<col width=\"23\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");
            Builder.Append("<col width=\"78\"/>");

            foreach (string IUSGId in DictSourceIUS.Keys)
            {
                //check here
                IndicatorGId = IUSGId.Split(new string[] { "@__@" }, StringSplitOptions.None)[0];
                UnitGId = IUSGId.Split(new string[] { "@__@" }, StringSplitOptions.None)[1];
                SubgroupValGId = IUSGId.Split(new string[] { "@__@" }, StringSplitOptions.None)[2];
                this.Get_SubgroupBreakup(SubgroupValGId, ref AgeGId, ref SexGId, ref LocationGId, SourceCodelistStructure, SelectedAgeCodelist, SelectedSexCodelist, SelectedLocationCodelist);
                Indicator = DictSourceIUS[IUSGId].ToString().Split(new string[] { "@__@" }, StringSplitOptions.None)[0];
                Unit = DictSourceIUS[IUSGId].ToString().Split(new string[] { "@__@" }, StringSplitOptions.None)[1];
                SubgroupVal = DictSourceIUS[IUSGId].ToString().Split(new string[] { "@__@" }, StringSplitOptions.None)[2];

                OriginalRowState = string.Empty;
                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowColor = "rgb(221, 255, 221);";
                    OriginalRowStatus = "mapped";
                }
                else
                {
                    OriginalRowColor = "rgb(255, 221, 221);";
                    OriginalRowStatus = "unmapped";
                }

                Builder.Append("<tr id=\"rowIUS_" + IUSGId + "\" style=\"background-color:" + OriginalRowColor + ");\" status=\"" + OriginalRowStatus + "\">");

                Builder.Append("<td style=\"width:110px; align:left; overflow:hidden;\">");
                Builder.Append("<span id=\"spanDevInfoIUSIndicatorName_" + IndicatorGId + "\" value=\"" + Indicator + "\" style=\"font-weight:bold;\" onmouseover=\"ShowCallout('divCallout', '" + Indicator + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + this.Get_TrimmedInnerHTML(Indicator, 25) + "</span>");// onmouseover=\"ShowCallout('divCallout', '" + Indicator + "', event);\" onmouseout=\"HideCallout('divCallout');
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\">");
                Builder.Append("<span id=\"spanDevInfoIUSUnitName_" + UnitGId + "\" value=\"" + Unit + "\"  onmouseover=\"ShowCallout('divCallout', '" + Unit + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + this.Get_TrimmedInnerHTML(Unit, 25) + "</span>");// onmouseover=\"ShowCallout('divCallout', '" + Unit + "', event);\" onmouseout=\"HideCallout('divCallout');
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\">");
                Builder.Append("<span id=\"spanDevInfoIUSSubgroupName_" + SubgroupValGId + "\" value=\"" + SubgroupVal + "\" onmouseover=\"ShowCallout('divCallout', '" + SubgroupVal + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + this.Get_TrimmedInnerHTML(SubgroupVal, 25) + "</span>");//onmouseover=\"ShowCallout('divCallout', '" + SubgroupVal + "', event);\" onmouseout=\"HideCallout('divCallout');
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:23px; align:left; overflow:hidden;\">");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    Builder.Append("<input type=\"checkbox\" id=\"chkIsMapped_" + IUSGId + "\" checked=\"checked\" value=\"" + IUSGId + "\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\"/>");
                    OriginalRowState += "true" + Constants.Delimiters.ParamDelimiter;
                }
                else
                {
                    Builder.Append("<input type=\"checkbox\" id=\"chkIsMapped_" + IUSGId + "\" value=\"" + IUSGId + "\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\"/>");
                    OriginalRowState += "false" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</td>");

                //Builder.Append("<td style=\"display:none;\">");
                //Builder.Append("<span style=\"display:none;\">" + DictMappingIndicator[IndicatorGId].ToString() + "</span>");
                //Builder.Append("</td>");
                //new
                Builder.Append("<td style=\"width:78px; align:left;overflow:hidden;\">");//
                Builder.Append("<select id=\"ddlUNSDIUSIndicator_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSIndicator_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[0] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[0] + "\" selected=\"selected\" title=\"" + DictTargetIndicator[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[0]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetIndicator[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[0]], 75) + "</option>");
                }
                else if (DictMappingIndicator.ContainsKey(IndicatorGId))
                {
                    OriginalRowState += DictMappingIndicator[IndicatorGId].ToString() + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIndicator[IndicatorGId] + "\" selected=\"selected\" title=\"" + DictTargetIndicator[DictMappingIndicator[IndicatorGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetIndicator[DictMappingIndicator[IndicatorGId]], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                //new
                Builder.Append("<td style=\"width:78px; align:left;overflow:hidden;\">");//
                Builder.Append("<select id=\"ddlUNSDIUSUnit_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSUnit_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[1] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[1] + "\" selected=\"selected\" title=\"" + DictTargetUnit[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[1]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnit[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[1]], 75) + "</option>");
                }
                else if (DictMappingUnit.ContainsKey(UnitGId))
                {
                    OriginalRowState += DictMappingUnit[UnitGId].ToString() + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingUnit[UnitGId] + "\" selected=\"selected\" title=\"" + DictTargetUnit[DictMappingUnit[UnitGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnit[DictMappingUnit[UnitGId]], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:78px; align:left;overflow:hidden; \">");//
                Builder.Append("<select id=\"ddlUNSDIUSAge_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSAge_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[2] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[2] + "\" selected=\"selected\" title=\"" + DictTargetAge[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[2]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetAge[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[2]], 75) + "</option>");
                }
                else if (DictMappingAge.ContainsKey(AgeGId))
                {
                    OriginalRowState += DictMappingAge[AgeGId].ToString() + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingAge[AgeGId] + "\" selected=\"selected\" title=\"" + DictTargetAge[DictMappingAge[AgeGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetAge[DictMappingAge[AgeGId]], 75) + "</option>");
                }
                else if (DictTargetAge.ContainsKey(Global.registryMappingAgeDefaultValue))
                {
                    OriginalRowState += Global.registryMappingAgeDefaultValue + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + Global.registryMappingAgeDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetAge[Global.registryMappingAgeDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetAge[Global.registryMappingAgeDefaultValue], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:78px; align:left;overflow:hidden; \">");//
                Builder.Append("<select id=\"ddlUNSDIUSSex_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSSex_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[3] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[3] + "\" selected=\"selected\" title=\"" + DictTargetSex[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[3]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSex[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[3]], 75) + "</option>");
                }
                else if (DictMappingSex.ContainsKey(SexGId))
                {
                    OriginalRowState += DictMappingSex[SexGId].ToString() + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingSex[SexGId] + "\" selected=\"selected\" title=\"" + DictTargetSex[DictMappingSex[SexGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSex[DictMappingSex[SexGId]], 75) + "</option>");
                }
                else if (DictTargetSex.ContainsKey(Global.registryMappingSexDefaultValue))
                {
                    OriginalRowState += Global.registryMappingSexDefaultValue + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + Global.registryMappingSexDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetSex[Global.registryMappingSexDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSex[Global.registryMappingSexDefaultValue], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");//
                Builder.Append("<select id=\"ddlUNSDIUSLocation_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSLocation_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[4] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[4] + "\" selected=\"selected\" title=\"" + DictTargetLocation[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[4]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetLocation[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[4]], 75) + "</option>");
                }
                else if (DictMappingLocation.ContainsKey(LocationGId))
                {
                    OriginalRowState += DictMappingLocation[LocationGId].ToString() + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingLocation[LocationGId] + "\" selected=\"selected\" title=\"" + DictTargetLocation[DictMappingLocation[LocationGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetLocation[DictMappingLocation[LocationGId]], 75) + "</option>");
                }
                else if (DictTargetLocation.ContainsKey(Global.registryMappingLocationDefaultValue))
                {
                    OriginalRowState += Global.registryMappingLocationDefaultValue + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + Global.registryMappingLocationDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetLocation[Global.registryMappingLocationDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetLocation[Global.registryMappingLocationDefaultValue], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");//
                Builder.Append("<select id=\"ddlUNSDIUSFrequency_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSFrequency_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[5] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[5] + "\" selected=\"selected\" title=\"" + DictTargetFrequency[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[5]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetFrequency[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[5]], 75) + "</option>");
                }
                else if (DictTargetFrequency.ContainsKey(Global.registryMappingFrequencyDefaultValue))
                {
                    OriginalRowState += Global.registryMappingFrequencyDefaultValue + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + Global.registryMappingFrequencyDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetFrequency[Global.registryMappingFrequencyDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetFrequency[Global.registryMappingFrequencyDefaultValue], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");//
                Builder.Append("<select id=\"ddlUNSDIUSSourceType_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSSourceType_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[6] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[6] + "\" selected=\"selected\" title=\"" + DictTargetSourceType[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[6]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSourceType[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[6]], 75) + "</option>");
                }
                else if (DictTargetSourceType.ContainsKey(Global.registryMappingSourceTypeDefaultValue))
                {
                    OriginalRowState += Global.registryMappingSourceTypeDefaultValue + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + Global.registryMappingSourceTypeDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetSourceType[Global.registryMappingSourceTypeDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSourceType[Global.registryMappingSourceTypeDefaultValue], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");//
                Builder.Append("<select id=\"ddlUNSDIUSNature_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSNature_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[7] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[7] + "\" selected=\"selected\" title=\"" + DictTargetNature[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[7]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetNature[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[7]], 75) + "</option>");
                }
                else if (DictTargetNature.ContainsKey(Global.registryMappingNatureDefaultValue))
                {
                    OriginalRowState += Global.registryMappingNatureDefaultValue + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + Global.registryMappingNatureDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetNature[Global.registryMappingNatureDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetNature[Global.registryMappingNatureDefaultValue], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:78px; align:left;overflow:hidden; \">");//
                Builder.Append("<select id=\"ddlUNSDIUSUnitMult_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
                Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSUnitMult_" + IUSGId + "\"></option>");

                if (DictMappingIUS.ContainsKey(IUSGId))
                {
                    OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[8] + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[8] + "\" selected=\"selected\" title=\"" + DictTargetUnitMult[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[8]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnitMult[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[8]], 75) + "</option>");
                }
                else if (DictTargetUnitMult.ContainsKey(Global.registryMappingUnitMultDefaultValue))
                {
                    OriginalRowState += Global.registryMappingUnitMultDefaultValue + Constants.Delimiters.ParamDelimiter;
                    Builder.Append("<option value=\"" + Global.registryMappingUnitMultDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetUnitMult[Global.registryMappingUnitMultDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnitMult[Global.registryMappingUnitMultDefaultValue], 75) + "</option>");
                }
                else
                {
                    OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
                }

                Builder.Append("</select>");
                Builder.Append("</td>");

                if (!string.IsNullOrEmpty(OriginalRowState))
                {
                    OriginalRowState = OriginalRowState.Substring(0, OriginalRowState.Length - Constants.Delimiters.ParamDelimiter.Length);
                    Builder = Builder.Replace("[**[ORIGINAL_ROW_STATE]**]", OriginalRowState);
                }

                Builder.Append("</tr>");
            }

            Builder.Append("</table>");
            Builder.Append("</div>");
            Builder.Append("</td>");

            Builder.Append("</tr>");
            Builder.Append("</table>");

            #region Start1 7 nov 2013
            //Builder.Append("<table id=\"tblIUSHeader\" style=\"width:100%; table-layout:fixed;\">");
            //Builder.Append("<col width=\"110\"/>");
            //Builder.Append("<col width=\"60\"/>");
            //Builder.Append("<col width=\"60\"/>");
            //Builder.Append("<col width=\"23\"/>");
            //Builder.Append("<col width=\"78\"/>");
            //Builder.Append("<col width=\"78\"/>");
            //Builder.Append("<col width=\"78\"/>");
            //Builder.Append("<col width=\"78\"/>");
            //Builder.Append("<col width=\"78\"/>");
            //Builder.Append("<col width=\"78\"/>");
            //Builder.Append("<col width=\"78\"/>");
            //Builder.Append("<col width=\"78\"/>");
            //Builder.Append("<col width=\"33\"/>");

            //Builder.Append("<tr style=\"height:30px;\">");

            //Builder.Append("<td colspan=\"7\" style=\"width:542px; align:left; overflow:hidden;\">");
            //Builder.Append("<a id=\"aShowIUSAll\" href=\"javascript:void(0);\" style=\"color:#000000;\" onclick=\"FilterRowsByStatus('tblIUS', 'aShowIUSAll', 'aShowIUSMapped', 'aShowIUSUnMapped', 'aShowIUSUnSaved', 'all');\"></a>");
            //Builder.Append("   |   ");
            //Builder.Append("<a id=\"aShowIUSMapped\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblIUS', 'aShowIUSAll', 'aShowIUSMapped', 'aShowIUSUnMapped', 'aShowIUSUnSaved', 'mapped');\"></a>&nbsp;");
            //Builder.Append("<span style=\"background-color:#bbffbb;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            //Builder.Append("   |   ");
            //Builder.Append("<a id=\"aShowIUSUnMapped\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblIUS', 'aShowIUSAll', 'aShowIUSMapped', 'aShowIUSUnMapped', 'aShowIUSUnSaved', 'unmapped');\"></a>&nbsp;");
            //Builder.Append("<span style=\"background-color:#ffbbbb;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            //Builder.Append("   |   ");
            //Builder.Append("<a id=\"aShowIUSUnSaved\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblIUS', 'aShowIUSAll', 'aShowIUSMapped', 'aShowIUSUnMapped', 'aShowIUSUnSaved', 'unsaved');\"></a>&nbsp;");
            //Builder.Append("<span style=\"background-color:#bbbbff;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            //Builder.Append("</td>");

            //Builder.Append("<td colspan=\"6\" style=\"width:358px; align:left; overflow:hidden;\">");
            //Builder.Append("<div id=\"divIUSSearch\">");
            //Builder.Append("<input id=\"txtIUSSearch\" type=\"text\"/>");
            //Builder.Append("</div>");
            //Builder.Append("</td>");

            //Builder.Append("</tr>");

            ////Grid Header
            //Builder.Append("<tr style=\"height:30px; background-color:#dddddd;\">");
            //Builder.Append("<td style=\"width:110px; align:left; overflow:hidden;\"><b id=\"lang_Indicator\"></b></td>");
            //Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\"><b id=\"lang_Unit\"></b></td>");
            //Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\"><b id=\"lang_Subgroup\"></b></td>");
            //Builder.Append("<td style=\"width:23px; align:left; overflow:hidden;\"><b id=\"lang_Mapped\"></b></td>");
            //Builder.Append("<td style=\"width:78px;\"><b id=\"lang_Indicator\">Indicator</b></td>");
            //Builder.Append("<td>");
            //Builder.Append("<b id=\"lang_Unit_UNSD\"></b>");
            //Builder.Append("</td>");
            //Builder.Append("<td>");
            //Builder.Append("<b id=\"lang_Age\"></b>");
            //Builder.Append("</td>");
            //Builder.Append("<td>");
            //Builder.Append("<b id=\"lang_Sex\"></b>");
            //Builder.Append("</td>");
            //Builder.Append("<td>");
            //Builder.Append("<b id=\"lang_Location\"></b>");
            //Builder.Append("</td>");
            //Builder.Append("<td>");
            //Builder.Append("<b id=\"lang_Frequency\"></b>");
            //Builder.Append("</td>");
            //Builder.Append("<td>");
            //Builder.Append("<b id=\"lang_SourceType\"></b>");
            //Builder.Append("</td>");
            //Builder.Append("<td>");
            //Builder.Append("<b id=\"lang_Nature\"></b>");
            //Builder.Append("</td>");
            //Builder.Append("<td>");
            //Builder.Append("<b id=\"lang_UnitMultiplier\"></b>");
            //Builder.Append("</td>");

            //Builder.Append("</tr>");

            //Builder.Append("</table>");

            #endregion Start1 Nov 7

            Builder.Append("</div>");

            //Builder.Append("<div style=\"\">");

            #region Start2 Nov 7

            // //Grid Data
            // Builder.Append("<table id=\"tblIUS\" style=\"width:100%; table-layout:fixed;\">");

            // //moved
            //#region DIV
            // Builder.Append("<tr>");//style=\"height:30px; background-color:#dddddd;\"
            // Builder.Append("<td style=\"width:110px; align:left; overflow:hidden;\"></td>");
            // Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\"></td>");
            // Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\"></td>");
            // Builder.Append("<td style=\"width:23px; align:left; overflow:hidden;\"><b id=\"lang_Mapped\" ></b></td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");

            // Builder.Append("<select id=\"ddlUNSDIUSIndicator\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetIndicator in DictTargetIndicator)
            // {
            //     Builder.Append("<option value=\"" + TargetIndicator.Key + "\" title=\"" + TargetIndicator.Value + "\">" + this.Get_TrimmedInnerHTML(TargetIndicator.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            // //Builder.Append("<b id=\"lang_Unit_UNSD\"></b>");

            // Builder.Append("<select id=\"ddlUNSDIUSUnit\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetUnit in DictTargetUnit)
            // {
            //     Builder.Append("<option value=\"" + TargetUnit.Key + "\" title=\"" + TargetUnit.Value + "\">" + this.Get_TrimmedInnerHTML(TargetUnit.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            // //Builder.Append("<b id=\"lang_Age\"></b>");

            // Builder.Append("<select id=\"ddlUNSDIUSAge\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetAge in DictTargetAge)
            // {
            //     Builder.Append("<option value=\"" + TargetAge.Key + "\" title=\"" + TargetAge.Value + "\">" + this.Get_TrimmedInnerHTML(TargetAge.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            // //Builder.Append("<b id=\"lang_Sex\"></b>");

            // Builder.Append("<select id=\"ddlUNSDIUSSex\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetSex in DictTargetSex)
            // {
            //     Builder.Append("<option value=\"" + TargetSex.Key + "\" title=\"" + TargetSex.Value + "\">" + this.Get_TrimmedInnerHTML(TargetSex.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            // //Builder.Append("<b id=\"lang_Location\"></b>");

            // Builder.Append("<select id=\"ddlUNSDIUSLocation\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetLocation in DictTargetLocation)
            // {
            //     Builder.Append("<option value=\"" + TargetLocation.Key + "\" title=\"" + TargetLocation.Value + "\">" + this.Get_TrimmedInnerHTML(TargetLocation.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            // //Builder.Append("<b id=\"lang_Frequency\"></b>");

            // Builder.Append("<select id=\"ddlUNSDIUSFrequency\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetFrequency in DictTargetFrequency)
            // {
            //     Builder.Append("<option value=\"" + TargetFrequency.Key + "\" title=\"" + TargetFrequency.Value + "\">" + this.Get_TrimmedInnerHTML(TargetFrequency.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            // //Builder.Append("<b id=\"lang_SourceType\"></b>");

            // Builder.Append("<select id=\"ddlUNSDIUSSourceType\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetSourceType in DictTargetSourceType)
            // {
            //     Builder.Append("<option value=\"" + TargetSourceType.Key + "\" title=\"" + TargetSourceType.Value + "\">" + this.Get_TrimmedInnerHTML(TargetSourceType.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            // //Builder.Append("<b id=\"lang_Nature\"></b>");

            // Builder.Append("<select id=\"ddlUNSDIUSNature\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetNature in DictTargetNature)
            // {
            //     Builder.Append("<option value=\"" + TargetNature.Key + "\" title=\"" + TargetNature.Value + "\">" + this.Get_TrimmedInnerHTML(TargetNature.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            // Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");
            // //Builder.Append("<b id=\"lang_UnitMultiplier\"></b>");

            // Builder.Append("<select id=\"ddlUNSDIUSUnitMult\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            // Builder.Append("<option value=\"-1\">Select</option>");

            // foreach (KeyValuePair<string, string> TargetUnitMult in DictTargetUnitMult)
            // {
            //     Builder.Append("<option value=\"" + TargetUnitMult.Key + "\" title=\"" + TargetUnitMult.Value + "\">" + this.Get_TrimmedInnerHTML(TargetUnitMult.Value, 75) + "</option>");
            // }

            // Builder.Append("</select>");
            // Builder.Append("</td>");

            //// Builder.Append("<td style=\"width:33px; align:left; overflow:hidden;\"></td>");

            // Builder.Append("</tr>");

            //#endregion DIV
            // //till here

            // Builder.Append("<col width=\"110\"/>");
            // Builder.Append("<col width=\"60\"/>");
            // Builder.Append("<col width=\"60\"/>");
            // Builder.Append("<col width=\"23\"/>");
            // Builder.Append("<col width=\"78\"/>");
            // Builder.Append("<col width=\"78\"/>");
            // Builder.Append("<col width=\"78\"/>");
            // Builder.Append("<col width=\"78\"/>");
            // Builder.Append("<col width=\"78\"/>");
            // Builder.Append("<col width=\"78\"/>");
            // Builder.Append("<col width=\"78\"/>");
            // Builder.Append("<col width=\"78\"/>");

            // foreach (string IUSGId in DictSourceIUS.Keys)
            // {
            //     //check here
            //     IndicatorGId = IUSGId.Split(new string[] { "@__@" }, StringSplitOptions.None)[0];
            //     UnitGId = IUSGId.Split(new string[] { "@__@" }, StringSplitOptions.None)[1];
            //     SubgroupValGId = IUSGId.Split(new string[] { "@__@" }, StringSplitOptions.None)[2];
            //     this.Get_SubgroupBreakup(SubgroupValGId, ref AgeGId, ref SexGId, ref LocationGId, SourceCodelistStructure, SelectedAgeCodelist, SelectedSexCodelist, SelectedLocationCodelist);
            //     Indicator = DictSourceIUS[IUSGId].ToString().Split(new string[] { "@__@" }, StringSplitOptions.None)[0];
            //     Unit = DictSourceIUS[IUSGId].ToString().Split(new string[] { "@__@" }, StringSplitOptions.None)[1];
            //     SubgroupVal = DictSourceIUS[IUSGId].ToString().Split(new string[] { "@__@" }, StringSplitOptions.None)[2];

            //     OriginalRowState = string.Empty;
            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowColor = "rgb(221, 255, 221);";
            //         OriginalRowStatus = "mapped";
            //     }
            //     else
            //     {
            //         OriginalRowColor = "rgb(255, 221, 221);";
            //         OriginalRowStatus = "unmapped";
            //     }

            //     Builder.Append("<tr id=\"rowIUS_" + IUSGId + "\" style=\"background-color:" + OriginalRowColor + ");\" status=\"" + OriginalRowStatus + "\">");

            //     Builder.Append("<td style=\"width:110px; align:left; overflow:hidden;\">");
            //     Builder.Append("<span id=\"spanDevInfoIUSIndicatorName_" + IndicatorGId + "\" value=\"" + Indicator + "\" style=\"font-weight:bold;\" onmouseover=\"ShowCallout('divCallout', '" + Indicator + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + this.Get_TrimmedInnerHTML(Indicator, 25) + "</span>");// onmouseover=\"ShowCallout('divCallout', '" + Indicator + "', event);\" onmouseout=\"HideCallout('divCallout');
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\">");
            //     Builder.Append("<span id=\"spanDevInfoIUSUnitName_" + UnitGId + "\" value=\"" + Unit + "\"  onmouseover=\"ShowCallout('divCallout', '" + Unit + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + this.Get_TrimmedInnerHTML(Unit, 25) + "</span>");// onmouseover=\"ShowCallout('divCallout', '" + Unit + "', event);\" onmouseout=\"HideCallout('divCallout');
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:60px; align:left; overflow:hidden;\">");
            //     Builder.Append("<span id=\"spanDevInfoIUSSubgroupName_" + SubgroupValGId + "\" value=\"" + SubgroupVal + "\" onmouseover=\"ShowCallout('divCallout', '" + SubgroupVal + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + this.Get_TrimmedInnerHTML(SubgroupVal, 25) + "</span>");//onmouseover=\"ShowCallout('divCallout', '" + SubgroupVal + "', event);\" onmouseout=\"HideCallout('divCallout');
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:23px; align:left; overflow:hidden;\">");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         Builder.Append("<input type=\"checkbox\" id=\"chkIsMapped_" + IUSGId + "\" checked=\"checked\" value=\"" + IUSGId + "\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\"/>");
            //         OriginalRowState += "true" + Constants.Delimiters.ParamDelimiter;
            //     }
            //     else
            //     {
            //         Builder.Append("<input type=\"checkbox\" id=\"chkIsMapped_" + IUSGId + "\" value=\"" + IUSGId + "\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\"/>");
            //         OriginalRowState += "false" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</td>");

            //     //Builder.Append("<td style=\"display:none;\">");
            //     //Builder.Append("<span style=\"display:none;\">" + DictMappingIndicator[IndicatorGId].ToString() + "</span>");
            //     //Builder.Append("</td>");
            //     //new
            //     Builder.Append("<td style=\"width:78px; align:left;overflow:hidden;\">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSIndicator_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSIndicator_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[0] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[0] + "\" selected=\"selected\" title=\"" + DictTargetIndicator[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[0]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetIndicator[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[0]], 75) + "</option>");
            //     }
            //     else if (DictMappingIndicator.ContainsKey(IndicatorGId))
            //     {
            //         OriginalRowState += DictMappingIndicator[IndicatorGId].ToString() + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIndicator[IndicatorGId]+ "\" selected=\"selected\" title=\"" + DictTargetIndicator[DictMappingIndicator[IndicatorGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetIndicator[DictMappingIndicator[IndicatorGId]], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     //new
            //     Builder.Append("<td style=\"width:78px; align:left;overflow:hidden;\">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSUnit_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSUnit_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[1] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[1] + "\" selected=\"selected\" title=\"" + DictTargetUnit[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[1]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnit[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[1]], 75) + "</option>");
            //     }
            //     else if (DictMappingUnit.ContainsKey(UnitGId))
            //     {
            //         OriginalRowState += DictMappingUnit[UnitGId].ToString() + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingUnit[UnitGId] + "\" selected=\"selected\" title=\"" + DictTargetUnit[DictMappingUnit[UnitGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnit[DictMappingUnit[UnitGId]], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:78px; align:left;overflow:hidden; \">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSAge_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSAge_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[2] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[2] + "\" selected=\"selected\" title=\"" + DictTargetAge[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[2]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetAge[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[2]], 75) + "</option>");
            //     }
            //     else if (DictMappingAge.ContainsKey(AgeGId))
            //     {
            //         OriginalRowState += DictMappingAge[AgeGId].ToString() + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingAge[AgeGId] + "\" selected=\"selected\" title=\"" + DictTargetAge[DictMappingAge[AgeGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetAge[DictMappingAge[AgeGId]], 75) + "</option>");
            //     }
            //     else if (DictTargetAge.ContainsKey(Global.registryMappingAgeDefaultValue))
            //     {
            //         OriginalRowState += Global.registryMappingAgeDefaultValue + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + Global.registryMappingAgeDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetAge[Global.registryMappingAgeDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetAge[Global.registryMappingAgeDefaultValue], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:78px; align:left;overflow:hidden; \">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSSex_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSSex_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[3] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[3] + "\" selected=\"selected\" title=\"" + DictTargetSex[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[3]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSex[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[3]], 75) + "</option>");
            //     }
            //     else if (DictMappingSex.ContainsKey(SexGId))
            //     {
            //         OriginalRowState += DictMappingSex[SexGId].ToString() + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingSex[SexGId] + "\" selected=\"selected\" title=\"" + DictTargetSex[DictMappingSex[SexGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSex[DictMappingSex[SexGId]], 75) + "</option>");
            //     }
            //     else if (DictTargetSex.ContainsKey(Global.registryMappingSexDefaultValue))
            //     {
            //         OriginalRowState += Global.registryMappingSexDefaultValue + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + Global.registryMappingSexDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetSex[Global.registryMappingSexDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSex[Global.registryMappingSexDefaultValue], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSLocation_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSLocation_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[4] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[4] + "\" selected=\"selected\" title=\"" + DictTargetLocation[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[4]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetLocation[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[4]], 75) + "</option>");
            //     }
            //     else if (DictMappingLocation.ContainsKey(LocationGId))
            //     {
            //         OriginalRowState += DictMappingLocation[LocationGId].ToString() + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingLocation[LocationGId] + "\" selected=\"selected\" title=\"" + DictTargetLocation[DictMappingLocation[LocationGId]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetLocation[DictMappingLocation[LocationGId]], 75) + "</option>");
            //     }
            //     else if (DictTargetLocation.ContainsKey(Global.registryMappingLocationDefaultValue))
            //     {
            //         OriginalRowState += Global.registryMappingLocationDefaultValue + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + Global.registryMappingLocationDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetLocation[Global.registryMappingLocationDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetLocation[Global.registryMappingLocationDefaultValue], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSFrequency_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSFrequency_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[5] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[5] + "\" selected=\"selected\" title=\"" + DictTargetFrequency[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[5]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetFrequency[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[5]], 75) + "</option>");
            //     }
            //     else if (DictTargetFrequency.ContainsKey(Global.registryMappingFrequencyDefaultValue))
            //     {
            //         OriginalRowState += Global.registryMappingFrequencyDefaultValue + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + Global.registryMappingFrequencyDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetFrequency[Global.registryMappingFrequencyDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetFrequency[Global.registryMappingFrequencyDefaultValue], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSSourceType_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSSourceType_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[6] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[6] + "\" selected=\"selected\" title=\"" + DictTargetSourceType[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[6]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSourceType[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[6]], 75) + "</option>");
            //     }
            //     else if (DictTargetSourceType.ContainsKey(Global.registryMappingSourceTypeDefaultValue))
            //     {
            //         OriginalRowState += Global.registryMappingSourceTypeDefaultValue + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + Global.registryMappingSourceTypeDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetSourceType[Global.registryMappingSourceTypeDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetSourceType[Global.registryMappingSourceTypeDefaultValue], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:78px; align:left; overflow:hidden;\">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSNature_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSNature_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[7] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[7] + "\" selected=\"selected\" title=\"" + DictTargetNature[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[7]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetNature[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[7]], 75) + "</option>");
            //     }
            //     else if (DictTargetNature.ContainsKey(Global.registryMappingNatureDefaultValue))
            //     {
            //         OriginalRowState += Global.registryMappingNatureDefaultValue + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + Global.registryMappingNatureDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetNature[Global.registryMappingNatureDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetNature[Global.registryMappingNatureDefaultValue], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     Builder.Append("<td style=\"width:78px; align:left;overflow:hidden; \">");//
            //     Builder.Append("<select id=\"ddlUNSDIUSUnitMult_" + IUSGId + "\" style=\"width:75px\" class=\"confg_frm_inp_bx_txt_dd\" onchange=\"HandleStateChange('rowIUS_" + IUSGId + "', '[**[ORIGINAL_ROW_STATE]**]', '" + OriginalRowColor + "', '" + OriginalRowStatus + "');\">");
            //     Builder.Append("<option value=\"-1\" id=\"SelectUNSDIUSUnitMult_" + IUSGId + "\"></option>");

            //     if (DictMappingIUS.ContainsKey(IUSGId))
            //     {
            //         OriginalRowState += DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[8] + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[8] + "\" selected=\"selected\" title=\"" + DictTargetUnitMult[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[8]] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnitMult[DictMappingIUS[IUSGId].Split(new string[] { "@__@" }, StringSplitOptions.None)[8]], 75) + "</option>");
            //     }
            //     else if (DictTargetUnitMult.ContainsKey(Global.registryMappingUnitMultDefaultValue))
            //     {
            //         OriginalRowState += Global.registryMappingUnitMultDefaultValue + Constants.Delimiters.ParamDelimiter;
            //         Builder.Append("<option value=\"" + Global.registryMappingUnitMultDefaultValue + "\" selected=\"selected\" title=\"" + DictTargetUnitMult[Global.registryMappingUnitMultDefaultValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnitMult[Global.registryMappingUnitMultDefaultValue], 75) + "</option>");
            //     }
            //     else
            //     {
            //         OriginalRowState += "-1" + Constants.Delimiters.ParamDelimiter;
            //     }

            //     Builder.Append("</select>");
            //     Builder.Append("</td>");

            //     if (!string.IsNullOrEmpty(OriginalRowState))
            //     {
            //         OriginalRowState = OriginalRowState.Substring(0, OriginalRowState.Length - Constants.Delimiters.ParamDelimiter.Length);
            //         Builder = Builder.Replace("[**[ORIGINAL_ROW_STATE]**]", OriginalRowState);
            //     }

            //     Builder.Append("</tr>");
            // }

            // Builder.Append("</table>");

            #endregion Start2 Nov 7
            //Builder.Append("</div>");
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }

        RetVal = Builder.ToString();
        return RetVal;
    }
    private bool CreateReportForUploadedDSD(SDMXApi_2_0.Message.StructureType UploadedDSDStructure, string sdmxFolderPath, int DbNId, string UserNId)
    {
        bool RetVal;
        RetVal = true;
        string AgencyId;
        AgencyId = string.Empty;

        try
        {
            AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + UserNId;
            DIExcel ReportExcel = new DIExcel();
            ReportExcel = this.GenerateDSDWorksheet(ReportExcel, 0, UploadedDSDStructure);
            ReportExcel = this.GenerateCodelistWorksheets(ReportExcel, 0, UploadedDSDStructure);

            ReportExcel.ActiveSheetIndex = 0;
            ReportExcel.SaveAs(sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Report.FileName);
            this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, DevInfo.Lib.DI_LibSDMX.Constants.Report.Id, AgencyId, DevInfo.Lib.DI_LibSDMX.Constants.Report.Version, string.Empty, ArtefactTypes.Report, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Report.FileName, DevInfo.Lib.DI_LibSDMX.Constants.Report.FileName);

        }
        catch (Exception ex)
        {
            RetVal = false;
            Global.CreateExceptionString(ex, null);
            //Global.WriteErrorsInLog("Creating Report For Uploaded DSD From Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);

        }
        finally
        {

        }

        return RetVal;
    }
Beispiel #18
0
    private string GetUnitMappingList(string DbNId, string Language, StructureType SourceCodelistStructure, SDMXApi_2_0.Message.StructureType TargetCodelistStructure, StructureType MappingCodelistStructure)
    {
        string RetVal;
        string DictSourceUnitValue, DictTargetUnitValue, DictMappingUnitValue, SourceUnitGId, TargetUnitGId;
        Dictionary<string, string> DictSourceUnit, DictTargetUnit, DictMappingUnit;
        StringBuilder Builder;

        RetVal = string.Empty;
        DictSourceUnitValue = string.Empty;
        DictTargetUnitValue = string.Empty;
        DictMappingUnitValue = string.Empty;
        SourceUnitGId = string.Empty;
        TargetUnitGId = string.Empty;

        DictSourceUnit = null;
        DictTargetUnit = null;
        DictMappingUnit = null;

        Builder = new StringBuilder(RetVal);
        string CodeListId = string.Empty;
        try
        {
            foreach (SDMXApi_2_0.Structure.DimensionType Dimensions in TargetCodelistStructure.KeyFamilies[0].Components.Dimension)
            {
                if (Dimensions.conceptRef == Constants.UNSD.Concept.Unit.Id)
                {
                    CodeListId = Dimensions.codelist;
                }
            }
            DictSourceUnit = this.Get_DictSourceCodelist(Language, DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Unit.Id, SourceCodelistStructure);
            DictTargetUnit = this.Get_DictTargetCodelist(Language, CodeListId, TargetCodelistStructure);
            DictMappingUnit = this.Get_DictMappingCodelist(DevInfo.Lib.DI_LibSDMX.Constants.StructureSet.CodelistMap.Unit.id, MappingCodelistStructure);

            Builder.Append("<div style=\"overflow-x:hidden;\">");

            Builder.Append("<table id=\"tblUnitHeader\" style=\"width:100%; table-layout:fixed;\">");
            //Builder.Append("<col width=\"267\"/>");
            //Builder.Append("<col width=\"179\"/>");
            //Builder.Append("<col width=\"267\"/>");
            //Builder.Append("<col width=\"179\"/>");
            //Builder.Append("<col width=\"18\"/>");

            Builder.Append("<col width=\"30%\"/>");
            Builder.Append("<col width=\"19%\"/>");
            Builder.Append("<col width=\"30%\"/>");
            Builder.Append("<col width=\"19%\"/>");
            Builder.Append("<col width=\"1%\"/>");

            Builder.Append("<tr style=\"height:30px;\">");

            Builder.Append("<td colspan=\"5\" style=\"width:100%; align:left; overflow:hidden;\">");
            Builder.Append("<a id=\"aShowUnitAll\" href=\"javascript:void(0);\" style=\"color:#000000;\" onclick=\"FilterRowsByStatus('tblUnit', 'aShowUnitAll', 'aShowUnitMapped', 'aShowUnitUnMapped', 'aShowUnitUnSaved', 'all');\"></a>");
            Builder.Append("   |   ");
            Builder.Append("<a id=\"aShowUnitMapped\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblUnit', 'aShowUnitAll', 'aShowUnitMapped', 'aShowUnitUnMapped', 'aShowUnitUnSaved', 'mapped');\"></a>&nbsp;");
            Builder.Append("<span style=\"background-color:#bbffbb;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            Builder.Append("   |   ");
            Builder.Append("<a id=\"aShowUnitUnMapped\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblUnit', 'aShowUnitAll', 'aShowUnitMapped', 'aShowUnitUnMapped', 'aShowUnitUnSaved', 'unmapped');\"></a>&nbsp;");
            Builder.Append("<span style=\"background-color:#ffbbbb;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            Builder.Append("   |   ");
            Builder.Append("<a id=\"aShowUnitUnSaved\" href=\"javascript:void(0);\" style=\"color:#1e90ff;\" onclick=\"FilterRowsByStatus('tblUnit', 'aShowUnitAll', 'aShowUnitMapped', 'aShowUnitUnMapped', 'aShowUnitUnSaved', 'unsaved');\"></a>&nbsp;");
            Builder.Append("<span style=\"background-color:#bbbbff;width:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
            Builder.Append("</td>");

            Builder.Append("</tr>");

            Builder.Append("<tr style=\"height:30px; background-color:#dddddd;\">");

            Builder.Append("<td style=\"width:30%; align:left; overflow:hidden;\">");
            Builder.Append("<b id=\"lang_DevInfo_Unit\"></b>");
            Builder.Append("<div id=\"divUnitSearch\">");
            Builder.Append("<input id=\"txtUnitSearch\" type=\"text\"/>");
            Builder.Append("</div>");
            Builder.Append("</td>");

            Builder.Append("<td style=\"width:19%; align:left; overflow:hidden; padding-bottom:30px;\"><b id=\"lang_Unit_GIds\"></b></td>");

            Builder.Append("<td style=\"width:30%; align:left; overflow:hidden;padding-bottom:30px;\">");
            Builder.Append("<b id=\"lang_UNSD_Unit\"></b>");
            //Builder.Append("<div id=\"divUnitFilter\">");
            //Builder.Append("<input id=\"txtUnitFilter\" type=\"text\"/>");
            //Builder.Append("</div>");

            Builder.Append("<select id=\"ddlUNSDUnit\" class=\"confg_frm_inp_bx_txt_dd\" style=\"display:none;\">");
            Builder.Append("<option value=\"-1\">Select</option>");

            foreach (KeyValuePair<string, string> TargetUnit in DictTargetUnit)
            {
                TargetUnitGId = TargetUnit.Key;
                DictTargetUnitValue = TargetUnit.Value;

                Builder.Append("<option value=\"" + TargetUnitGId + "\" title=\"" + DictTargetUnitValue + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnitValue, 75) + "</option>");
            }

            Builder.Append("</select>");

            Builder.Append("</td>");

            Builder.Append("<td style=\"width:19%; align:left; overflow:hidden;padding-bottom:30px;\"><b id=\"lang_Unit_Ids\"></b></td>");
            Builder.Append("<td style=\"width:1%; align:left; overflow:hidden;\"></td>");

            Builder.Append("</tr>");

            Builder.Append("</table>");

            Builder.Append("</div>");

            Builder.Append("<div style=\"overflow-y:auto; height:200px;\">");

            Builder.Append("<table id=\"tblUnit\" style=\"width:100%; table-layout:fixed;\">");
            Builder.Append("<col width=\"30%\"/>");
            Builder.Append("<col width=\"19%\"/>");
            Builder.Append("<col width=\"30%\"/>");
            Builder.Append("<col width=\"19%\"/>");

            foreach (KeyValuePair<string, string> Unit in DictSourceUnit)
            {
                DictSourceUnitValue = string.Empty;
                DictTargetUnitValue = string.Empty;
                DictMappingUnitValue = string.Empty;

                SourceUnitGId = Unit.Key;
                DictSourceUnitValue = Unit.Value;

                DictMappingUnit.TryGetValue(SourceUnitGId, out DictMappingUnitValue);

                if (!string.IsNullOrEmpty(DictMappingUnitValue))
                {
                    Builder.Append("<tr id=\"rowUnit_" + SourceUnitGId + "\" style=\"background-color:rgb(221, 255, 221)\" status=\"mapped\">");
                }
                else
                {
                    Builder.Append("<tr id=\"rowUnit_" + SourceUnitGId + "\" style=\"background-color:rgb(255, 221, 221)\" status=\"unmapped\">");
                }

                Builder.Append("<td style=\"width:30%; align:left; overflow:hidden;\">");
                Builder.Append("<span id=\"spanDevInfoUnitName_" + SourceUnitGId + "\" value=\"" + DictSourceUnitValue + "\" style=\"font-weight:bold;\" onmouseover=\"ShowCallout('divCallout', '" + DictSourceUnitValue + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + this.Get_TrimmedInnerHTML(DictSourceUnitValue, 75) + "</span>");//onmouseover=\"ShowCallout('divCallout', '" + DictSourceUnitValue + "', event);\" onmouseout=\"HideCallout('divCallout');
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:19%; align:left; overflow:hidden;\">");
                Builder.Append("<span id=\"spanDevInfoUnitGId_" + SourceUnitGId + "\" value=\"" + SourceUnitGId + "\" onmouseover=\"ShowCallout('divCallout', '" + SourceUnitGId + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + SourceUnitGId + "</span>");// onmouseover=\"ShowCallout('divCallout', '" + SourceUnitGId + "', event);\" onmouseout=\"HideCallout('divCallout');
                Builder.Append("</td>");

                Builder.Append("<td style=\"width:30%; align:left; \">");//overflow:hidden;

                if (!string.IsNullOrEmpty(DictMappingUnitValue))
                {// claass chzn-select
                    Builder.Append("<select id=\"ddlUNSDUnit_" + SourceUnitGId + "\" class=\"cus_slct_dd\" style=\"width:245px; opacity:0.01;z-index:1000;position:relative\" onchange=\"SelectCodelistCode('tblUnit', 'rowUnit_" + SourceUnitGId + "', 'spanUNSDUnitGId_" + SourceUnitGId + "', this, '" + DictMappingUnitValue + "', 'rgb(221, 255, 221)', 'mapped');\">");
                    Builder.Append("<option value=\"-1\" id=\"SelectUNSDUnit_" + SourceUnitGId + "\"></option>");
                    Builder.Append("<option value=\"" + DictMappingUnitValue + "\" selected=\"selected\" title=\"" + DictTargetUnit[DictMappingUnitValue] + "\">" + this.Get_TrimmedInnerHTML(DictTargetUnit[DictMappingUnitValue], 75) + "</option>");
                }
                else
                {//class chzn-select
                    Builder.Append("<select id=\"ddlUNSDUnit_" + SourceUnitGId + "\" class=\"cus_slct_dd\" style=\"width:245px;opacity:0.01;z-index:1000;\" onchange=\"SelectCodelistCode('tblUnit', 'rowUnit_" + SourceUnitGId + "', 'spanUNSDUnitGId_" + SourceUnitGId + "', this, '-1', 'rgb(255, 221, 221)', 'unmapped');\">");
                    Builder.Append("<option value=\"-1\" selected=\"selected\" id=\"SelectUNSDUnit_" + SourceUnitGId + "\"></option>");
                }

                Builder.Append("</select>");
                //Builder.Append("<div id=\"remove_ddlUNSDUnit_" + SourceUnitGId + "\"  class=\"cus_slct_dd chzn-select\" style=\"width:235px;top:-25px;font-size: 12px;\" >Select</div>");
                if (string.IsNullOrEmpty(DictMappingUnitValue))
                {
                    Builder.Append("<div id=\"remove_ddlUNSDUnit_" + SourceUnitGId + "\"  class=\"cus_slct_dd chzn-select\" style=\"width:235px;top:-25px;font-size: 12px;\" >Select</div>");
                }
                else
                {
                    Builder.Append("<div id=\"remove_ddlUNSDUnit_" + SourceUnitGId + "\"  class=\"cus_slct_dd chzn-select\" style=\"width:235px;top:-25px;font-size: 12px;\" >" + this.Get_TrimmedInnerHTML(DictTargetUnit[DictMappingUnitValue], 75) + "</div>");
                }

                Builder.Append("</td>");

                Builder.Append("<td style=\"width:169px; align:left; overflow:hidden;\">");

                if (!string.IsNullOrEmpty(DictMappingUnitValue))
                {
                    Builder.Append("<span id=\"spanUNSDUnitGId_" + SourceUnitGId + "\" value=\"" + DictMappingUnitValue + "\" onmouseover=\"ShowCallout('divCallout', '" + DictMappingUnitValue + "', event);\" onmouseout=\"HideCallout('divCallout');\">" + DictMappingUnitValue + "</span>");// onmouseover=\"ShowCallout('divCallout', '" + DictMappingUnitValue + "', event);\" onmouseout=\"HideCallout('divCallout');
                }
                else
                {
                    Builder.Append("<span id=\"spanUNSDUnitGId_" + SourceUnitGId + "\"></span>");
                }

                Builder.Append("</td>");

                Builder.Append("</tr>");
            }

            Builder.Append("</table>");

            Builder.Append("</div>");
        }
        catch (Exception ex)
        {
            Builder.Append("false" + Constants.Delimiters.ParamDelimiter + ex.Message);
            Global.CreateExceptionString(ex, null);

        }
        finally
        {
        }

        RetVal = Builder.ToString();
        return RetVal;
    }
    private DIExcel GenerateDSDWorksheet(DIExcel ReportExcel, int SheetIndex, SDMXApi_2_0.Message.StructureType CompleteStructure)
    {
        int i, j;
        IWorksheet DSDWorkSheet = null;
        int rowindex = 0;
        string Language, AttributeImportance;
        Language = string.Empty;
        AttributeImportance = string.Empty;

        try
        {
            // Language = CompleteStructure.Concepts.Concept[0].Name[0].lang;
            if (CompleteStructure.Concepts.Concept.Count > 0)
            {
                Language = CompleteStructure.Concepts.Concept[0].Name[0].lang;
            }
            else if (CompleteStructure.Concepts.ConceptScheme.Count > 0)
            {
                Language = CompleteStructure.Concepts.ConceptScheme[0].Name[0].lang;
            }

            DSDWorkSheet = ReportExcel.GetWorksheet(0);
            ReportExcel.RenameWorkSheet(0, "DSD");
            rowindex = rowindex + 1;
            this.WriteValueInCell(ReportExcel, "Data Structure Definition", rowindex, 1, 14, true, 30, 0, 0);
            rowindex = rowindex + 2;

            //Binding Dimensions
            this.WriteValueInCell(ReportExcel, "Dimensions", rowindex, 1, 12, true, 30, 0, 0);
            rowindex = rowindex + 2;
            if (CompleteStructure.Concepts.Concept.Count > 0)
            {
                for (i = 0; i < CompleteStructure.KeyFamilies[0].Components.Dimension.Count; i++)
                {
                    for (j = 0; j < CompleteStructure.Concepts.Concept.Count; j++)
                    {
                        if (CompleteStructure.Concepts.Concept[j].id == CompleteStructure.KeyFamilies[0].Components.Dimension[i].conceptRef)
                        {
                            this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.Concept[j].Name, Language), rowindex, 1, 10, false, 30, 0, 0);
                            this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.Concept[j].Description, Language), rowindex, 2, 10, false, 250, 0, 0);
                            rowindex = rowindex + 1;
                            break;
                        }
                    }

                }
            }
            else if (CompleteStructure.Concepts.ConceptScheme.Count > 0)
            {
                for (i = 0; i < CompleteStructure.KeyFamilies[0].Components.Dimension.Count; i++)
                {
                    for (j = 0; j < CompleteStructure.Concepts.ConceptScheme.Count; j++)
                    {
                        for (int k = 0; k < CompleteStructure.Concepts.ConceptScheme[j].Concept.Count; k++)
                        {
                            if (CompleteStructure.Concepts.ConceptScheme[j].Concept[k].id == CompleteStructure.KeyFamilies[0].Components.Dimension[i].conceptRef)
                            {
                                this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.ConceptScheme[j].Concept[k].Name, Language), rowindex, 1, 10, false, 30, 0, 0);
                                this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.ConceptScheme[j].Concept[k].Description, Language), rowindex, 2, 10, false, 250, 0, 0);
                                rowindex = rowindex + 1;
                                break;
                            }
                        }

                    }

                }
            }

            //Binding Time Dimension

            if (CompleteStructure.Concepts.Concept.Count > 0)
            {
                for (j = 0; j < CompleteStructure.Concepts.Concept.Count; j++)
                {
                    if (CompleteStructure.Concepts.Concept[j].id == CompleteStructure.KeyFamilies[0].Components.TimeDimension.conceptRef)
                    {
                        this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.Concept[j].Name, Language), rowindex, 1, 10, false, 30, 0, 0);
                        this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.Concept[j].Description, Language), rowindex, 2, 10, false, 250, 0, 0);
                        rowindex = rowindex + 1;
                        break;
                    }
                }
            }

            else if (CompleteStructure.Concepts.ConceptScheme.Count > 0)
            {
                for (j = 0; j < CompleteStructure.Concepts.ConceptScheme.Count; j++)
                {
                    for (int k = 0; k < CompleteStructure.Concepts.ConceptScheme[j].Concept.Count; k++)
                    {
                        if (CompleteStructure.Concepts.ConceptScheme[j].Concept[k].id == CompleteStructure.KeyFamilies[0].Components.TimeDimension.conceptRef)
                        {
                            this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.ConceptScheme[j].Concept[k].Name, Language), rowindex, 1, 10, false, 30, 0, 0);
                            this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.ConceptScheme[j].Concept[k].Description, Language), rowindex, 2, 10, false, 250, 0, 0);
                            rowindex = rowindex + 1;
                            break;
                        }
                    }
                }
            }

            rowindex = rowindex + 2;

            //Binding Attributes

            this.WriteValueInCell(ReportExcel, "Attributes", rowindex, 1, 12, true, 30, 0, 0);
            rowindex = rowindex + 2;

            if (CompleteStructure.Concepts.Concept.Count > 0)
            {
                for (i = 0; i < CompleteStructure.KeyFamilies[0].Components.Attribute.Count; i++)
                {
                    for (j = 0; j < CompleteStructure.Concepts.Concept.Count; j++)
                    {
                        if (CompleteStructure.Concepts.Concept[j].id == CompleteStructure.KeyFamilies[0].Components.Attribute[i].conceptRef)
                        {
                            this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.Concept[j].Name, Language), rowindex, 1, 10, false, 30, 0, 0);
                            this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.Concept[j].Description, Language), rowindex, 2, 10, false, 250, 0, 0);
                            rowindex = rowindex + 1;
                            this.WriteValueInCell(ReportExcel, "Attachment Level : " + CompleteStructure.KeyFamilies[0].Components.Attribute[i].attachmentLevel, rowindex, 1, 10, false, 30, 0, 0);

                            if (CompleteStructure.KeyFamilies[0].Components.Attribute[i].assignmentStatus == SDMXApi_2_0.Structure.AssignmentStatusType.Mandatory)
                            {
                                AttributeImportance = "Mandatory : " + "Yes";
                            }
                            else
                            {
                                AttributeImportance = "Mandatory : " + "No";
                            }
                            this.WriteValueInCell(ReportExcel, AttributeImportance, rowindex, 2, 10, false, 30, 0, 0);
                            rowindex = rowindex + 2;

                            break;
                        }
                    }

                }
            }
            else if (CompleteStructure.Concepts.ConceptScheme.Count > 0)
            {
                for (i = 0; i < CompleteStructure.KeyFamilies[0].Components.Attribute.Count; i++)
                {
                    for (j = 0; j < CompleteStructure.Concepts.ConceptScheme.Count; j++)
                    {
                        for (int k = 0; k < CompleteStructure.Concepts.ConceptScheme[j].Concept.Count; k++)
                        {
                            if (CompleteStructure.Concepts.ConceptScheme[j].Concept[k].id == CompleteStructure.KeyFamilies[0].Components.Attribute[i].conceptRef)
                            {
                                this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.ConceptScheme[j].Concept[k].Name, Language), rowindex, 1, 10, false, 30, 0, 0);
                                this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.ConceptScheme[j].Concept[k].Description, Language), rowindex, 2, 10, false, 250, 0, 0);
                                rowindex = rowindex + 1;
                                this.WriteValueInCell(ReportExcel, "Attachment Level : " + CompleteStructure.KeyFamilies[0].Components.Attribute[i].attachmentLevel, rowindex, 1, 10, false, 30, 0, 0);

                                if (CompleteStructure.KeyFamilies[0].Components.Attribute[i].assignmentStatus == SDMXApi_2_0.Structure.AssignmentStatusType.Mandatory)
                                {
                                    AttributeImportance = "Mandatory : " + "Yes";
                                }
                                else
                                {
                                    AttributeImportance = "Mandatory : " + "No";
                                }
                                this.WriteValueInCell(ReportExcel, AttributeImportance, rowindex, 2, 10, false, 30, 0, 0);
                                rowindex = rowindex + 2;

                                break;
                            }
                        }

                    }

                }
            }

            rowindex = rowindex + 1;

            //Binding Measure
            this.WriteValueInCell(ReportExcel, "Measure", rowindex, 1, 12, true, 30, 0, 0);

            rowindex = rowindex + 1;
            if (CompleteStructure.Concepts.Concept.Count > 0)
            {
                for (j = 0; j < CompleteStructure.Concepts.Concept.Count; j++)
                {
                    if (CompleteStructure.Concepts.Concept[j].id == CompleteStructure.KeyFamilies[0].Components.PrimaryMeasure.conceptRef)
                    {
                        this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.Concept[j].Name, Language), rowindex, 1, 10, false, 30, 0, 0);
                        this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.Concept[j].Description, Language), rowindex, 2, 10, false, 250, 0, 0);
                        rowindex = rowindex + 1;
                        break;
                    }
                }
            }
            else if (CompleteStructure.Concepts.ConceptScheme.Count > 0)
            {
                for (j = 0; j < CompleteStructure.Concepts.ConceptScheme.Count; j++)
                {
                    if (CompleteStructure.Concepts.ConceptScheme[j].id == CompleteStructure.KeyFamilies[0].Components.PrimaryMeasure.conceptSchemeRef)
                    {
                        for (int k = 0; k < CompleteStructure.Concepts.ConceptScheme[j].Concept.Count; k++)
                        {
                            if (CompleteStructure.Concepts.ConceptScheme[j].Concept[k].id == CompleteStructure.KeyFamilies[0].Components.PrimaryMeasure.conceptRef)
                            {
                                this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.ConceptScheme[j].Concept[k].Name, Language), rowindex, 1, 10, false, 30, 0, 0);
                                this.WriteValueInCell(ReportExcel, GetLangSpecificValueFor_Version_2_0(CompleteStructure.Concepts.ConceptScheme[j].Concept[k].Description, Language), rowindex, 2, 10, false, 250, 0, 0);
                                rowindex = rowindex + 1;
                                break;
                            }
                        }
                    }
                }
            }

        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);
            throw ex;
        }
        finally
        {
        }

        return ReportExcel;
    }
Beispiel #20
0
    private void Get_Codelist_Source_Target_Structure(string DbNId, out StructureType SourceCodelistStructure, out SDMXApi_2_0.Message.StructureType TargetCodelistStructure)
    {
        string AssociatedDbNId, SourceCodelistFileNameWPath, TargetCodelistFileNameWPath;

        AssociatedDbNId = string.Empty;
        SourceCodelistFileNameWPath = string.Empty;
        TargetCodelistFileNameWPath = string.Empty;

        SourceCodelistStructure = null;
        TargetCodelistStructure = null;

        try
        {
            AssociatedDbNId = Get_AssociatedDB_NId(DbNId).ToString();
            if (Convert.ToInt32(AssociatedDbNId) < 1)
            {
                SourceCodelistFileNameWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId + "\\" + Constants.FolderName.SDMX.sdmx + DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName);
            }
            else
            {
                SourceCodelistFileNameWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + AssociatedDbNId + "\\" + Constants.FolderName.SDMX.sdmx + DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName);
                TargetCodelistFileNameWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId + "\\" + Constants.FolderName.SDMX.sdmx + DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName);
            }
            //  SourceCodelistFileNameWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + AssociatedDbNId + "\\" + Constants.FolderName.SDMX.sdmx + DevInfo.Lib.DI_LibSDMX.Constants.Complete_XML.FileName);

            if (File.Exists(SourceCodelistFileNameWPath))
            {
                SourceCodelistStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), SourceCodelistFileNameWPath);
            }

            if (File.Exists(TargetCodelistFileNameWPath))
            {
                TargetCodelistStructure = (SDMXApi_2_0.Message.StructureType)SDMXApi_2_0.Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), TargetCodelistFileNameWPath);
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }
    }
 private void Remove_Extra_Annotations_From_Child_Categories(SDMXApi_2_0.Structure.CategoryType ParentCategory)
 {
     foreach (SDMXApi_2_0.Structure.CategoryType ChildCategory in ParentCategory.Category)
     {
         ChildCategory.Annotations = null;
         this.Remove_Extra_Annotations_From_Child_Categories(ChildCategory);
     }
 }
Beispiel #22
0
    private void Get_TargetIdAgencyIdVersionCodelist(string CodelistId, out string TargetId, out string TargetAgencyId, out string TargetVersion, SDMXApi_2_0.Message.StructureType Structure)
    {
        SDMXApi_2_0.Structure.CodeListType TargetCodelist;

        TargetCodelist = null;

        TargetId = string.Empty;
        TargetAgencyId = string.Empty;
        TargetVersion = string.Empty;

        try
        {
            if (Structure != null && Structure.CodeLists != null && Structure.CodeLists.Count > 0)
            {
                foreach (SDMXApi_2_0.Structure.CodeListType Codelist in Structure.CodeLists)
                {
                    if (Codelist.id == CodelistId)
                    {
                        TargetCodelist = Codelist;
                        break;
                    }

                }

                TargetId = TargetCodelist.id;
                TargetAgencyId = TargetCodelist.agencyID;
                TargetVersion = TargetCodelist.version;
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }
    }
    private bool UpdateCodelistsForUploadedDSDWithHeader(SDMXApi_2_0.Message.HeaderType Header, string DbNId, string UserNId, string CodelistsFolderPath)
    {
        bool RetVal;
        SDMXApi_2_0.Message.StructureType CodelistStructure;
        RetVal = true;
        try
        {

            string[] Files = Directory.GetFiles(CodelistsFolderPath);
            foreach (string codilistFile in Files)
            {
                CodelistStructure = new SDMXApi_2_0.Message.StructureType();
                CodelistStructure = (SDMXApi_2_0.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), codilistFile);
                CodelistStructure.Header = Header;
                CodelistStructure.OrganisationSchemes = null;
                CodelistStructure.HierarchicalCodelists = null;
                CodelistStructure.Concepts = null;
                CodelistStructure.Metadataflows = null;
                CodelistStructure.MetadataStructureDefinitions = null;
                CodelistStructure.Processes = null;
                CodelistStructure.ReportingTaxonomies = null;
                CodelistStructure.StructureSets = null;
                CodelistStructure.CategorySchemes = null;
                CodelistStructure.KeyFamilies = null;
                CodelistStructure.Dataflows = null;
                // Global.deleteFiles(codilistFile);
                Remove_Extra_Annotations(CodelistStructure);
                SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), CodelistStructure, codilistFile);
            }

        }
        catch (Exception ex)
        {
            //Global.WriteErrorsInLog("Creating Codelists For Uploaded DSD from Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);
            RetVal = false;
            Global.CreateExceptionString(ex, null);
        }
        finally
        {

        }

        return RetVal;
    }
    private bool CreateArtefactsForUploadedDSD(SDMXApi_2_0.Message.StructureType UploadedDSDStructure, string sdmxFolderPath, int DbNId, string UserNId)
    {
        bool RetVal;
        SDMXApi_2_0.Message.StructureType Concepts;
        SDMXApi_2_0.Message.StructureType DSD;
        SDMXApi_2_0.Message.StructureType MSD;
        SDMXApi_2_0.Message.StructureType MSDConcepts;
        SDMXApi_2_0.Message.StructureType Summary;
        List<ArtefactInfo> Artefacts, PAArtefacts;
        string AgencyId, AgencyName, Language, MFDDFolderPathInMetadataFolder;
        string AppPhysicalPath;
        string DbFolder;
        string FolderName;
        string ConsumerFileName, ProviderFileName;
        SDMXObjectModel.Message.StructureType Structure;

        RetVal = true;
        AgencyId = string.Empty;
        AgencyName = string.Empty;
        Language = string.Empty;
        MFDDFolderPathInMetadataFolder = string.Empty;
        ConsumerFileName = string.Empty;
        ProviderFileName = string.Empty;
        Structure = null;

        try
        {
            //Language = UploadedDSDStructure.Concepts.Concept[0].Name[0].lang;
            Language = UploadedDSDStructure.CodeLists[0].Name[0].lang;

            AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + UserNId;
            AgencyName = Global.GetDbDetails(DbNId.ToString(), Language)[0];
            AppPhysicalPath = HttpContext.Current.Request.PhysicalApplicationPath;
            DbFolder = Constants.FolderName.Data + DbNId.ToString() + "\\";

            Concepts = new SDMXApi_2_0.Message.StructureType();
            DSD = new SDMXApi_2_0.Message.StructureType();

            Summary = new SDMXApi_2_0.Message.StructureType();

            if (UploadedDSDStructure.Concepts != null)
            {
                Concepts.Header = UploadedDSDStructure.Header;
                Concepts.Concepts = UploadedDSDStructure.Concepts;
                Summary.Concepts = UploadedDSDStructure.Concepts;
            }
            DSD.Header = UploadedDSDStructure.Header;
            Summary.Header = UploadedDSDStructure.Header;

            DSD.KeyFamilies = UploadedDSDStructure.KeyFamilies;

            Summary.KeyFamilies = UploadedDSDStructure.KeyFamilies;
            Summary.MetadataStructureDefinitions = UploadedDSDStructure.MetadataStructureDefinitions;
            Summary.CodeLists = UploadedDSDStructure.CodeLists;

            foreach (SDMXApi_2_0.Structure.CodeListType CodeList in Summary.CodeLists)
            {
                CodeList.Code = null;
            }

            Summary.OrganisationSchemes = null;
            Summary.HierarchicalCodelists = null;
            Summary.Metadataflows = null;
            Summary.Processes = null;
            Summary.ReportingTaxonomies = null;
            Summary.StructureSets = null;
            Summary.CategorySchemes = null;
            Summary.Dataflows = null;

            //Creating Summary file and saving its information in the Database.mdb
            SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), Summary, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Summary_XML.FileName);
            this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, DevInfo.Lib.DI_LibSDMX.Constants.Summary_XML.Id, AgencyId, DevInfo.Lib.DI_LibSDMX.Constants.Summary_XML.Version, string.Empty, ArtefactTypes.Summary, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Summary_XML.FileName, DevInfo.Lib.DI_LibSDMX.Constants.Summary_XML.FileName);

            DSD.OrganisationSchemes = null;
            DSD.HierarchicalCodelists = null;
            DSD.Concepts = null;
            DSD.Metadataflows = null;
            DSD.MetadataStructureDefinitions = null;
            DSD.Processes = null;
            DSD.ReportingTaxonomies = null;
            DSD.StructureSets = null;
            DSD.CategorySchemes = null;
            DSD.CodeLists = null;
            DSD.Dataflows = null;

            if (UploadedDSDStructure.MetadataStructureDefinitions != null)
            {
                if (UploadedDSDStructure.MetadataStructureDefinitions.Count > 0)
                {
                    foreach (SDMXApi_2_0.Structure.MetadataStructureDefinitionType MetadataStructureDefinition in UploadedDSDStructure.MetadataStructureDefinitions)
                    {
                        MSD = new SDMXApi_2_0.Message.StructureType();
                        MSD.Header = UploadedDSDStructure.Header;
                        MSD.MetadataStructureDefinitions = new List<SDMXApi_2_0.Structure.MetadataStructureDefinitionType>();
                        MSD.MetadataStructureDefinitions.Add(new SDMXApi_2_0.Structure.MetadataStructureDefinitionType());
                        MSD.MetadataStructureDefinitions[0] = MetadataStructureDefinition;
                        MSD.OrganisationSchemes = null;
                        MSD.HierarchicalCodelists = null;
                        MSD.Concepts = null;
                        MSD.Metadataflows = null;
                        MSD.KeyFamilies = null;
                        MSD.Processes = null;
                        MSD.ReportingTaxonomies = null;
                        MSD.StructureSets = null;
                        MSD.CategorySchemes = null;
                        MSD.CodeLists = null;
                        MSD.Dataflows = null;
                        //Creating MSD and saving its information in the Database.mdb
                        SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), MSD, sdmxFolderPath + "\\MSD\\" + MSD.MetadataStructureDefinitions[0].id + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);
                        this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, MSD.MetadataStructureDefinitions[0].id, MSD.MetadataStructureDefinitions[0].agencyID, MSD.MetadataStructureDefinitions[0].version, string.Empty, ArtefactTypes.MSD, sdmxFolderPath + "\\" + MSD.MetadataStructureDefinitions[0].id + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension, MSD.MetadataStructureDefinitions[0].id + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);

                        //Creating MFD and saving its information in the Database.mdb
                        this.Generate_MFD("MF_" + MetadataStructureDefinition.id, AgencyId, DevInfo.Lib.DI_LibSDMX.Constants.MFD.Area.Version, "DevInfo Metadata Flow for " + GetLangSpecificValueFor_Version_2_0(MetadataStructureDefinition.Name, Language), DevInfo.Lib.DI_LibSDMX.Constants.MFD.Area.Description, Language, MetadataStructureDefinition.id, MetadataStructureDefinition.agencyID, MetadataStructureDefinition.version, sdmxFolderPath, DbNId);

                        //----------------------Creation of a MSD folder for uploaded DSD -----------------------------------------------
                        MFDDFolderPathInMetadataFolder = sdmxFolderPath + "\\" + "Metadata" + "\\" + "MF_" + MetadataStructureDefinition.id;
                        if (!(Directory.Exists(MFDDFolderPathInMetadataFolder)))
                        {
                            Directory.CreateDirectory(MFDDFolderPathInMetadataFolder);
                        }
                    }
                }
            }

            if (UploadedDSDStructure.Concepts.ConceptScheme != null)
            {
                if (UploadedDSDStructure.Concepts.ConceptScheme.Count > 0)
                {
                    foreach (SDMXApi_2_0.Structure.ConceptSchemeType ConceptScheme in UploadedDSDStructure.Concepts.ConceptScheme)
                    {
                        MSDConcepts = new SDMXApi_2_0.Message.StructureType();
                        MSDConcepts.Header = UploadedDSDStructure.Header;
                        MSDConcepts.Concepts.ConceptScheme = new List<SDMXApi_2_0.Structure.ConceptSchemeType>();
                        MSDConcepts.Concepts.ConceptScheme.Add(new SDMXApi_2_0.Structure.ConceptSchemeType());
                        MSDConcepts.Concepts.ConceptScheme[0] = ConceptScheme;
                        MSDConcepts.Concepts.Concept = null;
                        MSDConcepts.MetadataStructureDefinitions = null;
                        MSDConcepts.OrganisationSchemes = null;
                        MSDConcepts.HierarchicalCodelists = null;
                        MSDConcepts.Metadataflows = null;
                        MSDConcepts.KeyFamilies = null;
                        MSDConcepts.Processes = null;
                        MSDConcepts.ReportingTaxonomies = null;
                        MSDConcepts.StructureSets = null;
                        MSDConcepts.CategorySchemes = null;
                        MSDConcepts.CodeLists = null;
                        MSDConcepts.Dataflows = null;

                        //Creating MSDConcepts and saving its information in the Database.mdb
                        SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), MSDConcepts, sdmxFolderPath + "\\Concepts\\" + MSDConcepts.Concepts.ConceptScheme[0].id + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);
                        this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, string.Empty, MSDConcepts.Concepts.ConceptScheme[0].agencyID, MSDConcepts.Concepts.ConceptScheme[0].version, string.Empty, ArtefactTypes.ConceptS, sdmxFolderPath + "\\Concepts\\" + MSDConcepts.Concepts.ConceptScheme[0].id + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension, MSDConcepts.Concepts.ConceptScheme[0].id + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);

                    }

                }
            }
            if (UploadedDSDStructure.Concepts != null)
            {
                if (UploadedDSDStructure.Concepts.Concept.Count > 0)
                {
                    Concepts.OrganisationSchemes = null;
                    Concepts.HierarchicalCodelists = null;
                    Concepts.KeyFamilies = null;
                    Concepts.Metadataflows = null;
                    Concepts.MetadataStructureDefinitions = null;
                    Concepts.Processes = null;
                    Concepts.ReportingTaxonomies = null;
                    Concepts.StructureSets = null;
                    Concepts.CategorySchemes = null;
                    Concepts.CodeLists = null;
                    Concepts.Dataflows = null;
                    Concepts.Concepts.ConceptScheme = null;

                    //Creating Concepts and saving its information in the Database.mdb
                    SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), Concepts, sdmxFolderPath + "\\Concepts\\" + DevInfo.Lib.DI_LibSDMX.Constants.ConceptScheme.DSD.FileName);
                    this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, string.Empty, Concepts.Concepts.Concept[0].agencyID, Concepts.Concepts.Concept[0].version, string.Empty, ArtefactTypes.ConceptS, sdmxFolderPath + "\\Concepts\\" + DevInfo.Lib.DI_LibSDMX.Constants.ConceptScheme.DSD.FileName, DevInfo.Lib.DI_LibSDMX.Constants.ConceptScheme.DSD.FileName);
                }
            }
            //Creating DSD and saving its information in the Database.mdb
            SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), DSD, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.DSD.FileName);
            this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, DSD.KeyFamilies[0].id, DSD.KeyFamilies[0].agencyID, DSD.KeyFamilies[0].version, string.Empty, ArtefactTypes.DSD, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.DSD.FileName, DevInfo.Lib.DI_LibSDMX.Constants.DSD.FileName);

            //Creating DFD and saving its information in the Database.mdb
            Artefacts = SDMXUtility.Generate_DFD(SDMXSchemaType.Two_One, UploadedDSDStructure.KeyFamilies[0].id, AgencyId, null, sdmxFolderPath + "\\Provisioning Metadata");

            //Creating PA per user and saving its information in the Database.mdb
            PAArtefacts = this.Create_PAs_For_Database_Per_Provider(DbNId.ToString(), AgencyId, sdmxFolderPath + "\\Provisioning Metadata\\PAs", Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Users + DevInfo.Lib.DI_LibSDMX.Constants.DataProviderScheme.FileName), true);
            if (PAArtefacts != null && PAArtefacts.Count > 0)
            {
                Artefacts.AddRange(PAArtefacts);
            }

            this.Save_Artefacts_Details_In_Database(Artefacts, DbNId);

            ConsumerFileName = Path.Combine(AppPhysicalPath, Constants.FolderName.Users + DevInfo.Lib.DI_LibSDMX.Constants.DataConsumerScheme.FileName);

            if (File.Exists(ConsumerFileName))
            {
                Structure = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), ConsumerFileName);

                if (Structure != null && Structure.Structures != null && Structure.Structures.OrganisationSchemes != null && Structure.Structures.OrganisationSchemes.Count > 0 && Structure.Structures.OrganisationSchemes[0] is SDMXObjectModel.Structure.DataConsumerSchemeType &&
                    Structure.Structures.OrganisationSchemes[0].Organisation != null && Structure.Structures.OrganisationSchemes[0].Organisation.Count > 0)
                {
                    foreach (DataConsumerType DataConsumer in Structure.Structures.OrganisationSchemes[0].Organisation)
                    {
                        FolderName = Path.Combine(AppPhysicalPath, DbFolder + Constants.FolderName.SDMX.Subscriptions + DataConsumer.id.Replace(DevInfo.Lib.DI_LibSDMX.Constants.DataConsumerScheme.Prefix, string.Empty));
                        this.Create_Directory_If_Not_Exists(FolderName);
                    }
                }
            }

            ProviderFileName = Path.Combine(AppPhysicalPath, Constants.FolderName.Users + DevInfo.Lib.DI_LibSDMX.Constants.DataProviderScheme.FileName);

            if (File.Exists(ProviderFileName))
            {
                Structure = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), ProviderFileName);

                if (Structure != null && Structure.Structures != null && Structure.Structures.OrganisationSchemes != null && Structure.Structures.OrganisationSchemes.Count > 0 && Structure.Structures.OrganisationSchemes[0] is SDMXObjectModel.Structure.DataProviderSchemeType &&
                    Structure.Structures.OrganisationSchemes[0].Organisation != null && Structure.Structures.OrganisationSchemes[0].Organisation.Count > 0)
                {
                    foreach (DataProviderType DataProvider in Structure.Structures.OrganisationSchemes[0].Organisation)
                    {
                        FolderName = Path.Combine(AppPhysicalPath, DbFolder + Constants.FolderName.SDMX.Subscriptions + DataProvider.id.Replace(DevInfo.Lib.DI_LibSDMX.Constants.DataProviderScheme.Prefix, string.Empty));
                        this.Create_Directory_If_Not_Exists(FolderName);

                        FolderName = Path.Combine(AppPhysicalPath, DbFolder + Constants.FolderName.SDMX.Registrations + DataProvider.id.Replace(DevInfo.Lib.DI_LibSDMX.Constants.DataProviderScheme.Prefix, string.Empty));
                        this.Create_Directory_If_Not_Exists(FolderName);

                        FolderName = Path.Combine(AppPhysicalPath, DbFolder + Constants.FolderName.SDMX.Constraints + DataProvider.id.Replace(DevInfo.Lib.DI_LibSDMX.Constants.DataProviderScheme.Prefix, string.Empty));
                        this.Create_Directory_If_Not_Exists(FolderName);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            //Global.WriteErrorsInLog("Creating Artefacts For Uploaded DSD From Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);
            RetVal = false;
            Global.CreateExceptionString(ex, null);
        }
        finally
        {

        }

        return RetVal;
    }
    public bool CreateHeaderFileForUploadedDSD(SDMXApi_2_0.Message.StructureType UploadedDSDStructure, string sdmxFolderPath, int DbNId, string UserNId)
    {
        bool RetVal;

        SDMXApi_2_0.Message.StructureType Header;
        //  SDMXApi_2_0.Message.HeaderType Header;
        string AgencyId;
        string AppPhysicalPath;
        string DbFolder;

        RetVal = true;
        AgencyId = string.Empty;
        try
        {
            AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + UserNId;
            AppPhysicalPath = HttpContext.Current.Request.PhysicalApplicationPath;
            DbFolder = Constants.FolderName.Data + DbNId.ToString() + "\\";

            Header = new SDMXApi_2_0.Message.StructureType();
            //Header.ID = UploadedDSDStructure.Header.ID;
            //Header.Name = UploadedDSDStructure.Header.na;
            //Header.Test = UploadedDSDStructure.Header.Sender;
            //Header.Prepared = UploadedDSDStructure.Header.Sender;
            //Header.Sender = UploadedDSDStructure.Header.Sender;
            //Header.Receiver = UploadedDSDStructure.Header.Receiver;

            Header.Header = UploadedDSDStructure.Header;

            Header.Concepts = null;
            Header.KeyFamilies = null;
            Header.CodeLists = null;
            Header.MetadataStructureDefinitions = null;
            Header.OrganisationSchemes = null;
            Header.HierarchicalCodelists = null;
            Header.Metadataflows = null;
            Header.Processes = null;
            Header.ReportingTaxonomies = null;
            Header.StructureSets = null;
            Header.CategorySchemes = null;
            Header.Dataflows = null;
            Remove_Extra_Annotations(Header);
            //Creating Header file and saving its information in the Database.mdb
            SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.StructureType), Header, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName);
            this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, DevInfo.Lib.DI_LibSDMX.Constants.Header.Id, string.Empty, string.Empty, string.Empty, ArtefactTypes.Header, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName, DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName);

        }
        catch (Exception ex)
        {
            //Global.WriteErrorsInLog("Creating Artefacts For Uploaded DSD From Admin");
            //Global.WriteErrorsInLog(ex.StackTrace);
            //Global.WriteErrorsInLog(ex.Message);
            RetVal = false;
            Global.CreateExceptionString(ex, null);
        }
        finally
        {

        }

        return RetVal;
    }
Beispiel #26
0
 /// <summary>
 /// Save Values to unsd header file by dbnid
 /// </summary>
 /// <param name="dbNId">Nid of unsd database</param>
 /// <param name="objHeaderDetail">Object containg header details to be saved</param>
 /// <returns>true if header file updated success fully, else return false</returns>
 private bool SaveUNSDHeaderStructure(string dbNId, SDMXApi_2_0.Message.StructureType objStructure)
 {
     bool RetVal = false;
     string SourceHeaderFileNameWPath;
     XmlDocument ObjHeaderXml;
     SourceHeaderFileNameWPath = string.Empty;
     try
     {
         // Get Path of source header file
         SourceHeaderFileNameWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + dbNId + "\\" + Constants.FolderName.SDMX.sdmx + HeaderFileName);
         //Check if file exists
         if (File.Exists(SourceHeaderFileNameWPath))
         {
             ObjHeaderXml = new XmlDocument();
             // Searilize structure element to xml document
             ObjHeaderXml = SDMXApi_2_0.Serializer.SerializeToXmlDocument(typeof(SDMXApi_2_0.Message.StructureType), objStructure);
             // Save searilizes xml as header xml
             ObjHeaderXml.Save(SourceHeaderFileNameWPath);
             // Retuen true ifoperation completed succesfully
             RetVal = true;
         }
     }
     catch (Exception Ex)
     {
         Global.CreateExceptionString(Ex, null);
         RetVal = false;
         throw Ex;
     }
     return RetVal;
 }