Beispiel #1
0
        public bool LoadDSD(string DSDFileNameWithPath)
        {
            bool RetVal = false;

            this._DSDStructure = new SDMXObjectModel.Message.StructureType();

            try
            {
                this._DSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), DSDFileNameWithPath);

                this.Get_Indicators();
                this.Get_Units();
                this.Get_SubgroupType();
                this.Get_Subgroup();
                this.Get_SubgroupVal();

                this.Get_Area();
                this.Get_IUS();

                this.Get_IC();
                this.Get_IC_IUS();
            }
            catch (Exception ex)
            {
                throw ex;
            }



            return(RetVal);
        }
Beispiel #2
0
        public bool LoadDSD(string DSDFileNameWithPath)
        {
            bool RetVal = false;
            this._DSDStructure = new SDMXObjectModel.Message.StructureType();

            try
            {
                this._DSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), DSDFileNameWithPath);

                this.Get_Indicators();
                this.Get_Units();
                this.Get_SubgroupType();
                this.Get_Subgroup();
                this.Get_SubgroupVal();

                this.Get_Area();
                this.Get_IUS();

                this.Get_IC();
                this.Get_IC_IUS();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return RetVal;
        }
        private SDMXObjectModel.Message.StructureType Get_Structure_Object()
        {
            SDMXObjectModel.Message.StructureType RetVal;

            RetVal = new SDMXObjectModel.Message.StructureType();
            RetVal.Header = this.Get_Appropriate_Header();
            RetVal.Structures = new StructuresType(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
            RetVal.Footer = null;

            return RetVal;
        }
    public bool AdminUpdateArtifactsWithHeaderForDatabase(string requestParam)
    {
        bool RetVal = false;
        string DbNId = string.Empty;
        string[] Params;
        string DBConnectionsFile = string.Empty;
        string DBFile = string.Empty;
        XmlDocument UploadedHeaderXml = new XmlDocument();
        XmlDocument XmlDoc;
        XmlNodeList XmlNodes;
        string UploadedHeaderFileWPath = string.Empty;
        string UploadedHeaderFolderPath = Server.MapPath("../../stock/data");
        string UploadedHeaderName = string.Empty;
        string UserNId = string.Empty;

        string DatabaseNIdfor2_1 = string.Empty;
        try
        {
            Params = Global.SplitString(requestParam, Constants.Delimiters.ParamDelimiter);
            DbNId = Params[0];
            UserNId = Params[1];
            UploadedHeaderFileWPath = UploadedHeaderFolderPath + "/" + DbNId + "/" + "sdmx" + "/" + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName;

            DBFile = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, ConfigurationManager.AppSettings[Constants.WebConfigKey.DBConnectionsFile]);
            XmlDoc = new XmlDocument();
            XmlDoc.Load(DBFile);
            XmlNodes = XmlDoc.GetElementsByTagName("db");
            for (int i = 0; i < XmlNodes.Count; i++)
            {
                if ((XmlNodes[i].Attributes["sdmxdb"].Value == "false") && (XmlNodes[i].Attributes[Constants.XmlFile.Db.Tags.DatabaseAttributes.Id] != null))
                {
                    DatabaseNIdfor2_1 = XmlNodes[i].Attributes[Constants.XmlFile.Db.Tags.DatabaseAttributes.Id].Value;
                }
            }

            UploadedHeaderXml.Load(UploadedHeaderFileWPath);

            SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
            SDMXObjectModel.Message.StructureHeaderType Header = new SDMXObjectModel.Message.StructureHeaderType();
            UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
            Header = UploadedDSDStructure.Header;
            UploadedHeaderFolderPath = UploadedHeaderFolderPath + "/" + DbNId;
            RetVal = UpdateCompleteWithHeaderForDB(Header, DbNId, UserNId, UploadedHeaderFolderPath + "/" + "sdmx");
            RetVal = UpdateCodelistsForDBWithHeader(Header, DbNId, UserNId, UploadedHeaderFolderPath + "/" + "sdmx" + "/" + "Codelists");
            RetVal = UpdateCategorySchemeForDBWithHeader(DbNId, UserNId, DatabaseNIdfor2_1);
            RetVal = UpdateArtefactsForDBWithHeader(Header, DbNId, UserNId, UploadedHeaderFolderPath + "/" + "sdmx", DatabaseNIdfor2_1);
            RetVal = UpdateNonMAForUploadedDBWithHeader(DbNId, UserNId, DatabaseNIdfor2_1);

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

        }

        return RetVal;
    }
    private bool UpdateCodelistsForDBWithHeader(SDMXObjectModel.Message.StructureHeaderType Header, string DbNId, string UserNId, string CodelistsFolderPath)
    {
        bool RetVal;
        SDMXObjectModel.Message.StructureType CodelistStructure;
        RetVal = true;
        try
        {

            string[] Files = Directory.GetFiles(CodelistsFolderPath);
            foreach (string codilistFile in Files)
            {
                CodelistStructure = new SDMXObjectModel.Message.StructureType();
                CodelistStructure = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), codilistFile);
                CodelistStructure.Header = Header;

                CodelistStructure.Structures.Categorisations = null;
                CodelistStructure.Structures.OrganisationSchemes = null;
                CodelistStructure.Structures.HierarchicalCodelists = null;
                CodelistStructure.Structures.Concepts = null;
                CodelistStructure.Structures.Metadataflows = null;
                CodelistStructure.Structures.MetadataStructures = null;
                CodelistStructure.Structures.Processes = null;
                CodelistStructure.Structures.ReportingTaxonomies = null;
                CodelistStructure.Structures.StructureSets = null;
                CodelistStructure.Structures.CategorySchemes = null;
                CodelistStructure.Structures.Constraints = null;
                CodelistStructure.Structures.Dataflows = null;
                CodelistStructure.Footer = null;
                Remove_Extra_Annotations(CodelistStructure);
                SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.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 UpdateArtefactsForDBWithHeader(SDMXObjectModel.Message.StructureHeaderType Header, string DbNId, string UserNId, string sdmxFolderPath, string DatabaseNIDVersion2_1)
    {
        bool RetVal;
        SDMXObjectModel.Message.StructureType DSD;
        SDMXObjectModel.Message.StructureType MSD;
        SDMXObjectModel.Message.StructureType MSDConcepts;
        SDMXObjectModel.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 SDMXObjectModel.Message.StructureType();
            DSDFile = sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.DSD.FileName;
            DSD = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), DSDFile);
            DSD.Header = Header;
            DSD.Structures.OrganisationSchemes = null;
            DSD.Structures.HierarchicalCodelists = null;
            DSD.Structures.Concepts = null;
            DSD.Structures.Metadataflows = null;
            DSD.Structures.MetadataStructures = null;
            DSD.Structures.Processes = null;
            DSD.Structures.ReportingTaxonomies = null;
            DSD.Structures.StructureSets = null;
            DSD.Structures.CategorySchemes = null;
            DSD.Structures.Codelists = null;
            DSD.Structures.Dataflows = null;
            DSD.Structures.Constraints = null;
            DSD.Structures.ProvisionAgreements = null;
            DSD.Footer = null;
            //Creating DSD and saving its information in the Database.mdb
            SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.StructureType), DSD, sdmxFolderPath + "\\" + DevInfo.Lib.DI_LibSDMX.Constants.DSD.FileName);

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

            ConceptSchemeFolder = sdmxFolderPath + "/" + "Concepts";
            MSDFolder = sdmxFolderPath + "/" + "MSD";

            Summary.Header = Header;
            Summary.Structures.OrganisationSchemes = null;
            Summary.Structures.HierarchicalCodelists = null;
            Summary.Structures.Processes = null;
            Summary.Structures.ReportingTaxonomies = null;
            Summary.Structures.StructureSets = null;
            Summary.Structures.Constraints = null;
            Summary.Structures.ProvisionAgreements = null;
            Summary.Structures.Categorisations = null;
            Summary.Footer = null;

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

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

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

            conceptSchemes = Directory.GetFiles(ConceptSchemeFolder);
            foreach (string conceptSchemeFile in conceptSchemes)
            {
                MSDConcepts = new SDMXObjectModel.Message.StructureType();
                MSDConcepts = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), conceptSchemeFile);
                MSDConcepts.Header = Header;
                MSDConcepts.Structures.MetadataStructures = null;
                MSDConcepts.Structures.OrganisationSchemes = null;
                MSDConcepts.Structures.HierarchicalCodelists = null;
                MSDConcepts.Structures.Metadataflows = null;
                MSDConcepts.Structures.DataStructures = null;
                MSDConcepts.Structures.Processes = null;
                MSDConcepts.Structures.ReportingTaxonomies = null;
                MSDConcepts.Structures.StructureSets = null;
                MSDConcepts.Structures.CategorySchemes = null;
                MSDConcepts.Structures.Codelists = null;
                MSDConcepts.Structures.Dataflows = null;
                MSDConcepts.Structures.Categorisations = null;
                MSDConcepts.Structures.ProvisionAgreements = null;
                MSDConcepts.Structures.Constraints = null;
                MSDConcepts.Footer = null;

                //Creating MSDConcepts and saving its information in the Database.mdb
                SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.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;
    }
    private void Generate_MFD(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 = Get_Appropriate_Header_Of_StructureHeaderType();
            Metadataflow = new SDMXObjectModel.Structure.MetadataflowType(MFDId, MFDAgencyId, MFDVersion, MFDName, MFDDescription, MFDLanguage, null);

            Metadataflow.Structure = new MetadataStructureReferenceType();
            Metadataflow.Structure.Items.Add(new MetadataStructureRefType(DSDId, DSDAgencyId, DSDVersion));
            MFD.Structures.Metadataflows = new List<MetadataflowType>();
            MFD.Structures.Metadataflows.Add(Metadataflow);
            SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.StructureType), MFD, sdmxFolderPath + "\\Provisioning Metadata\\" + MFDId + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);
            this.Save_Artefacts_Details_For_Uploaded_DSD_In_Database(DbNId, MFDId, MFDAgencyId, MFDVersion, string.Empty, ArtefactTypes.MFD, sdmxFolderPath + "\\Provisioning Metadata\\" + MFDId + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension, MFDId + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);
            throw ex;
        }
        finally
        {
        }
    }
    //public string DataProviderGenerateSDMXML(string requestParam)
    //{
    //    string RetVal;
    //    string[] Params;
    //    string DBOrDSDDBId;
    //    bool DBOrDSDFlag;
    //    string IndicatorNIds, AreaNIds, TPNIds, SourceNIds, AgencyId, OutputFolder, AreaId, UserNId, HeaderFilePath, OriginalDBNId, DuplicateKey;
    //    int DBNId;
    //    int fileCount;
    //    string[] output;
    //    string[] SelectedCollection;
    //    DIConnection DIConnection;
    //    DIQueries DIQueries;
    //    Dictionary<string, string> DictQuery;
    //    Dictionary<string, string> DictMapping;
    //    Dictionary<string, string> DBConnections;
    //    XmlDocument Query;
    //    List<string> GeneratedFiles;
    //    List<string> ListIndicatorForRegistrations;
    //    string[] currentItem = null;
    //    string[] selectedField = null;
    //    string selectedType = string.Empty;
    //    string selectedValue = string.Empty;
    //    string selectedIndicator = string.Empty;
    //    RetVal = "false";
    //    fileCount = 0;
    //    Params = null;
    //    DBOrDSDDBId = string.Empty;
    //    DBOrDSDFlag = false;
    //    IndicatorNIds = string.Empty;
    //    AreaNIds = string.Empty;
    //    TPNIds = string.Empty;
    //    SourceNIds = string.Empty;
    //    AgencyId = string.Empty;
    //    OutputFolder = string.Empty;
    //    UserNId = string.Empty;
    //    DBNId = -1;
    //    DIConnection = null;
    //    DIQueries = null;
    //    DictQuery = new Dictionary<string, string>();
    //    DictMapping = new Dictionary<string, string>();
    //    Query = null;
    //    GeneratedFiles = new List<string>();// Get collection of files
    //    ListIndicatorForRegistrations = new List<string>();
    //    HeaderFilePath = string.Empty;
    //    OriginalDBNId = string.Empty;
    //    DBConnections = new Dictionary<string, string>();
    //    AreaId = string.Empty;
    //    output = null;
    //    DuplicateKey = string.Empty;
    //    SelectedCollection = null;
    //    DataTable dtSelections = null;
    //    DataRow dr;
    //    DataRow[] drSelections = null;
    //    string[] AgencyUserNid = null;
    //    string DevInfoOrCountryData = string.Empty;
    //    string xml = string.Empty;
    //    try
    //    {
    //        Params = Global.SplitString(requestParam, "|");
    //        DBOrDSDDBId = Params[0].ToString().Trim();
    //        DevInfoOrCountryData = Params[1].ToString().Trim();
    //        AgencyUserNid = Session["hLoggedInUserNId"].ToString().Trim().Split(new string[] { Constants.Delimiters.PivotColumnDelimiter }, StringSplitOptions.None);
    //        AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + AgencyUserNid[0].ToString();
    //        UserNId = AgencyUserNid[0].ToString().Trim();
    //        if (Params.Length > 2)
    //        {
    //            DBOrDSDFlag = Convert.ToBoolean(Params[1].ToString().Trim());
    //            IndicatorNIds = Params[2].ToString().Trim();
    //            AreaNIds = Params[3].ToString().Trim();
    //            TPNIds = Params[4].ToString().Trim();
    //            SourceNIds = Params[5].ToString().Trim();
    //            AreaId = Params[6].ToString().Trim();
    //            AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + Params[7].ToString().Trim();
    //            UserNId = Params[7].ToString().Trim();
    //            OriginalDBNId = Params[8].ToString().Trim();
    //            if (Params.Length > 9)
    //            {
    //                SelectedCollection = Params[9].ToString().Trim().Split(new string[] { Constants.Delimiters.RowDelimiter }, StringSplitOptions.None);
    //            }
    //        }
    //        else
    //        {
    //            Dictionary<string, string> DictConnections = new Dictionary<string, string>();
    //            DBConnections = Global.GetAllConnections("DevInfo");
    //            foreach (var item in DBConnections.Keys)
    //            {
    //                if (Convert.ToString(item) == DBOrDSDDBId && DevInfoOrCountryData == "DevInfo")
    //                {
    //                    RetVal = PublishDataFilesForDB(true, DBOrDSDDBId, AgencyId, UserNId);
    //                    output = RetVal.Split(new string[] { Constants.Delimiters.ParamDelimiter }, StringSplitOptions.None);
    //                    RetVal = output[0].ToString();
    //                }
    //                else if (Convert.ToString(item) != DBOrDSDDBId && DevInfoOrCountryData == "CountryData")
    //                {
    //                    RetVal = PublishDataFilesForDSD(false, Convert.ToString(item), AgencyId, UserNId);
    //                    output = RetVal.Split(new string[] { Constants.Delimiters.ParamDelimiter }, StringSplitOptions.None);
    //                    RetVal = output[0].ToString();
    //                }
    //            }
    //        }
    //        if (Params.Length > 2)
    //        {
    //            HeaderFilePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId.ToString() + "\\" + Constants.FolderName.SDMX.sdmx + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName);
    //            if (DBOrDSDFlag == true)
    //            {
    //                DBNId = Convert.ToInt32(DBOrDSDDBId);
    //                DIConnection = Global.GetDbConnection(DBNId);
    //                DIQueries = new DIQueries(DIConnection.DIDataSetDefault(), DIConnection.DILanguageCodeDefault(DIConnection.DIDataSetDefault()));
    //                XmlDocument UploadedHeaderXml = new XmlDocument();
    //                SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
    //                SDMXObjectModel.Message.StructureHeaderType Header = new SDMXObjectModel.Message.StructureHeaderType();
    //                if (File.Exists(HeaderFilePath))
    //                {
    //                    UploadedHeaderXml.Load(HeaderFilePath);
    //                    UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
    //                    Header = UploadedDSDStructure.Header;
    //                }
    //                this.Clean_SDMX_ML_Folder(DBNId);
    //                this.Add_IUS_To_Dictionary(DictQuery, IndicatorNIds, DIConnection, DIQueries);
    //                this.Add_Area_To_Dictionary(DictQuery, AreaNIds, DIConnection, DIQueries);
    //                this.Add_TP_To_Dictionary(DictQuery, TPNIds, DIConnection, DIQueries);
    //                this.Add_Source_To_Dictionary(DictQuery, SourceNIds, DIConnection, DIQueries);
    //                Query = SDMXUtility.Get_Query(SDMXSchemaType.Two_One, DictQuery, QueryFormats.StructureSpecificTS, DataReturnDetailTypes.Full, AgencyId, DIConnection, DIQueries);
    //                OutputFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBNId.ToString() + "\\" + Constants.FolderName.SDMX.SDMX_ML);
    //                if (SDMXUtility.Generate_Data(SDMXSchemaType.Two_One, Query, DataFormats.StructureSpecificTS, DIConnection, DIQueries, OutputFolder, out fileCount, out GeneratedFiles, Header) == true)
    //                {
    //                    if (fileCount == 0)
    //                    {
    //                        RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "NDF";
    //                    }
    //                    else
    //                    {
    //                        RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString();
    //                        ListIndicatorForRegistrations = this.Get_Indicator_List_For_Registrations(DBOrDSDDBId, DBOrDSDFlag, IndicatorNIds);
    //                        this.Register_SDMXFiles(DBOrDSDDBId, DBOrDSDFlag, UserNId, ListIndicatorForRegistrations, GeneratedFiles, DBNId.ToString());
    //                    }
    //                }
    //                else
    //                {
    //                    RetVal = "false";
    //                }
    //            }
    //            else
    //            {
    //                if (SelectedCollection != null)
    //                {
    //                    dtSelections = new DataTable();
    //                    dtSelections.TableName = "Data";
    //                    dtSelections.Columns.Add("Ind", typeof(int));
    //                    dtSelections.Columns.Add("areas", typeof(string));
    //                    dtSelections.Columns.Add("timeperiods", typeof(string));
    //                    dtSelections.Columns.Add("source", typeof(string));
    //                }
    //                else
    //                {
    //                    dtSelections = new DataTable();
    //                    dtSelections.TableName = "Data";
    //                    dtSelections.Columns.Add("Ind", typeof(int));
    //                    dtSelections.Columns.Add("areas", typeof(string));
    //                    dtSelections.Columns.Add("timeperiods", typeof(string));
    //                    dtSelections.Columns.Add("source", typeof(string));
    //                    foreach (string IndicatorNId in IndicatorNIds.Split(','))
    //                    {
    //                        dr = dtSelections.NewRow();
    //                        dr["Ind"] = IndicatorNId;
    //                        dr["areas"] = string.Empty;
    //                        dr["timeperiods"] = string.Empty;
    //                        dr["source"] = string.Empty;
    //                        dtSelections.Rows.Add(dr);
    //                    }
    //                }
    //                bool rowFound = false;
    //                currentItem = null;
    //                SelectedCollection = this.AddItemsInSelectedCollection(SelectedCollection, IndicatorNIds);
    //                if (SelectedCollection != null)
    //                    foreach (string item in SelectedCollection)
    //                    {
    //                        dr = dtSelections.NewRow();
    //                        currentItem = item.Split(new string[] { Constants.Delimiters.ColumnDelimiter }, StringSplitOptions.None);
    //                        foreach (string field in currentItem)
    //                        {
    //                            if (string.IsNullOrEmpty(field) == false)
    //                            {
    //                                selectedField = field.Split(new string[] { Constants.Delimiters.Underscore }, StringSplitOptions.None);
    //                                selectedType = selectedField[0];
    //                                selectedValue = selectedField[1];
    //                                if (selectedType == "Indicator")
    //                                {
    //                                    selectedIndicator = selectedValue;
    //                                }
    //                                if (dtSelections.Rows.Count > 0)
    //                                {
    //                                    foreach (DataRow datarow in dtSelections.Rows)
    //                                    {
    //                                        if (datarow[0].ToString() == selectedIndicator)
    //                                        {
    //                                            switch (selectedType)
    //                                            {
    //                                                case "Indicator":
    //                                                    datarow["Ind"] = selectedValue;
    //                                                    rowFound = true;
    //                                                    break;
    //                                                case "Area":
    //                                                    datarow["areas"] = selectedValue;
    //                                                    rowFound = true;
    //                                                    break;
    //                                                case "Time":
    //                                                    datarow["timeperiods"] = selectedValue;
    //                                                    rowFound = true;
    //                                                    break;
    //                                                case "Source":
    //                                                    datarow["source"] = selectedValue;
    //                                                    rowFound = true;
    //                                                    break;
    //                                                default:
    //                                                    break;
    //                                            }
    //                                        }
    //                                        else
    //                                        {
    //                                            switch (selectedType)
    //                                            {
    //                                                case "Indicator":
    //                                                    dr["Ind"] = selectedValue;
    //                                                    break;
    //                                                case "Area":
    //                                                    dr["areas"] = selectedValue;
    //                                                    break;
    //                                                case "Time":
    //                                                    dr["timeperiods"] = selectedValue;
    //                                                    break;
    //                                                case "Source":
    //                                                    dr["source"] = selectedValue;
    //                                                    break;
    //                                                default:
    //                                                    break;
    //                                            }
    //                                        }
    //                                    }
    //                                }
    //                                else
    //                                {
    //                                    switch (selectedType)
    //                                    {
    //                                        case "Indicator":
    //                                            dr["Ind"] = selectedValue;
    //                                            break;
    //                                        case "Area":
    //                                            dr["areas"] = selectedValue;
    //                                            break;
    //                                        case "Time":
    //                                            dr["timeperiods"] = selectedValue;
    //                                            break;
    //                                        case "Source":
    //                                            dr["source"] = selectedValue;
    //                                            break;
    //                                        default:
    //                                            break;
    //                                    }
    //                                }
    //                            }
    //                        }
    //                        if (rowFound == false)
    //                            dtSelections.Rows.Add(dr);
    //                        for (int i = 0; i < dtSelections.Rows.Count; i++)
    //                        {
    //                            if (dtSelections.Rows[i].IsNull("Ind") == true)
    //                            {
    //                                dtSelections.Rows.RemoveAt(i);
    //                            }
    //                        }
    //                    }
    //                DBNId = this.Get_AssociatedDB_NId(DBOrDSDDBId);
    //                DIConnection = Global.GetDbConnection(DBNId);
    //                DIQueries = new DIQueries(DIConnection.DIDataSetDefault(), DIConnection.DILanguageCodeDefault(DIConnection.DIDataSetDefault()));
    //                DictMapping = this.Get_IUS_Mapping_Dict(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId + "\\" + Constants.FolderName.SDMX.Mapping + "IUSMapping.xml"));
    //                this.Clean_SDMX_ML_Folder_For_UNSD(DBNId, DBOrDSDDBId);
    //                OutputFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId.ToString() + "\\" + Constants.FolderName.SDMX.SDMX_ML);
    //                xml = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId + "\\sdmx" + "\\DataPublishedUserSelection.xml");
    //                if (RegTwoZeroData.Generate_Data(IndicatorNIds, AreaNIds, TPNIds, SourceNIds, DictMapping, OutputFolder, DIConnection, DIQueries, out fileCount, AreaId, DBOrDSDDBId, out GeneratedFiles, HeaderFilePath, xml, out DuplicateKey, dtSelections) == true)
    //                {
    //                    //MNF-Mapping Not found in case if IUS Mapping doesnot exist.
    //                    //NDF-No data Found if datavalues does not exist corresponding to the indicator(s) selected.
    //                    if (DictMapping.Count == 0)
    //                    {
    //                        RetVal = "true" + Constants.Delimiters.ParamDelimiter + "0" + Constants.Delimiters.ParamDelimiter + "MNF";
    //                    }
    //                    else if (fileCount == 0 && DictMapping.Count == 0)
    //                    {
    //                        RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "MNF";
    //                    }
    //                    else if (fileCount == 0 && DictMapping.Count > 0 && string.IsNullOrEmpty(DuplicateKey) == false)
    //                    {
    //                        RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "DK" + Constants.Delimiters.ParamDelimiter + DuplicateKey;
    //                    }
    //                    else if (fileCount == 0 && DictMapping.Count > 0)
    //                    {
    //                        RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "NDF";
    //                    }
    //                    else
    //                    {
    //                        if (string.IsNullOrEmpty(DuplicateKey) == false)
    //                        {
    //                            RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + DuplicateKey + Constants.Delimiters.ParamDelimiter + "DK";
    //                        }
    //                        else
    //                        {
    //                            RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString();
    //                        }
    //                        Session["GeneratedFiles"] = (List<string>)GeneratedFiles;
    //                        ListIndicatorForRegistrations = this.Get_Indicator_List_For_Registrations(DBOrDSDDBId, DBOrDSDFlag, IndicatorNIds);
    //                        this.Register_SDMXFiles(DBOrDSDDBId, DBOrDSDFlag, UserNId, ListIndicatorForRegistrations, GeneratedFiles, DBNId.ToString());
    //                    }
    //                }
    //                else
    //                {
    //                    RetVal = "false";
    //                    if (DictMapping.Count == 0)
    //                    {
    //                        RetVal = "false" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "MNF";
    //                    }
    //                }
    //            }
    //        }
    //    }
    //    catch (Exception ex)
    //    {
    //        if (ex.Message.Contains("The given key was not present in the dictionary"))
    //        {
    //            RetVal = "false" + Constants.Delimiters.ParamDelimiter + "MNF";
    //        }
    //        else
    //        {
    //            RetVal = "false" + Constants.Delimiters.ParamDelimiter + ex.Message;
    //        }
    //        Global.CreateExceptionString(ex, null);
    //    }
    //    finally
    //    {
    //    }
    //    return RetVal;
    //}
    /// <summary>
    /// 
    /// </summary>
    /// <param name="requestParam">Selected Indicator[] Area []</param>
    /// <returns>FileCount and Status of Generated or Not generated files</returns>
    public string DataProviderGenerateSDMXML(string requestParam)
    {
        string RetVal;
        string[] Params;
        string DBOrDSDDBId;
        bool DBOrDSDFlag;
        string IndicatorNIds, AreaNIds, TPNIds, SourceNIds, AgencyId, OutputFolder, AreaId, UserNId, HeaderFilePath, OriginalDBNId, DuplicateKey;
        int DBNId;
        int fileCount;
        string[] output;
        string[] SelectedCollection;
        DIConnection DIConnection;
        DIQueries DIQueries;
        Dictionary<string, string> DictQuery;
        Dictionary<string, string> DictMapping;
        Dictionary<string, string> DBConnections;
        XmlDocument Query;
        List<string> GeneratedFiles;
           // List<string> ListIndicatorForRegistrations;
        RetVal = "false";
        fileCount = 0;
        Params = null;
        DBOrDSDDBId = string.Empty;
        DBOrDSDFlag = false;
        IndicatorNIds = string.Empty;
        AreaNIds = string.Empty;
        TPNIds = string.Empty;
        SourceNIds = string.Empty;
        AgencyId = string.Empty;
        OutputFolder = string.Empty;
        UserNId = string.Empty;
        DBNId = -1;
        DIConnection = null;
        DIQueries = null;
        DictQuery = new Dictionary<string, string>();
        DictMapping = new Dictionary<string, string>();
        Query = null;
        GeneratedFiles = new List<string>();// Get collection of files
         //   ListIndicatorForRegistrations = new List<string>();
        HeaderFilePath = string.Empty;
        OriginalDBNId = string.Empty;
        DBConnections = new Dictionary<string, string>();
        AreaId = string.Empty;
        output = null;
        DuplicateKey = string.Empty;
        SelectedCollection = null;
        DataTable dtSelections = null;
        DataRow dr;

        string[] AgencyUserNid = null;
        string DevInfoOrCountryData = string.Empty;
        string xml = string.Empty;
        string DataPublishUserSelectionFileNameWPath = string.Empty;
        string IndNId = string.Empty;
        string areas = string.Empty;
        string timeperiods = string.Empty;
        string source = string.Empty;
        string selectedState = string.Empty;
        string ErrorLogs = string.Empty;
        try
        {
            // 1. Split the parameter and set the variable
            Params = Global.SplitString(requestParam, "|");
            DBOrDSDDBId = Params[0].ToString().Trim();
            DevInfoOrCountryData = Params[1].ToString().Trim();
            AgencyUserNid = Session["hLoggedInUserNId"].ToString().Trim().Split(new string[] { Constants.Delimiters.PivotColumnDelimiter }, StringSplitOptions.None);
            AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + AgencyUserNid[0].ToString();
            UserNId = AgencyUserNid[0].ToString().Trim();

            if (Params.Length > 2)
            {
                // 1A. If reaching through Register tab ...
                DBOrDSDFlag = Convert.ToBoolean(Params[1].ToString().Trim());
                IndicatorNIds = Params[2].ToString().Trim();
                AreaNIds = Params[3].ToString().Trim();
                TPNIds = Params[4].ToString().Trim();
                SourceNIds = Params[5].ToString().Trim();
                AreaId = Params[6].ToString().Trim();
                AgencyId = DevInfo.Lib.DI_LibSDMX.Constants.MaintenanceAgencyScheme.Prefix + Params[7].ToString().Trim();
                UserNId = Params[7].ToString().Trim();
                OriginalDBNId = Params[8].ToString().Trim();
                if (Params.Length > 9)
                {
                    SelectedCollection = Params[9].ToString().Trim().Split(new string[] { Constants.Delimiters.RowDelimiter }, StringSplitOptions.None);
                }
                HeaderFilePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId.ToString() + "\\" + Constants.FolderName.SDMX.sdmx + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName);
                if (DBOrDSDFlag == true)
                {
                    //  1Ai If DevInfo DSD
                    DBNId = Convert.ToInt32(DBOrDSDDBId);
                    DIConnection = Global.GetDbConnection(DBNId);
                    DIQueries = new DIQueries(DIConnection.DIDataSetDefault(), DIConnection.DILanguageCodeDefault(DIConnection.DIDataSetDefault()));
                    XmlDocument UploadedHeaderXml = new XmlDocument();
                    SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
                    SDMXObjectModel.Message.StructureHeaderType Header = new SDMXObjectModel.Message.StructureHeaderType();
                    if (File.Exists(HeaderFilePath))
                    {
                        UploadedHeaderXml.Load(HeaderFilePath);
                        UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
                        Header = UploadedDSDStructure.Header;
                    }
                    this.Clean_SDMX_ML_Folder(DBNId);

                    this.Add_IUS_To_Dictionary(DictQuery, IndicatorNIds, DIConnection, DIQueries);
                    this.Add_Area_To_Dictionary(DictQuery, AreaNIds, DIConnection, DIQueries);
                    this.Add_TP_To_Dictionary(DictQuery, TPNIds, DIConnection, DIQueries);
                    this.Add_Source_To_Dictionary(DictQuery, SourceNIds, DIConnection, DIQueries);

                    Query = SDMXUtility.Get_Query(SDMXSchemaType.Two_One, DictQuery, QueryFormats.StructureSpecificTS, DataReturnDetailTypes.Full, AgencyId, DIConnection, DIQueries);
                    OutputFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBNId.ToString() + "\\" + Constants.FolderName.SDMX.SDMX_ML);
                    if (SDMXUtility.Generate_Data(SDMXSchemaType.Two_One, Query, DataFormats.StructureSpecificTS, DIConnection, DIQueries, OutputFolder, out fileCount, out GeneratedFiles, Header) == true)
                    {
                        if (fileCount == 0)
                        {
                            RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "NDF";
                        }
                        else
                        {
                            RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString();
                            //ListIndicatorForRegistrations = this.Get_Indicator_List_For_Registrations(DBOrDSDDBId, DBOrDSDFlag, IndicatorNIds);

                            this.Register_SDMXFiles(DBOrDSDDBId, DBOrDSDFlag, UserNId, GeneratedFiles, DBNId.ToString());
                        }
                    }
                    else
                    {
                        RetVal = "false";
                    }
                }
                else
                {
                    // 1Aii If Country DSD

                    // Set Datatable to store user selction (Indicator -> Area - Time Period, Source)
                    dtSelections = new DataTable();
                    dtSelections.TableName = "Data";
                    dtSelections.Columns.Add("Ind", typeof(int));
                    dtSelections.Columns.Add("areas", typeof(string));
                    dtSelections.Columns.Add("timeperiods", typeof(string));
                    dtSelections.Columns.Add("source", typeof(string));
                    dtSelections.Columns.Add("selectedState", typeof(string));

                    foreach (string IndicatorNId in IndicatorNIds.Split(','))
                    {
                        dr = dtSelections.NewRow();
                        dr["Ind"] = IndicatorNId;

                        DataPublishUserSelectionFileNameWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId.ToString() + "\\sdmx" + "\\DataPublishedUserSelection.xml");
                        XmlDocument doc = new XmlDocument();
                        doc.Load(DataPublishUserSelectionFileNameWPath);
                        foreach (XmlElement element in doc.SelectNodes("/root/Data"))
                        {
                            IndNId = element.GetAttribute("Ind");
                            if (IndicatorNId == IndNId)
                            {

                                areas = element.GetAttribute("areas");
                                dr["areas"] = areas;

                                timeperiods = element.GetAttribute("timeperiods");
                                dr["timeperiods"] = timeperiods;

                                source = element.GetAttribute("source");

                                dr["source"] = source;

                                selectedState = element.GetAttribute("selectedState");

                                dr["selectedState"] = "true";
                            }

                        }

                        dtSelections.Rows.Add(dr);

                    }

                    DBNId = this.Get_AssociatedDB_NId(DBOrDSDDBId);
                    DIConnection = Global.GetDbConnection(DBNId);
                    DIQueries = new DIQueries(DIConnection.DIDataSetDefault(), DIConnection.DILanguageCodeDefault(DIConnection.DIDataSetDefault()));
                    DictMapping = this.Get_IUS_Mapping_Dict(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId + "\\" + Constants.FolderName.SDMX.Mapping + "IUSMapping.xml"));

                    this.Clean_SDMX_ML_Folder_For_UNSD(DBNId, DBOrDSDDBId);
                    OutputFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId.ToString() + "\\" + Constants.FolderName.SDMX.SDMX_ML);
                    xml = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId + "\\sdmx" + "\\DataPublishedUserSelection.xml");

                    // Generate SDMX-mL data files
                    if (RegTwoZeroData.Generate_Data(DictMapping, OutputFolder, DIConnection, DIQueries, AreaId, DBOrDSDDBId, HeaderFilePath, xml, dtSelections, out fileCount, out GeneratedFiles, out ErrorLogs, out DuplicateKey) == true)
                    {

                        // Build Error Messages
                        if (DictMapping.Count == 0)
                        {
                            //MNF-Mapping Not found in case if IUS Mapping doesnot exist.
                            RetVal = "true" + Constants.Delimiters.ParamDelimiter + "0" + Constants.Delimiters.ParamDelimiter + "MNF";
                        }
                        else if (fileCount == 0 && DictMapping.Count == 0)
                        {
                            //MNF-Mapping Not found in case if IUS Mapping doesnot exist.
                            RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "MNF";
                        }
                        else if (fileCount == 0 && DictMapping.Count > 0 && string.IsNullOrEmpty(DuplicateKey) == false)
                        {
                            // Duplicate Key
                            RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + DuplicateKey;
                            if (RetVal.EndsWith(Constants.Delimiters.ParamDelimiter))
                            {
                                RetVal = RetVal.Substring(0, RetVal.Length - 6);
                            }
                        }
                        else
                        {
                            if (string.IsNullOrEmpty(DuplicateKey) == false)
                            {
                                RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + DuplicateKey;
                            }
                            else
                            {
                                RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString();
                            }
                            //ListIndicatorForRegistrations = this.Get_Indicator_List_For_Registrations(DBOrDSDDBId, DBOrDSDFlag, IndicatorNIds);

                            // Register SDMX-ML file generated

                            this.Register_SDMXFiles(DBOrDSDDBId, DBOrDSDFlag, UserNId, GeneratedFiles, DBNId.ToString());
                        }
                        RetVal = RetVal + Constants.Delimiters.ParamDelimiter + ErrorLogs;
                    }
                    else
                    {
                        RetVal = "false";
                        if (DictMapping.Count == 0)
                        {
                            RetVal = "false" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "MNF";
                        }
                    }
                }

            }
            else
            {
                // 1B. If reaching through Admin Optimize
                Dictionary<string, string> DictConnections = new Dictionary<string, string>();
                DBConnections = Global.GetAllConnections("DevInfo");
                foreach (var item in DBConnections.Keys)
                {
                    if (Convert.ToString(item) == DBOrDSDDBId && DevInfoOrCountryData == "DevInfo")
                    {
                        RetVal = PublishDataFilesForDB(true, DBOrDSDDBId, AgencyId, UserNId);
                        output = RetVal.Split(new string[] { Constants.Delimiters.ParamDelimiter }, StringSplitOptions.None);
                        RetVal = output[0].ToString();
                    }
                    else if (Convert.ToString(item) != DBOrDSDDBId && DevInfoOrCountryData == "CountryData")
                    {
                        RetVal = PublishDataFilesForDSD(false, Convert.ToString(item), AgencyId, UserNId);
                        output = RetVal.Split(new string[] { Constants.Delimiters.ParamDelimiter }, StringSplitOptions.None);
                        RetVal = output[0].ToString();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            if (ex.Message.Contains("The given key was not present in the dictionary"))
            {
                RetVal = "false" + Constants.Delimiters.ParamDelimiter + "MNF";

            }
            else
            {
                RetVal = "false" + Constants.Delimiters.ParamDelimiter + ex.Message;
            }

            Global.CreateExceptionString(ex, null);

        }
        finally
        {

        }

        return RetVal;
    }
    private string PublishDataFilesForDB(bool DBOrDSDFlag, string DBOrDSDDBId, string AgencyId, string UserNId)
    {
        string RetVal = string.Empty;
        string IndicatorNIds, AreaNIds, TPNIds, SourceNIds, OutputFolder, AreaId, HeaderFilePath, OriginalDBNId;
        int DBNId;
        int fileCount;
        DIConnection DIConnection;
        DIQueries DIQueries;
        Dictionary<string, string> DictQuery;
        Dictionary<string, string> DictMapping;
        XmlDocument Query;
        List<string> GeneratedFiles;
        List<string> ListIndicatorForRegistrations;
        RetVal = "false";
        fileCount = 0;
        AreaId = string.Empty;
        IndicatorNIds = string.Empty;
        AreaNIds = string.Empty;
        TPNIds = string.Empty;
        SourceNIds = string.Empty;
        OutputFolder = string.Empty;
        DBNId = -1;
        DIConnection = null;
        DIQueries = null;
        DictQuery = new Dictionary<string, string>();
        DictMapping = new Dictionary<string, string>();
        Query = null;
        GeneratedFiles = new List<string>();// Get collection of files
        ListIndicatorForRegistrations = new List<string>();
        HeaderFilePath = string.Empty;
        OriginalDBNId = string.Empty;
        HeaderFilePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId.ToString() + "\\" + Constants.FolderName.SDMX.sdmx + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName);
        DBNId = Convert.ToInt32(DBOrDSDDBId);
        DIConnection = Global.GetDbConnection(DBNId);
        DIQueries = new DIQueries(DIConnection.DIDataSetDefault(), DIConnection.DILanguageCodeDefault(DIConnection.DIDataSetDefault()));
        XmlDocument UploadedHeaderXml = new XmlDocument();
        SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
        SDMXObjectModel.Message.StructureHeaderType Header = new SDMXObjectModel.Message.StructureHeaderType();
        if (File.Exists(HeaderFilePath))
        {
            UploadedHeaderXml.Load(HeaderFilePath);
            UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
            Header = UploadedDSDStructure.Header;
        }
        //   this.Clean_SDMX_ML_Folder(DBNId);
        IndicatorNIds = "-1";
        AreaNIds = "-1";
        TPNIds = "-1";
        SourceNIds = "-1";
        AreaId = "";

        this.Add_IUS_To_Dictionary(DictQuery, IndicatorNIds, DIConnection, DIQueries);
        this.Add_Area_To_Dictionary(DictQuery, AreaNIds, DIConnection, DIQueries);
        this.Add_TP_To_Dictionary(DictQuery, TPNIds, DIConnection, DIQueries);
        this.Add_Source_To_Dictionary(DictQuery, SourceNIds, DIConnection, DIQueries);

        Query = SDMXUtility.Get_Query(SDMXSchemaType.Two_One, DictQuery, QueryFormats.StructureSpecificTS, DataReturnDetailTypes.Full, AgencyId, DIConnection, DIQueries);
        OutputFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBNId.ToString() + "\\" + Constants.FolderName.SDMX.SDMX_ML);
        if (SDMXUtility.Generate_Data(SDMXSchemaType.Two_One, Query, DataFormats.StructureSpecificTS, DIConnection, DIQueries, OutputFolder, out fileCount, out GeneratedFiles, Header) == true)
        {
            if (fileCount == 0)
            {
                RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString() + Constants.Delimiters.ParamDelimiter + "NDF";
            }
            else
            {
                RetVal = "true" + Constants.Delimiters.ParamDelimiter + fileCount.ToString();
                //ListIndicatorForRegistrations = this.Get_Indicator_List_For_Registrations(DBOrDSDDBId, DBOrDSDFlag, string.Empty);

                this.Register_SDMXFiles(DBOrDSDDBId, DBOrDSDFlag, UserNId, GeneratedFiles, DBNId.ToString());
            }
        }
        else
        {
            RetVal = "false";
        }

        return RetVal;
    }
Beispiel #10
0
    private bool IsIndicatorMapped(string CodeId, StructureType CodelistMapping)
    {
        bool RetVal;

        RetVal = false;

        try
        {
            if (CodelistMapping != null && CodelistMapping.Structures != null && CodelistMapping.Structures.StructureSets != null &&
                CodelistMapping.Structures.StructureSets.Count > 0 && CodelistMapping.Structures.StructureSets[0].Items != null &&
                CodelistMapping.Structures.StructureSets[0].Items.Count > 0 &&
                CodelistMapping.Structures.StructureSets[0].Items[0] is SDMXObjectModel.Structure.CodelistMapType &&
                ((SDMXObjectModel.Structure.CodelistMapType)CodelistMapping.Structures.StructureSets[0].Items[0]).Items != null &&
                ((SDMXObjectModel.Structure.CodelistMapType)CodelistMapping.Structures.StructureSets[0].Items[0]).Items.Count > 0)
            {
                foreach (SDMXObjectModel.Structure.ItemAssociationType CodeMap in ((SDMXObjectModel.Structure.CodelistMapType)CodelistMapping.Structures.StructureSets[0].Items[0]).Items)
                {
                    if (CodeId == ((LocalCodeRefType)((LocalCodeReferenceType)CodeMap.Source).Items[0]).id)
                    {
                        RetVal = true;
                        break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }

        return RetVal;
    }
Beispiel #11
0
    public Dictionary<string, string> Get_DictMappingCodelist(string CodelistMapId, StructureType Structure)
    {
        Dictionary<string, string> RetVal;
        SDMXObjectModel.Structure.CodelistMapType MapCodelist;

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

        try
        {
            if (Structure != null && Structure.Structures != null && Structure.Structures.StructureSets != null &&
                Structure.Structures.StructureSets.Count > 0 && Structure.Structures.StructureSets[0].Items != null &&
                Structure.Structures.StructureSets[0].Items.Count > 0)
            {
                foreach (SDMXObjectModel.Structure.NameableType CodelistMap in Structure.Structures.StructureSets[0].Items)
                {
                    if (CodelistMap.id == CodelistMapId && CodelistMap is SDMXObjectModel.Structure.CodelistMapType)
                    {
                        MapCodelist = CodelistMap as SDMXObjectModel.Structure.CodelistMapType;
                        break;
                    }
                }

                if (MapCodelist != null && MapCodelist.Items != null && MapCodelist.Items.Count > 0)
                {
                    foreach (SDMXObjectModel.Structure.ItemAssociationType CodeMap in MapCodelist.Items)
                    {
                        RetVal.Add(((SDMXObjectModel.Common.LocalCodeRefType)CodeMap.Source.Items[0]).id, ((SDMXObjectModel.Common.LocalCodeRefType)CodeMap.Target.Items[0]).id);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }

        return RetVal;
    }
Beispiel #12
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
        {
        }
    }
    private void BindDimensionsAttributesMeasure_For_Version_2_1()
    {
        XmlDocument SummaryXml;
        SummaryXml = new XmlDocument();
        int i, j, k;
        string DSDViewPath, DSDPath;

        StringBuilder sb;
        SDMXObjectModel.Structure.MeasureListType MeasureList;
        SDMXObjectModel.Structure.DimensionType Dimension;
        SDMXObjectModel.Structure.TimeDimensionType TimeDimension;
        SDMXObjectModel.Structure.AttributeType Attribute;
        SDMXObjectModel.Common.ConceptReferenceType ConceptIdentity;
        SDMXObjectModel.Structure.AttributeRelationshipType AttributeRelationship;
        SDMXObjectModel.Common.LocalPrimaryMeasureReferenceType LocalPrimaryMeasureReference;
        SDMXObjectModel.Structure.PrimaryMeasureType PrimaryMeasure;

        SDMXObjectModel.Structure.StructuresType ConceptsObj;

        SDMXObjectModel.Structure.DataStructureComponentsType DSComponents = new DataStructureComponentsType();

        DSDViewPath = string.Empty;
        DSDPath = string.Empty;

        SDMXObjectModel.Message.StructureType Summary = new SDMXObjectModel.Message.StructureType();

        DSDViewPath = "../../" + Constants.FolderName.Data + hdbnid + "\\sdmx\\DSD" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension;
        DSDPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + hdbnid + "\\sdmx\\DSD" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);

        //Providing the Path of the Summary.xml
        SummaryXml.Load(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + hdbnid + "\\sdmx\\Summary" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension));

        //Loading Summary objects from its XML document into 'DataStructuresType' Summary object
        Summary = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), SummaryXml);

        DSComponents = (SDMXObjectModel.Structure.DataStructureComponentsType)(Summary.Structures.DataStructures[0].Item);
        ConceptsObj = Summary.Structures;

        //Binding DSD
        sb = new StringBuilder();
        sb.Append("<div class=\"reg_li_sub_txt\">");
        sb.Append("<b>");
        sb.Append(GetLangSpecificValue_For_Version_2_1(Summary.Structures.DataStructures[0].Name, hlngcodedb));
        sb.Append("</b>");
        sb.Append("<span class=\"reg_li_brac_txt\">(");
        sb.Append(GetLangSpecificValue_For_Version_2_1(Summary.Structures.DataStructures[0].Description, hlngcodedb));
        sb.Append(")</span> ");
        sb.Append("</div>");
        sb.Append("<div>");
        sb.Append("<a href=\" " + DSDViewPath.Replace("\\", "/") + "\"  ");
        sb.Append(" target=\"_blank\" class=\"reg_li_link_txt\" name=\"lang_View\"></a> | ");
        sb.Append("<a href='Download.aspx?fileId=" + DSDPath + "' class=\"reg_li_link_txt\" name=\"lang_Download\"></a>");
        sb.Append("</div>");
        sb.Append("<br/>");

        //Binding Dimensions

        sb.Append("<h4 id=\"lang_Dimensions\"></h4>");
        sb.Append("<ul>");
        for (i = 0; i < DSComponents.Items[0].Items.Count; i++)
        {

            if (DSComponents.Items[0].Items[i] is SDMXObjectModel.Structure.TimeDimensionType)
            {
                TimeDimension = (SDMXObjectModel.Structure.TimeDimensionType)(DSComponents.Items[0].Items[i]);
                ConceptIdentity = TimeDimension.ConceptIdentity;
            }
            else
            {
                Dimension = (SDMXObjectModel.Structure.DimensionType)(DSComponents.Items[0].Items[i]);
                ConceptIdentity = Dimension.ConceptIdentity;
            }

            sb.Append("<li>");
            for (j = 0; j < ConceptsObj.Concepts.Count; j++)
                if (((SDMXObjectModel.Common.ConceptRefType)(ConceptIdentity.Items[0])).maintainableParentID.ToString() == ConceptsObj.Concepts[j].id.ToString())
                {

                    for (k = 0; k < ConceptsObj.Concepts[j].Items.Count; k++)
                    {
                        if (((SDMXObjectModel.Common.ConceptRefType)(ConceptIdentity.Items[0])).id.ToString() == ConceptsObj.Concepts[j].Items[k].id.ToString())
                        {
                            sb.Append("<div>");
                            sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptsObj.Concepts[j].Items[k].Name, hlngcodedb));
                            sb.Append("<span class=\"reg_li_brac_txt\">(");
                            sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptsObj.Concepts[j].Items[k].Description, hlngcodedb));
                            sb.Append(")</span>");
                            sb.Append("<div>");

                            break;
                        }
                    }

                }
            sb.Append("</li>");
        }
        sb.Append("</ul>");
        divDimensions.InnerHtml = sb.ToString();

        //Binding Attributes

        sb = new StringBuilder();
        sb.Append("<h4 id=\"lang_Attributes\"></h4>");
        sb.Append("<ul>");
        for (i = 0; i < DSComponents.Items[1].Items.Count; i++)
        {
            Attribute = (SDMXObjectModel.Structure.AttributeType)(DSComponents.Items[1].Items[i]);
            ConceptIdentity = Attribute.ConceptIdentity;
            AttributeRelationship = Attribute.AttributeRelationship;
            LocalPrimaryMeasureReference = (SDMXObjectModel.Common.LocalPrimaryMeasureReferenceType)(AttributeRelationship.Items[0]);
            sb.Append("<li>");
            for (j = 0; j < ConceptsObj.Concepts.Count; j++)
                if (((SDMXObjectModel.Common.ConceptRefType)(ConceptIdentity.Items[0])).maintainableParentID.ToString() == ConceptsObj.Concepts[j].id.ToString())
                {
                    for (k = 0; k < ConceptsObj.Concepts[j].Items.Count; k++)
                    {
                        if (((SDMXObjectModel.Common.ConceptRefType)(ConceptIdentity.Items[0])).id.ToString() == ConceptsObj.Concepts[j].Items[k].id.ToString())
                        {
                            sb.Append("<div>");
                            sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptsObj.Concepts[j].Items[k].Name, hlngcodedb));
                            sb.Append("<span class=\"reg_li_brac_txt\">(");
                            sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptsObj.Concepts[j].Items[k].Description, hlngcodedb));
                            sb.Append(")</span>");
                            sb.Append("</div>");
                            break;
                        }
                    }
                }
            sb.Append("<div class=\"reg_li_sub_txt\">");
            sb.Append("<span id=\"lang_Attachment_Level" + i + "\" ></span>");
            sb.Append("<span id=\"lang_Obs_Val" + i + "\">");
            sb.Append(((SDMXObjectModel.Common.LocalPrimaryMeasureRefType)(LocalPrimaryMeasureReference.Items[0])).id.ToString());
            sb.Append(" , ");
            sb.Append("</span>");
            sb.Append("<span id=\"lang_Mandatory" + i + "\" ></span>");
            if (((UsageStatusType)(Attribute.assignmentStatus)) == UsageStatusType.Mandatory)
            {
                sb.Append("<span id=\"lang_Yes" + i + "\" ></span>");
            }
            else
            {
                sb.Append("<span id=\"lang_No" + i + "\" ></span>");
            }
            sb.Append("</div>");
            sb.Append("</li>");
        }
        sb.Append("</ul>");
        divAttributes.InnerHtml = sb.ToString();

        //Binding Measure

        MeasureList = ((SDMXObjectModel.Structure.MeasureListType)((SDMXObjectModel.Structure.DataStructureComponentsType)(DSComponents)).MeasureList);
        sb = new StringBuilder();
        sb.Append("<h4 id=\"lang_Measure\"></h4>");
        sb.Append("<ul>");
        for (i = 0; i < DSComponents.Items[2].Items.Count; i++)
        {

            PrimaryMeasure = (SDMXObjectModel.Structure.PrimaryMeasureType)(DSComponents.Items[2].Items[i]);
            ConceptIdentity = PrimaryMeasure.ConceptIdentity;
            sb.Append("<li>");
            for (j = 0; j < ConceptsObj.Concepts.Count; j++)
                if (((SDMXObjectModel.Common.ConceptRefType)(ConceptIdentity.Items[0])).maintainableParentID.ToString() == ConceptsObj.Concepts[j].id.ToString())
                {

                    for (k = 0; k < ConceptsObj.Concepts[j].Items.Count; k++)
                    {
                        if (((SDMXObjectModel.Common.ConceptRefType)(ConceptIdentity.Items[0])).id.ToString() == ConceptsObj.Concepts[j].Items[k].id.ToString())
                        {
                            sb.Append("<div>");
                            sb.Append("<span style=\"font-weight:normal\">");
                            sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptsObj.Concepts[j].Items[k].Name, hlngcodedb));
                            sb.Append("</span>");

                            sb.Append("<span class=\"reg_li_brac_txt\">(");
                            sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptsObj.Concepts[j].Items[k].Description, hlngcodedb));
                            sb.Append(")</span>");
                            sb.Append("<div>");
                            break;
                        }
                    }

                }
            sb.Append("</li>");
        }
        sb.Append("</ul>");
        divMeasure.InnerHtml = sb.ToString();
    }
    private void BindDFDAndConceptScheme_For_Version_2_1()
    {
        string DFDViewPath, DFDPath;
        string ConceptSchemeViewPath, ConceptSchemePath;
        DIConnection DIConnection;
        string Query;
        DataTable DtDFD;
        StringBuilder sb;
        int i;

        DIConnection = null;
        DFDViewPath = string.Empty;
        DFDPath = string.Empty;
        ConceptSchemeViewPath = string.Empty;
        ConceptSchemePath = string.Empty;

        sb = new StringBuilder();

        DIConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, Server.MapPath("~//stock//Database.mdb"),
                           string.Empty, string.Empty);
        Query = "SELECT * FROM Artefacts WHERE DBNId = " + Convert.ToInt32(hdbnid) + " AND Type=4;";
        DtDFD = DIConnection.ExecuteDataTable(Query);

        if (DtDFD != null && DtDFD.Rows.Count > 0)
        {
            DFDPath = DtDFD.Rows[0]["FileLocation"].ToString();
            DFDViewPath = "../../" + DFDPath.Substring(DFDPath.LastIndexOf("stock")).Replace("\\", "/");

        }
        else
        {
            DFDPath = string.Empty;
            DFDViewPath = string.Empty;
        }

        SDMXObjectModel.Message.StructureType DFD = new SDMXObjectModel.Message.StructureType();
        DFD = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), DFDPath);

        sb = new StringBuilder();
        sb.Append("<div class=\"reg_li_sub_txt\">");
        sb.Append("<b>");
        sb.Append(GetLangSpecificValue_For_Version_2_1(DFD.Structures.Dataflows[0].Name, hlngcodedb));
        sb.Append("</b>");
        sb.Append("<span class=\"reg_li_brac_txt\">(");
        sb.Append(GetLangSpecificValue_For_Version_2_1(DFD.Structures.Dataflows[0].Description, hlngcodedb));
        sb.Append(")</span> ");
        sb.Append("</div>");
        sb.Append("<div>");
        sb.Append("<a href=\" " + DFDViewPath + "\"  ");
        sb.Append(" target=\"_blank\" class=\"reg_li_link_txt\" name=\"lang_View\"></a> | ");
        sb.Append("<a href='Download.aspx?fileId=" + DFDPath + "' class=\"reg_li_link_txt\" name=\"lang_Download\"></a>");
        sb.Append("</div>");

        divDFD.InnerHtml = sb.ToString();

        ConceptSchemeViewPath = "../../" + Constants.FolderName.Data + hdbnid + "\\sdmx\\Concepts\\DSD_Concepts" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension;
        ConceptSchemePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + hdbnid + "\\sdmx\\Concepts\\DSD_Concepts" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension);

        SDMXObjectModel.Message.StructureType ConceptScheme = new SDMXObjectModel.Message.StructureType();
        ConceptScheme = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), ConceptSchemePath);

        sb = new StringBuilder();
        sb.Append("<div class=\"reg_li_sub_txt\">");
        sb.Append("<b>");
        sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptScheme.Structures.Concepts[0].Name, hlngcodedb));
        sb.Append("</b>");
        sb.Append("<span class=\"reg_li_brac_txt\">(");
        sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptScheme.Structures.Concepts[0].Description, hlngcodedb));
        sb.Append(")</span> ");
        sb.Append("</div>");
        sb.Append("<div>");
        sb.Append("<a href=\" " + ConceptSchemeViewPath.Replace("\\", "/") + "\"  ");
        sb.Append(" target=\"_blank\" class=\"reg_li_link_txt\" name=\"lang_View\"></a> | ");
        sb.Append("<a href='Download.aspx?fileId=" + ConceptSchemePath + "' class=\"reg_li_link_txt\" name=\"lang_Download\"></a>");
        sb.Append("<br/>");
        sb.Append("<br/>");
        sb.Append("<ul id=\"ulConceptScheme\">");
        for (i = 0; i < ConceptScheme.Structures.Concepts[0].Items.Count; i++)
        {
            sb.Append("<li>");

            sb.Append("<span>");
            sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptScheme.Structures.Concepts[0].Items[i].Name, hlngcodedb));
            sb.Append("</span>");

            sb.Append("<span class=\"reg_li_brac_txt\">(");
            sb.Append(GetLangSpecificValue_For_Version_2_1(ConceptScheme.Structures.Concepts[0].Items[i].Description, hlngcodedb));
            sb.Append(")</span>");

            sb.Append("</li>");

        }
        sb.Append("</ul>");
        sb.Append("</div>");

        divConceptScheme.InnerHtml = sb.ToString();
    }
    private void BindCodelists_For_Version_2_1()
    {
        XmlDocument SummaryXml;
        SummaryXml = new XmlDocument();
        string CodelistPath;
        string CodelistViewPath;
        int i;
        StringBuilder sb;

        SummaryXml.Load(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + hdbnid + "\\sdmx\\Summary" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension));

        SDMXObjectModel.Message.StructureType Summary = new SDMXObjectModel.Message.StructureType();

        //Loading Composite Xml into 'StructureType' Composite object
        Summary = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), SummaryXml);

        //Binding Codelists

        sb = new StringBuilder();
        sb.Append("<ul>");
        for (i = 0; i < Summary.Structures.Codelists.Count; i++)
        {
            sb.Append("<li>");
            sb.Append("<div class=\"reg_li_sub_txt\">");
            sb.Append("<b>");
            sb.Append(GetLangSpecificValue_For_Version_2_1(Summary.Structures.Codelists[i].Name, hlngcodedb));
            sb.Append("</b>");
            sb.Append("<span class=\"reg_li_brac_txt\">(");
            sb.Append(GetLangSpecificValue_For_Version_2_1(Summary.Structures.Codelists[i].Description, hlngcodedb));
            sb.Append(")</span> ");
            sb.Append("</div>");

            switch (Summary.Structures.Codelists[i].id)
            {
                case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Area.Id:
                    CodelistViewPath = "/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Area.FileName;
                    CodelistPath = "stock/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Area.FileName;
                    break;
                case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Indicator.Id:
                    CodelistViewPath = "/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Indicator.FileName;
                    CodelistPath = "stock/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Indicator.FileName;
                    break;
                case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.IUS.Id:
                    CodelistViewPath = "/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.IUS.FileName;
                    CodelistPath = "stock/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.IUS.FileName;
                    break;
                case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.SubgroupType.Id:
                    CodelistViewPath = "/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.SubgroupType.FileName;
                    CodelistPath = "stock/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.SubgroupType.FileName;
                    break;
                case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.SubgroupVal.Id:
                    CodelistViewPath = "/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.SubgroupVal.FileName;
                    CodelistPath = "stock/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.SubgroupVal.FileName;
                    break;
                case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Unit.Id:
                    CodelistViewPath = "/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Unit.FileName;
                    CodelistPath = "stock/data/" + hdbnid + "/sdmx/Codelists/" + DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Unit.FileName;
                    break;
                default:
                    //for subgroups
                    CodelistViewPath = "/data/" + hdbnid + "/sdmx/Codelists/" + Summary.Structures.Codelists[i].id.Substring(3) + ".xml";
                    CodelistPath = "stock/data/" + hdbnid + "/sdmx/Codelists/" + Summary.Structures.Codelists[i].id.Substring(3) + ".xml";
                    break;
            }

            sb.Append("<div>");
            sb.Append("<a href=\"javascript:void(0);\" ");
            sb.Append(" onclick=\"ViewCodelist('" + CodelistViewPath + "');\"");
            sb.Append(" class=\"reg_li_link_txt\" name=\"lang_View\"></a> | ");

            //Download Codelist
            sb.Append("<a class=\"reg_li_link_txt\" href='Download.aspx?fileId=" + CodelistPath + "' name=\"lang_Download\"></a>");
            sb.Append("</div>");
            sb.Append("</li>");
        }
        sb.Append("</ul>");
        divCodelists.InnerHtml = sb.ToString();
    }
Beispiel #16
0
    private void Get_SourceIdAgencyIdVersionCodelist(string CodelistId, out string SourceId, out string SourceAgencyId, out string SourceVersion, StructureType Structure)
    {
        SDMXObjectModel.Structure.CodelistType SourceCodelist;

        SourceCodelist = null;

        SourceId = string.Empty;
        SourceAgencyId = string.Empty;
        SourceVersion = string.Empty;

        try
        {
            if (Structure != null && Structure.Structures != null && Structure.Structures.Codelists != null &&
                Structure.Structures.Codelists.Count > 0)
            {
                foreach (SDMXObjectModel.Structure.CodelistType Codelist in Structure.Structures.Codelists)
                {

                    if (Codelist.id.ToUpper() == CodelistId.ToUpper())
                    {
                        SourceCodelist = Codelist;
                        break;
                    }

                }

                SourceId = SourceCodelist.id;
                SourceAgencyId = SourceCodelist.agencyID;
                SourceVersion = SourceCodelist.version;
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
        }
    }
Beispiel #17
0
    public Dictionary<string, string> Get_DictSourceIUS(string Language, StructureType SourceCodelistStructure, StructureType MappingCodelistStructure)
    {
        Dictionary<string, string> RetVal;
        string IndicatorGId, UnitGId, SubgroupValGId, Indicator, Unit, SubgroupVal;
        SDMXObjectModel.Structure.CodelistType IUSCodelist, IndicatorCodelist, UnitCodelist, SubgroupCodelist;

        RetVal = new Dictionary<string, string>();
        IndicatorGId = string.Empty;
        UnitGId = string.Empty;
        SubgroupValGId = string.Empty;
        Indicator = string.Empty;
        Unit = string.Empty;
        SubgroupVal = string.Empty;

        IUSCodelist = null;
        IndicatorCodelist = null;
        UnitCodelist = null;
        SubgroupCodelist = null;

        try
        {
            if (SourceCodelistStructure != null && SourceCodelistStructure.Structures != null && SourceCodelistStructure.Structures.Codelists != null &&
                SourceCodelistStructure.Structures.Codelists.Count > 0)
            {
                foreach (SDMXObjectModel.Structure.CodelistType Codelist in SourceCodelistStructure.Structures.Codelists)
                {
                    switch (Codelist.id)
                    {
                        case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.IUS.Id:
                            IUSCodelist = Codelist;
                            break;
                        case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Indicator.Id:
                            IndicatorCodelist = Codelist;
                            break;
                        case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Unit.Id:
                            UnitCodelist = Codelist;
                            break;
                        case DevInfo.Lib.DI_LibSDMX.Constants.CodeList.SubgroupVal.Id:
                            SubgroupCodelist = Codelist;
                            break;
                        default:
                            break;
                    }
                }
            }

            if (IUSCodelist != null && IUSCodelist.Items != null && IUSCodelist.Items.Count > 0)
            {
                foreach (SDMXObjectModel.Structure.ItemType Code in IUSCodelist.Items)
                {
                    IndicatorGId = Code.id.Split('@')[0];
                    UnitGId = Code.id.Split('@')[1];
                    SubgroupValGId = Code.id.Split('@')[2];

                    if (this.IsIndicatorMapped(IndicatorGId, MappingCodelistStructure))
                    {
                        Indicator = this.Get_Language_Based_Name_From_Codelist(IndicatorCodelist, IndicatorGId, Language);
                        Unit = this.Get_Language_Based_Name_From_Codelist(UnitCodelist, UnitGId, Language);
                        SubgroupVal = this.Get_Language_Based_Name_From_Codelist(SubgroupCodelist, SubgroupValGId, Language);

                        RetVal.Add(IndicatorGId + "@__@" + UnitGId + "@__@" + SubgroupValGId, Indicator + "@__@" + Unit + "@__@" + SubgroupVal);
                    }
                }

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

            throw ex;
        }
        finally
        {
        }

        return RetVal;
    }
Beispiel #18
0
    public static void Create_Constraint_Artefact_For_Version_2_0_SDMLMLFile(string RegistrationId, string DbNId, string UserNId, string AgencyId, string FileURL)
    {
        string InsertQuery, OutputFolder;
        DIConnection DIConnection;
        XmlDocument SimpleDataFileXML;
        XmlNodeList ObjXmlNodeList;
        SDMXObjectModel.Message.StructureType ConstraintStructure;
        SDMXObjectModel.Structure.ContentConstraintType ContentConstraint;
        DataKeySetType DataKeySet;
        DataKeyValueType DataKeyValue;
        int KeyIndex;

        string SimpleDataFileUrl = string.Empty;
        string ConstraintFileName = string.Empty;
        string ConstraintFileLocation = string.Empty;

        InsertQuery = string.Empty;
        OutputFolder = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId + "\\sdmx\\Constraints\\" + UserNId);
        ConstraintFileName = DevInfo.Lib.DI_LibSDMX.Constants.Constraint.Prefix + RegistrationId + ".xml";
        ConstraintFileLocation = OutputFolder + "\\" + ConstraintFileName;
        DIConnection = null;

        try
        {
            DIConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "stock//Database.mdb"), string.Empty, string.Empty);
            SimpleDataFileXML = new XmlDocument();
            if (!String.IsNullOrEmpty(FileURL))
            {
                SimpleDataFileXML.Load(FileURL);
            }
            ObjXmlNodeList = SimpleDataFileXML.GetElementsByTagName("sts:Series");
            ConstraintStructure = new SDMXObjectModel.Message.StructureType();
            ConstraintStructure.Structures = new StructuresType();
            ConstraintStructure.Structures.Constraints = new List<ConstraintType>();

            ContentConstraint = new SDMXObjectModel.Structure.ContentConstraintType();
            ContentConstraint.id = DevInfo.Lib.DI_LibSDMX.Constants.Constraint.Prefix + RegistrationId;
            ContentConstraint.Name.Add(new TextType(null, DevInfo.Lib.DI_LibSDMX.Constants.Constraint.Name + RegistrationId));
            ContentConstraint.agencyID = AgencyId;
            ContentConstraint.version = DevInfo.Lib.DI_LibSDMX.Constants.Constraint.Version;
            ContentConstraint.Description.Add(new TextType(null, DevInfo.Lib.DI_LibSDMX.Constants.Constraint.Description));
            ContentConstraint.Annotations = null;
            ContentConstraint.ReleaseCalendar = null;
            ContentConstraint.ConstraintAttachment = new ContentConstraintAttachmentType();

            if (!String.IsNullOrEmpty(FileURL))
            {
                ContentConstraint.ConstraintAttachment.Items = new object[1];
                ContentConstraint.ConstraintAttachment.Items[0] = FileURL;
                ContentConstraint.ConstraintAttachment.ItemsElementName = new ConstraintAttachmentChoiceType[] { ConstraintAttachmentChoiceType.SimpleDataSource };
            }

            DataKeySet = new DataKeySetType();
            DataKeySet.isIncluded = true;
            ContentConstraint.Items.Add(DataKeySet);
            KeyIndex = 0;
            foreach (XmlNode SeriesNode in ObjXmlNodeList)
            {
                ((DataKeySetType)(ContentConstraint.Items[0])).Key.Add(new DataKeyType());
                foreach (XmlAttribute SeriesAttribute in SeriesNode.Attributes)
                {
                    DataKeyValue = new DataKeyValueType();
                    DataKeyValue.id = SeriesAttribute.Name;
                    DataKeyValue.Items.Add(new SimpleKeyValueType());
                    ((SimpleKeyValueType)(DataKeyValue.Items[0])).Value = SeriesAttribute.Value;
                    ((DataKeySetType)(ContentConstraint.Items[0])).Key[KeyIndex].KeyValue.Add(DataKeyValue);
                }
                KeyIndex = KeyIndex + 1;
            }

            ConstraintStructure.Structures.Constraints.Add(ContentConstraint);

            SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.StructureType), ConstraintStructure, ConstraintFileLocation);
            InsertQuery = "INSERT INTO Artefacts (DBNId, Id, AgencyId, Version, URN, Type, FileLocation)" +
                                " VALUES(" + DbNId + ",'" + ContentConstraint.id + "','" + ContentConstraint.agencyID + "','" + ContentConstraint.version + "','" + string.Empty + "'," + Convert.ToInt32(ArtefactTypes.Constraint).ToString() + ",'" + ConstraintFileLocation + "');";
            DIConnection.ExecuteDataTable(InsertQuery);
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

            throw ex;
        }
        finally
        {
            if (DIConnection != null)
            {
                DIConnection.Dispose();
            }
        }
    }
Beispiel #19
0
    public void Get_SubgroupBreakup(string SubgroupValGId, ref string AgeGId, ref string SexGId, ref string LocationGId, StructureType SourceCodelistStructure, string SelectedAgeCodelist, string SelectedSexCodeList, string SelectedLocationCodelist)
    {
        AgeGId = string.Empty;
        SexGId = string.Empty;
        LocationGId = string.Empty;

        if (SourceCodelistStructure != null && SourceCodelistStructure.Structures != null && SourceCodelistStructure.Structures.Codelists != null &&
            SourceCodelistStructure.Structures.Codelists.Count > 0)
        {
            foreach (SDMXObjectModel.Structure.CodelistType Codelist in SourceCodelistStructure.Structures.Codelists)
            {
                if (Codelist.id == DevInfo.Lib.DI_LibSDMX.Constants.CodeList.SubgroupVal.Id)
                {
                    foreach (SDMXObjectModel.Structure.ItemType Code in Codelist.Items)
                    {
                        if (Code.id == SubgroupValGId)
                        {
                            if (Code.Annotations != null && Code.Annotations.Count > 0)
                            {
                                foreach (AnnotationType Annotation in Code.Annotations)
                                {
                                    if (Annotation.AnnotationTitle == DevInfo.Lib.DI_LibSDMX.Constants.Annotations.Breakup)
                                    {
                                        foreach (string SubgroupSplits in Annotation.AnnotationText[0].Value.Split(','))
                                        {
                                            if (SubgroupSplits.Trim().Contains(SelectedAgeCodelist) && string.IsNullOrEmpty(SelectedAgeCodelist) == false)//SubgroupSplits.Trim().StartsWith(DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + Constants.UNSD.CodeList.Age.Gid)
                                            {
                                                AgeGId = SubgroupSplits.Trim().Replace(SelectedAgeCodelist + DevInfo.Lib.DI_LibSDMX.Constants.EqualsTo, string.Empty);
                                            }
                                            else if (SubgroupSplits.Trim().Contains(SelectedSexCodeList) && string.IsNullOrEmpty(SelectedSexCodeList) == false)//SubgroupSplits.Trim().StartsWith(DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + Constants.UNSD.CodeList.Sex.Gid)
                                            {
                                                SexGId = SubgroupSplits.Trim().Replace(SelectedSexCodeList + DevInfo.Lib.DI_LibSDMX.Constants.EqualsTo, string.Empty);
                                            }
                                            else if (SubgroupSplits.Trim().Contains(SelectedLocationCodelist) && string.IsNullOrEmpty(SelectedLocationCodelist) == false)//DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + Constants.UNSD.CodeList.Location.Gid
                                            {
                                                LocationGId = SubgroupSplits.Trim().Replace(SelectedLocationCodelist + DevInfo.Lib.DI_LibSDMX.Constants.EqualsTo, string.Empty);//DevInfo.Lib.DI_LibSDMX.Constants.CodelistPrefix + Constants.UNSD.CodeList.Location.Gid

                                            }
                                        }
                                    }
                                }
                            }

                            break;
                        }
                    }

                    break;
                }
            }
        }
    }
    public string DataProviderGenerateMetadata(string requestParam)
    {
        string RetVal;
        string[] Params;
        string DBOrDSDDBId, IndicatorNIds, AreaNIds, SourceNIds, UserNId, ErrorMessage, HeaderFilePath;
        bool DBOrDSDFlag;
        int DBNId;
        string OriginalDBNId;
        List<string> GeneratedMetadataFiles, GeneratedIndicatorMetadataFiles, GeneratedAreaMetadataFiles, GeneratedSourceMetadataFiles, ListIndicatorForRegistrations, ListAreaForRegistrations, ListSourceForRegistrations;
        RetVal = string.Empty;
        Params = null;
        DBOrDSDDBId = string.Empty;
        IndicatorNIds = string.Empty;
        AreaNIds = string.Empty;
        SourceNIds = string.Empty;
        UserNId = string.Empty;
        ErrorMessage = string.Empty;
        DBOrDSDFlag = false;
        DBNId = -1;
        GeneratedMetadataFiles = new List<string>();
        GeneratedIndicatorMetadataFiles = new List<string>();
        GeneratedAreaMetadataFiles = new List<string>();
        GeneratedSourceMetadataFiles = new List<string>();
        ListIndicatorForRegistrations = new List<string>();
        ListAreaForRegistrations = new List<string>();
        ListSourceForRegistrations = new List<string>();
        HeaderFilePath = string.Empty;
        OriginalDBNId = string.Empty;
        RetVal = "false";
        try
        {
            Params = Global.SplitString(requestParam, "|");
            DBOrDSDDBId = Params[0].ToString().Trim();
            DBOrDSDFlag = Convert.ToBoolean(Params[1].ToString().Trim());
            IndicatorNIds = Params[2].ToString().Trim();
            AreaNIds = Params[3].ToString().Trim();
            SourceNIds = Params[4].ToString().Trim();
            UserNId = Params[5].ToString().Trim();

            this.Add_Minus_One_To_Selections(ref IndicatorNIds, ref AreaNIds, ref SourceNIds);

            ListIndicatorForRegistrations = this.Get_Indicator_List_For_Registrations(DBOrDSDDBId, DBOrDSDFlag, IndicatorNIds);

            HeaderFilePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBOrDSDDBId.ToString() + "\\" + Constants.FolderName.SDMX.sdmx + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName);
            if (DBOrDSDFlag == true)
            {
                XmlDocument UploadedHeaderXml = new XmlDocument();
                SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
                SDMXObjectModel.Message.StructureHeaderType Header = new SDMXObjectModel.Message.StructureHeaderType();

                if (File.Exists(HeaderFilePath))
                {

                    UploadedHeaderXml.Load(HeaderFilePath);
                    UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
                    Header = UploadedDSDStructure.Header;
                }
                DBNId = Convert.ToInt32(DBOrDSDDBId);
                OriginalDBNId = DBNId.ToString();
                RetVal = this.GenerateMetadata(DBNId, UserNId, IndicatorNIds, AreaNIds, SourceNIds, out GeneratedIndicatorMetadataFiles, out GeneratedAreaMetadataFiles, out GeneratedSourceMetadataFiles, Header);
                ListAreaForRegistrations = this.Get_Area_List_For_Registrations(DBOrDSDDBId, AreaNIds);
                ListSourceForRegistrations = this.Get_Source_List_For_Registrations(DBOrDSDDBId, SourceNIds);
                RetVal = "true";
            }
            else
            {
                DBNId = this.Get_AssociatedDB_NId(DBOrDSDDBId);
                OriginalDBNId = DBNId.ToString();
                RetVal = this.GenerateMetadata_For_UNSD(DBNId, DBOrDSDDBId, IndicatorNIds, out ErrorMessage, out GeneratedMetadataFiles, HeaderFilePath);

            }

            this.Register_MetadataReport(DBOrDSDDBId, UserNId, ListIndicatorForRegistrations, ListAreaForRegistrations, ListSourceForRegistrations, GeneratedMetadataFiles, GeneratedIndicatorMetadataFiles, GeneratedAreaMetadataFiles, GeneratedSourceMetadataFiles, OriginalDBNId);
        }
        catch (Exception ex)
        {
            RetVal = "false" + Constants.Delimiters.ParamDelimiter + ex.Message;
            Global.CreateExceptionString(ex, null);

        }
        finally
        {
        }

        return RetVal;
    }
Beispiel #21
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;
    }
    private void Generate_Header(SDMXSchemaType schemaType, string agencyId, string language, Header header, string outputFolder, string sdmxFolderPath, int DbNId)
    {
        SDMXObjectModel.Message.StructureType Header;

        try
        {
            Header = new SDMXObjectModel.Message.StructureType();
            Header.Header = Get_Appropriate_Header_Of_StructureHeaderType();
            Header.Structures = null;
            Header.Footer = null;
            SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.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.CreateExceptionString(ex, null);
            throw ex;
        }
        finally
        {
        }
    }
Beispiel #23
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;
    }
    private void Send_Notifications_For_Subscriptions_For_Structural_Metadata_Changes(string DbNId)
    {
        Dictionary<string, SubscriptionType> DictSubscriptions;
        List<ArtefactRef> ListOfArtefactRefs;
        bool IsAdminUploadedDSD;
        string ArtefactLanguage, ArtefactName, ArtefactDescription;

        ListOfArtefactRefs = new List<ArtefactRef>();
        ArtefactLanguage = string.Empty;
        ArtefactName = string.Empty;
        ArtefactDescription = string.Empty;

        try
        {

            IsAdminUploadedDSD = Global.IsDSDUploadedFromAdmin(Convert.ToInt32(DbNId));
            if (IsAdminUploadedDSD)
            {
                SDMXApi_2_0.Message.StructureType Summary;
                Summary = new SDMXApi_2_0.Message.StructureType();
                Summary = (SDMXApi_2_0.Message.StructureType)SDMXApi_2_0.Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId + "\\sdmx\\Summary" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension));

                foreach (SDMXApi_2_0.Structure.KeyFamilyType DSD in Summary.KeyFamilies)
                {
                    if ((DSD.Name != null) && (DSD.Name.Count > 0))
                    {
                        ArtefactLanguage = DSD.Name[0].lang;
                        ArtefactName = DSD.Name[0].Value;
                    }
                    if ((DSD.Description != null) && (DSD.Description.Count > 0))
                    {
                        ArtefactDescription = DSD.Description[0].Value;
                    }

                    ListOfArtefactRefs.Add(new ArtefactRef(DSD.id, DSD.agencyID, DSD.version, ArtefactLanguage, ArtefactName, ArtefactDescription, ArtefactTypes.DSD));
                }

                foreach (SDMXApi_2_0.Structure.MetadataStructureDefinitionType MSD in Summary.MetadataStructureDefinitions)
                {
                    if ((MSD.Name != null) && (MSD.Name.Count > 0))
                    {
                        ArtefactLanguage = MSD.Name[0].lang;
                        ArtefactName = MSD.Name[0].Value;
                    }
                    if ((MSD.Description != null) && (MSD.Description.Count > 0))
                    {
                        ArtefactDescription = MSD.Description[0].Value;
                    }
                    ListOfArtefactRefs.Add(new ArtefactRef(MSD.id, MSD.agencyID, MSD.version, ArtefactLanguage, ArtefactName, ArtefactDescription, ArtefactTypes.MSD));
                }
            }
            else
            {
                SDMXObjectModel.Message.StructureType Summary;
                Summary = new SDMXObjectModel.Message.StructureType();
                Summary = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DbNId + "\\sdmx\\Summary" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension));

                foreach (SDMXObjectModel.Structure.DataStructureType DSD in Summary.Structures.DataStructures)
                {
                    if ((DSD.Name != null) && (DSD.Name.Count > 0))
                    {
                        ArtefactLanguage = DSD.Name[0].lang;
                        ArtefactName = DSD.Name[0].Value;
                    }
                    if ((DSD.Description != null) && (DSD.Description.Count > 0))
                    {
                        ArtefactDescription = DSD.Description[0].Value;
                    }

                    ListOfArtefactRefs.Add(new ArtefactRef(DSD.id, DSD.agencyID, DSD.version, ArtefactLanguage, ArtefactName, ArtefactDescription, ArtefactTypes.DSD));
                }

                foreach (SDMXObjectModel.Structure.MetadataStructureType MSD in Summary.Structures.MetadataStructures)
                {
                    if ((MSD.Name != null) && (MSD.Name.Count > 0))
                    {
                        ArtefactLanguage = MSD.Name[0].lang;
                        ArtefactName = MSD.Name[0].Value;
                    }
                    if ((MSD.Description != null) && (MSD.Description.Count > 0))
                    {
                        ArtefactDescription = MSD.Description[0].Value;
                    }
                    ListOfArtefactRefs.Add(new ArtefactRef(MSD.id, MSD.agencyID, MSD.version, ArtefactLanguage, ArtefactName, ArtefactDescription, ArtefactTypes.MSD));
                }
            }

            DictSubscriptions = this.Get_Subscriptions_Dictionary_For_Structural_Metadata_Changes(DbNId);

            foreach (string RegistryURN in DictSubscriptions.Keys)
            {
                this.Send_Notifications_For_Current_Subscription_For_Structural_Metadata_Changes(DictSubscriptions[RegistryURN], ListOfArtefactRefs);
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);
            throw ex;
        }
        finally
        {

        }
    }
Beispiel #25
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 UpdateCategorySchemeForUploadedDSDWithHeader(string DbNId, string UserNId, string DataBaseNId)
    {
        bool RetVal;
        SDMXObjectModel.Message.StructureType CategorySchemeStructure;
        SDMXObjectModel.Message.StructureType ProvisioningMetadata;
        SDMXObjectModel.Message.StructureType ProvisionAgreement;
        RetVal = true;
        string UploadedHeaderFileWPath = string.Empty;
        string UploadedHeaderFolderPath = Server.MapPath("../../stock/data");
        string UploadedHeaderName = string.Empty;
        string CategorySchemeFolderPath = string.Empty;
        string ProvisonMetadataFolderPath = string.Empty;
        string ProvisionAgreementFolderPath = string.Empty;
        XmlDocument UploadedHeaderXml = new XmlDocument();
        string[] Files = null;
        string[] PAs = null;
        string[] PMetadata = null;
        string filename = string.Empty;
        try
        {
            UploadedHeaderFileWPath = UploadedHeaderFolderPath + "/" + DataBaseNId + "/" + "sdmx" + "/" + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName;
            CategorySchemeFolderPath = UploadedHeaderFolderPath + "/" + DbNId + "/" + "sdmx" + "/" + "Categories";
            ProvisonMetadataFolderPath = UploadedHeaderFolderPath + "/" + DbNId + "/" + "sdmx" + "/" + "Provisioning Metadata";
            ProvisionAgreementFolderPath = UploadedHeaderFolderPath + "/" + DbNId + "/" + "sdmx" + "/" + "Provisioning Metadata" + "/" + "PAs";
            UploadedHeaderXml.Load(UploadedHeaderFileWPath);
            SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
            SDMXObjectModel.Message.StructureHeaderType Header = new SDMXObjectModel.Message.StructureHeaderType();
            UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
            Header = UploadedDSDStructure.Header;

            Files = Directory.GetFiles(CategorySchemeFolderPath);
            foreach (string categorySchemeFile in Files)
            {
                CategorySchemeStructure = new SDMXObjectModel.Message.StructureType();
                CategorySchemeStructure = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), categorySchemeFile);
                CategorySchemeStructure.Header = Header;
                CategorySchemeStructure.Structures.Categorisations = null;
                CategorySchemeStructure.Structures.Codelists = null;
                CategorySchemeStructure.Structures.HierarchicalCodelists = null;
                CategorySchemeStructure.Structures.Concepts = null;
                CategorySchemeStructure.Structures.Metadataflows = null;
                CategorySchemeStructure.Structures.MetadataStructures = null;
                CategorySchemeStructure.Structures.ProvisionAgreements = null;
                CategorySchemeStructure.Structures.ReportingTaxonomies = null;
                CategorySchemeStructure.Structures.StructureSets = null;
                CategorySchemeStructure.Structures.OrganisationSchemes = null;
                CategorySchemeStructure.Structures.Dataflows = null;
                CategorySchemeStructure.Structures.Constraints = null;
                CategorySchemeStructure.Structures.DataStructures = null;
                CategorySchemeStructure.Structures.Processes = null;
                CategorySchemeStructure.Footer = null;
                Remove_Extra_Annotations(CategorySchemeStructure);
                SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.StructureType), CategorySchemeStructure, categorySchemeFile);
            }

            PAs = Directory.GetFiles(ProvisionAgreementFolderPath);
            foreach (string paFile in PAs)
            {
                ProvisionAgreement = new SDMXObjectModel.Message.StructureType();
                ProvisionAgreement = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), paFile);
                ProvisionAgreement.Header = Header;
                ProvisionAgreement.Structures.Categorisations = null;
                ProvisionAgreement.Structures.Codelists = null;
                ProvisionAgreement.Structures.HierarchicalCodelists = null;
                ProvisionAgreement.Structures.Concepts = null;
                ProvisionAgreement.Structures.Metadataflows = null;
                ProvisionAgreement.Structures.MetadataStructures = null;
                ProvisionAgreement.Structures.ReportingTaxonomies = null;
                ProvisionAgreement.Structures.StructureSets = null;
                ProvisionAgreement.Structures.OrganisationSchemes = null;
                ProvisionAgreement.Structures.Dataflows = null;
                ProvisionAgreement.Structures.Constraints = null;
                ProvisionAgreement.Structures.DataStructures = null;
                ProvisionAgreement.Structures.Processes = null;
                ProvisionAgreement.Structures.CategorySchemes = null;
                ProvisionAgreement.Footer = null;
                Remove_Extra_Annotations(ProvisionAgreement);
                SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.StructureType), ProvisionAgreement, paFile);
            }

            PMetadata = Directory.GetFiles(ProvisonMetadataFolderPath);
            foreach (string pmetadataFile in PMetadata)
            {
                filename = string.Empty;
                ProvisioningMetadata = new SDMXObjectModel.Message.StructureType();
                ProvisioningMetadata = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.StructureType), pmetadataFile);
                ProvisioningMetadata.Header = Header;
                filename = ExtractFilename(pmetadataFile);
                if (filename.Contains("DF"))
                {
                    ProvisioningMetadata.Structures.Metadataflows = null;
                }
                else
                {
                    ProvisioningMetadata.Structures.Dataflows = null;
                }
                ProvisioningMetadata.Structures.Categorisations = null;
                ProvisioningMetadata.Structures.Codelists = null;
                ProvisioningMetadata.Structures.HierarchicalCodelists = null;
                ProvisioningMetadata.Structures.Concepts = null;
                ProvisioningMetadata.Structures.MetadataStructures = null;
                ProvisioningMetadata.Structures.ProvisionAgreements = null;
                ProvisioningMetadata.Structures.ReportingTaxonomies = null;
                ProvisioningMetadata.Structures.StructureSets = null;
                ProvisioningMetadata.Structures.OrganisationSchemes = null;
                ProvisioningMetadata.Structures.Constraints = null;
                ProvisioningMetadata.Structures.DataStructures = null;
                ProvisioningMetadata.Structures.Processes = null;
                ProvisioningMetadata.Structures.CategorySchemes = null;
                ProvisioningMetadata.Footer = null;
                Remove_Extra_Annotations(ProvisioningMetadata);
                SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.StructureType), ProvisioningMetadata, pmetadataFile);
            }
        }
        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;
    }
Beispiel #27
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 bool UpdateNonMAForUploadedDSDWithHeader(string DbNId, string UserNId, string DataBaseNId)
    {
        bool RetVal;
        SDMXObjectModel.Message.RegistryInterfaceType Registrations;
        SDMXApi_2_0.Message.GenericMetadataType MetadataFiles;
        //SDMXObjectModel.Message.GenericDataType DataFiles;

        SDMXApi_2_0.Message.CompactDataType DataFiles;
        SDMXObjectModel.Message.RegistryInterfaceType Subscriptions;
        RetVal = true;
        string UploadedHeaderFileWPath = string.Empty;
        string UploadedHeaderFolderPath = Server.MapPath("../../stock/data");
        string UploadedDSDHeaderFilePath = string.Empty;
        string UploadedHeaderName = string.Empty;
        string SubscriptionsFolderPath = string.Empty;
        string MetadataFolderPath = string.Empty;
        string RegistrationsFolderPath = string.Empty;
        string SDMXMLFolderPath = string.Empty;
        string MappingFolderPath = string.Empty;
        XmlDocument UploadedHeaderXml = new XmlDocument();
        XmlDocument UploadedHeaderXmlFor2_0 = new XmlDocument();
        FileInfo[] Files = null;

        DirectoryInfo dirRegs = null;
        DirectoryInfo dirMetadata = null;
        DirectoryInfo dirSubscriptions = null;
        DirectoryInfo dirSDMXML = null;

        try
        {
            UploadedHeaderFileWPath = UploadedHeaderFolderPath + "/" + DataBaseNId + "/" + "sdmx" + "/" + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName;
            UploadedDSDHeaderFilePath = UploadedHeaderFolderPath + "/" + DbNId + "/" + "sdmx" + "/" + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName;
            dirRegs = new DirectoryInfo(UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Registrations");
            dirMetadata = new DirectoryInfo(UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Metadata");
            dirSDMXML = new DirectoryInfo(UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "SDMX-ML");
            dirSubscriptions = new DirectoryInfo(UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Subscriptions");
            MappingFolderPath = UploadedHeaderFolderPath + "/" + DbNId + "/" + "sdmx" + "/" + "Mappings";
            UploadedHeaderXml.Load(UploadedHeaderFileWPath);
            UploadedHeaderXmlFor2_0.Load(UploadedDSDHeaderFilePath);
            SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
            SDMXObjectModel.Message.StructureHeaderType Header = new SDMXObjectModel.Message.StructureHeaderType();

            SDMXApi_2_0.Message.StructureType UploadedDSDStruct20 = new SDMXApi_2_0.Message.StructureType();
            SDMXApi_2_0.Message.HeaderType DSDHeader = new SDMXApi_2_0.Message.HeaderType();

            UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
            Header = UploadedDSDStructure.Header;
            UploadedDSDStruct20 = (SDMXApi_2_0.Message.StructureType)SDMXApi_2_0.Deserializer.LoadFromXmlDocument(typeof(SDMXApi_2_0.Message.StructureType), UploadedHeaderXmlFor2_0);
            DSDHeader = UploadedDSDStruct20.Header;

            foreach (DirectoryInfo dirReg in dirRegs.GetDirectories())
            {
                Files = dirReg.GetFiles();
                foreach (FileInfo regfile in Files)
                {
                    Registrations = new SDMXObjectModel.Message.RegistryInterfaceType();

                    Registrations = (SDMXObjectModel.Message.RegistryInterfaceType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.RegistryInterfaceType), UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Registrations" + "\\" + dirReg.Name + "\\" + regfile.ToString());

                    Registrations.Header.ID = Header.ID.ToString();
                    Registrations.Header.Prepared = Header.Prepared.ToString();
                    foreach (PartyType receiver in Header.Receiver)
                    {
                        Registrations.Header.Receiver.Contact = receiver.Contact;
                        Registrations.Header.Receiver.id = receiver.id;
                        Registrations.Header.Receiver.Name = receiver.Name;
                    }
                    Registrations.Header.Sender = (SDMXObjectModel.Message.SenderType)Header.Sender;
                    Registrations.Header.Test = Header.Test;

                    Registrations.Footer = null;
                    SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.RegistryInterfaceType), Registrations, UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Registrations" + "\\" + dirReg.Name + "\\" + regfile.ToString());
                }
            }

            foreach (DirectoryInfo dirMeta in dirMetadata.GetDirectories())
            {
                Files = null;
                Files = dirMeta.GetFiles();
                foreach (FileInfo metafile in Files)
                {
                    MetadataFiles = new SDMXApi_2_0.Message.GenericMetadataType();

                    MetadataFiles = (SDMXApi_2_0.Message.GenericMetadataType)Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.GenericMetadataType), UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Metadata" + "\\" + dirMeta.Name + "\\" + metafile.ToString());

                    MetadataFiles.Header.ID = DSDHeader.ID.ToString();
                    MetadataFiles.Header.Prepared = DSDHeader.Prepared.ToString();
                    MetadataFiles.Header.Receiver = DSDHeader.Receiver;
                    MetadataFiles.Header.Sender = DSDHeader.Sender;
                    MetadataFiles.Header.Test = DSDHeader.Test;

                    SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.GenericMetadataType), MetadataFiles, UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Metadata" + "\\" + dirMeta.Name + "\\" + metafile.ToString());
                }
            }

            foreach (DirectoryInfo dirSDMX in dirSDMXML.GetDirectories())
            {
                Files = null;
                Files = dirSDMX.GetFiles();
                foreach (FileInfo sdmxMlFile in Files)
                {
                    DataFiles = new SDMXApi_2_0.Message.CompactDataType();

                    DataFiles = (SDMXApi_2_0.Message.CompactDataType)Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.CompactDataType), UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "SDMX-ML" + "\\" + dirSDMX.Name + "\\" + sdmxMlFile.ToString());

                    DataFiles.Header.ID = DSDHeader.ID.ToString();
                    DataFiles.Header.Prepared = Header.Prepared.ToString();
                    DataFiles.Header.Receiver = DSDHeader.Receiver;
                    DataFiles.Header.Sender = DSDHeader.Sender;
                    DataFiles.Header.Test = DSDHeader.Test;

                    SDMXApi_2_0.Serializer.SerializeToFile(typeof(SDMXApi_2_0.Message.CompactDataType), DataFiles, UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "SDMX-ML" + "\\" + dirSDMX.Name + "\\" + sdmxMlFile.ToString());
                }
            }

            foreach (DirectoryInfo dirSubs in dirSubscriptions.GetDirectories())
            {
                Files = null;
                Files = dirSubs.GetFiles();
                foreach (FileInfo subsFile in Files)
                {
                    Subscriptions = new SDMXObjectModel.Message.RegistryInterfaceType();

                    Subscriptions = (SDMXObjectModel.Message.RegistryInterfaceType)Deserializer.LoadFromFile(typeof(SDMXObjectModel.Message.RegistryInterfaceType), UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Subscriptions" + "\\" + dirSubs.Name + "\\" + subsFile.ToString());

                    Subscriptions.Header.ID = Header.ID.ToString();
                    Subscriptions.Header.Prepared = Header.Prepared.ToString();
                    foreach (PartyType receiver in Header.Receiver)
                    {
                        Subscriptions.Header.Receiver.Contact = receiver.Contact;
                        Subscriptions.Header.Receiver.id = receiver.id;
                        Subscriptions.Header.Receiver.Name = receiver.Name;
                    }
                    Subscriptions.Header.Sender = (SDMXObjectModel.Message.SenderType)Header.Sender;
                    Subscriptions.Header.Test = Header.Test;

                    Subscriptions.Footer = null;
                    SDMXObjectModel.Serializer.SerializeToFile(typeof(SDMXObjectModel.Message.RegistryInterfaceType), Subscriptions, UploadedHeaderFolderPath + "\\" + DbNId + "\\" + "sdmx" + "\\" + "Subscriptions" + "\\" + dirSubs.Name + "\\" + subsFile.ToString());
                }
            }

        }
        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;
    }
Beispiel #29
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
        {
        }
    }
    public string GetDataForGenerateApiCall(string requestParam)
    {
        string RetVal;
        string[] Params;
        int DBNId;
        string SelectedFunction;
        string Id;
        string AgencyId;
        string Version;
        string UserIdAndType;
        string UploadedHeaderFileWPath, UploadedHeaderFolderPath;
        Registry.RegistryService Service;
        SDMXObjectModel.Message.StructureHeaderType Header;
        SDMXApi_2_0.Message.HeaderType Header_2_0;
        XmlDocument Query;
        XmlElement Element;
        XmlDocument Response;
        XmlDocument UploadedHeaderXml;

        string agencyId;
        List<bool> isSOAPMailIds;
        List<string> notificationMailIds;
        List<bool> isSOAPHTTPs;
        List<string> notificationHTTPs;
        DateTime startDate;
        DateTime endDate;
        string eventSelector;
        Dictionary<string, string> dictCategories;
        string mfdId;
        string CategoriesGIDAndSchemeIds;
        string CategoryGID;
        string CategorySchemeId;
        string DFDOrMFDId;
        string WebServiceURL;
        bool IsREST;
        string WADLURL;
        bool IsSOAP;
        string WSDLURL;
        string FileURL;
        string RequestURL;
        string ResponseURL;
        string preferredLangNid;
        string[] DBDetails;
        string checkIfSDMXDB;
        RetVal = string.Empty;
        Params = null;
        DBNId = -1;
        SelectedFunction = string.Empty;
        Id = string.Empty;
        AgencyId = string.Empty;
        Version = string.Empty;
        UserIdAndType = string.Empty;
        Service = new Registry.RegistryService();

        Service.Url = HttpContext.Current.Request.Url.OriginalString.Substring(0, HttpContext.Current.Request.Url.OriginalString.IndexOf("libraries")) + Constants.FolderName.SDMX.RegistryServicePath;
        Query = new XmlDocument();
        Response = new XmlDocument();
        Element = null;

        agencyId = string.Empty;
        isSOAPMailIds = new List<bool>();
        notificationMailIds = new List<string>();
        isSOAPHTTPs = new List<bool>();
        notificationHTTPs = new List<string>();
        startDate = new DateTime();
        endDate = new DateTime();
        eventSelector = string.Empty;
        dictCategories = new Dictionary<string, string>();
        mfdId = string.Empty;
        CategoriesGIDAndSchemeIds = string.Empty;
        CategoryGID = string.Empty;
        CategorySchemeId = string.Empty;

        DFDOrMFDId = string.Empty;
        WebServiceURL = string.Empty;
        IsREST = false;
        WADLURL = string.Empty;
        IsSOAP = false;
        WSDLURL = string.Empty;
        FileURL = string.Empty;
        RequestURL = string.Empty;
        ResponseURL = string.Empty;
        preferredLangNid = string.Empty;
        DBDetails = null;
        checkIfSDMXDB = string.Empty;
        Header = new SDMXObjectModel.Message.StructureHeaderType();
        Header_2_0 = new SDMXApi_2_0.Message.HeaderType();
        UploadedHeaderXml = new XmlDocument();
        UploadedHeaderFolderPath = Server.MapPath("../../stock/data");
        try
        {
            Params = Global.SplitString(requestParam, Constants.Delimiters.ParamDelimiter);
            DBNId = Convert.ToInt32(Params[0].ToString().Trim());
            SelectedFunction = Params[1].ToString().Trim();

            DBDetails = Global.GetDbConnectionDetails(Convert.ToString(DBNId));
           checkIfSDMXDB = DBDetails[4].ToString();

            UploadedHeaderFileWPath = UploadedHeaderFolderPath + "/" + DBNId + "/" + "sdmx" + "/" + DevInfo.Lib.DI_LibSDMX.Constants.Header.FileName;
            if (File.Exists(UploadedHeaderFileWPath))
            {
                UploadedHeaderXml.Load(UploadedHeaderFileWPath);
                if (checkIfSDMXDB == "true")
                {
                    SDMXApi_2_0.Message.StructureType UploadedDSDStructure = new SDMXApi_2_0.Message.StructureType();
                    UploadedDSDStructure = (SDMXApi_2_0.Message.StructureType)SDMXApi_2_0.Deserializer.LoadFromXmlDocument(typeof(SDMXApi_2_0.Message.StructureType), UploadedHeaderXml);
                    Header_2_0 = UploadedDSDStructure.Header;
                }
                else
                {
                    SDMXObjectModel.Message.StructureType UploadedDSDStructure = new SDMXObjectModel.Message.StructureType();
                    UploadedDSDStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), UploadedHeaderXml);
                    Header = UploadedDSDStructure.Header;
                }

            }

            if ((SelectedFunction == "QuerySubscription") || (SelectedFunction == "QueryRegistration"))
            {
                UserIdAndType = Params[2].ToString().Trim();
            }
            else if (SelectedFunction == "SubmitSubscription")
            {
                UserIdAndType = Params[2].ToString().Trim();

                if (Params[3].ToString().Trim() == "0")
                {
                    isSOAPMailIds = new List<bool>();
                    isSOAPMailIds.Add(false);
                    isSOAPHTTPs = new List<bool>();
                    isSOAPHTTPs.Add(false);
                }
                else
                {
                    isSOAPMailIds = new List<bool>();
                    isSOAPMailIds.Add(true);
                    isSOAPHTTPs = new List<bool>();
                    isSOAPHTTPs.Add(true);
                }
                notificationMailIds = new List<string>();
                notificationMailIds.Add(Params[4].ToString().Trim());
                notificationHTTPs = new List<string>();
                notificationHTTPs.Add(Params[5].ToString().Trim());
                startDate = DateTime.ParseExact(Params[6].ToString().Trim(), "dd-MM-yyyy", null);
                endDate = DateTime.ParseExact(Params[7].ToString().Trim(), "dd-MM-yyyy", null);
                eventSelector = Params[8].ToString().Trim();
                CategoriesGIDAndSchemeIds = Params[9].ToString().Trim();
                dictCategories = new Dictionary<string, string>();
                if (eventSelector == "Data Registration")
                {
                    foreach (string CategoryGIDAndSchemeId in Global.SplitString(CategoriesGIDAndSchemeIds, ","))
                    {
                        CategoryGID = CategoryGIDAndSchemeId.Split('|')[0];
                        CategorySchemeId = CategoryGIDAndSchemeId.Split('|')[1];
                        dictCategories.Add(CategoryGID, CategorySchemeId);
                    }
                }
                agencyId = Global.Get_AgencyId_From_DFD(DBNId.ToString());
                mfdId = Params[10].ToString().Trim();
                preferredLangNid = Params[11].ToString().Trim();
            }
            else if (SelectedFunction == "SubmitRegistration")
            {
                UserIdAndType = Params[2].ToString().Trim();
                agencyId = Global.Get_AgencyId_From_DFD(DBNId.ToString());
                DFDOrMFDId = Params[3].ToString().Trim();
                FileURL = Params[4].ToString().Trim();
            }
            else
            {
                Id = Params[2].ToString().Trim();
                AgencyId = Params[3].ToString().Trim();
                Version = Params[4].ToString().Trim();
            }

            Service.Url += "?p=" + DBNId.ToString();
            RetVal = Service.Url;
            RetVal += Constants.Delimiters.ParamDelimiter + SelectedFunction;
            switch (SelectedFunction)
            {
                case "GetDataflow":
                    Query = GetQueryXmlDocumentOnTypeBasis(0, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetDataflow(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetMetadataflow":
                    Query = GetQueryXmlDocumentOnTypeBasis(1, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetMetadataflow(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetDataStructure":
                    Query = GetQueryXmlDocumentOnTypeBasis(2, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetDataStructure(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetMetadataStructure":
                    Query = GetQueryXmlDocumentOnTypeBasis(3, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetMetadataStructure(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetCategoryScheme":
                    Query = GetQueryXmlDocumentOnTypeBasis(4, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetCategoryScheme(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetCategorisation":
                    Query = GetQueryXmlDocumentOnTypeBasis(5, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetCategorisation(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetConceptScheme":
                    Query = GetQueryXmlDocumentOnTypeBasis(6, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetConceptScheme(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetCodelist":
                    Query = GetQueryXmlDocumentOnTypeBasis(7, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetCodelist(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetOrganisationScheme":
                    Query = GetQueryXmlDocumentOnTypeBasis(8, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetOrganisationScheme(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetProvisionAgreement":
                    Query = GetQueryXmlDocumentOnTypeBasis(9, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetProvisionAgreement(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetConstraint":
                    Query = GetQueryXmlDocumentOnTypeBasis(10, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetConstraint(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetStructures":
                    Query = GetQueryXmlDocumentOnTypeBasis(11, Id, AgencyId, Version, string.Empty);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.GetStructures(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "QuerySubscription":
                    Query = GetQueryXmlDocumentOnTypeBasis(12, Id, AgencyId, Version, UserIdAndType);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.QuerySubscription(ref Element);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "QueryRegistration":
                    Query = GetQueryXmlDocumentOnTypeBasis(13, Id, AgencyId, Version, UserIdAndType);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.QueryRegistration(ref Element,preferredLangNid);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "SubmitSubscription":
                    Query = GetQueryXmlDocumentForSubmitSubscription(ActionType.Append, UserIdAndType, agencyId, isSOAPMailIds, notificationMailIds, isSOAPHTTPs, notificationHTTPs, startDate, endDate, eventSelector, dictCategories, mfdId, string.Empty,Header);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.SubmitSubscription(ref Element, preferredLangNid);//language code
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "SubmitRegistration":
                    Query = GetQueryXmlDocumentForSubmitRegistration(UserIdAndType, agencyId, DFDOrMFDId, WebServiceURL, IsREST, WADLURL, IsSOAP, WSDLURL, FileURL);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Query);
                    Element = Query.DocumentElement;
                    Service.SubmitRegistration(ref Element, string.Empty, preferredLangNid);
                    Response.LoadXml(Element.OuterXml);
                    RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
                    RequestURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Query));
                    ResponseURL = SaveContentTemporarilyandDeleteOtherFiles(this.Get_Formatted_XML(Response));
                    RetVal += Constants.Delimiters.ParamDelimiter + RequestURL;
                    RetVal += Constants.Delimiters.ParamDelimiter + ResponseURL;
                    break;
                case "GetGenericData":

                    break;
                case "GetGenericTimeSeriesData":

                    break;
                case "GetStructureSpecificData":

                    break;
                case "GetStructureSpecificTimeSeriesData":

                    break;
                case "GetGenericMetadata":

                    break;
                case "GetStructureSpecificMetadata":

                    break;
                case "SubmitStructure":

                    break;
                case "GetReportingTaxonomy":

                    break;
                case "GetStructureSet":

                    break;
                case "GetProcess":

                    break;
                case "GetHierarchicalCodelist":

                    break;
                case "GetDataSchema":

                    break;
                case "GetMetadataSchema":

                    break;
                default:
                    break;
            }
        }
        catch (SoapException SOAPex)
        {
            Response.LoadXml(SOAPex.Detail.InnerText);
            RetVal += Constants.Delimiters.ParamDelimiter + this.Get_Formatted_XML(Response);
            Global.CreateExceptionString(SOAPex, null);
        }
        catch (Exception ex)
        {
            RetVal += "false" + Constants.Delimiters.ParamDelimiter + ex.Message;
            Global.CreateExceptionString(ex, null);
        }
        finally
        {
        }

        return RetVal;
    }
Beispiel #31
0
    private Dictionary<string, string> Get_DictSourceCodelist(string Language, string CodelistId, StructureType Structure,string SelectedAreaLevel=null)
    {
        Dictionary<string, string> RetVal;
        string CodeId, CodeName;
        SDMXObjectModel.Structure.CodelistType SourceCodelist;

        RetVal = new Dictionary<string, string>();
        CodeId = string.Empty;
        CodeName = string.Empty;
        SourceCodelist = null;

        try
        {

            if (Structure != null && Structure.Structures != null && Structure.Structures.Codelists != null && Structure.Structures.Codelists.Count > 0)
            {
                foreach (SDMXObjectModel.Structure.CodelistType Codelist in Structure.Structures.Codelists)
                {
                    if (Codelist.id == CodelistId)
                    {
                        SourceCodelist = Codelist;
                        break;
                    }
                }

                if (SourceCodelist != null && SourceCodelist.Items != null && SourceCodelist.Items.Count > 0)
                {
                    foreach (SDMXObjectModel.Structure.ItemType Code in SourceCodelist.Items)
                    {
                        CodeId = Code.id;
                        CodeName = this.GetLangSpecificValue_For_Version_2_1(Code.Name, Language);
                        // Add Country Level Areas in the list
                        if (CodelistId == DevInfo.Lib.DI_LibSDMX.Constants.CodeList.Area.Id)
                        {
                            if (SelectedAreaLevel == "null")
                            {
                                SelectedAreaLevel = Global.registryAreaLevel;
                            }

                            if (Code.Annotations != null && Code.Annotations.Count > 0)
                            {
                                foreach (AnnotationType Annotation in Code.Annotations)
                                {
                                    if (Annotation.AnnotationTitle == DevInfo.Lib.DI_LibSDMX.Constants.Annotations.Area_Level && Annotation.AnnotationText[0].Value.ToString() == SelectedAreaLevel)//Global.registryAreaLevel.ToString()
                                    {
                                        RetVal.Add(CodeId, CodeName);
                                    }
                                }
                            }
                        }
                        else
                        {
                            RetVal.Add(CodeId, CodeName);
                        }

                    }
                }

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

            throw ex;
        }
        finally
        {
        }

        return RetVal;
    }