当前位置: 首页>>代码示例>>C#>>正文


C# Callback.SaveAppSettingValue方法代码示例

本文整理汇总了C#中Callback.SaveAppSettingValue方法的典型用法代码示例。如果您正苦于以下问题:C# Callback.SaveAppSettingValue方法的具体用法?C# Callback.SaveAppSettingValue怎么用?C# Callback.SaveAppSettingValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Callback的用法示例。


在下文中一共展示了Callback.SaveAppSettingValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Generate_MetadataReport

    internal static bool Generate_MetadataReport(string SummaryFileName, string CodelistMappingFileName, string MetadataMappingFileName, string IndicatorNIds, string TargetAreaId, DIConnection DIConnection, DIQueries DIQueries, string OutputFolder, out string ErrorMessage, out List<string> GeneratedMetadataFiles, string HeaderfilePath, string xmlMetaFilePath)
    {
        bool RetVal;
        SDMXApi_2_0.Message.StructureType Summary;
        SDMXApi_2_0.Message.GenericMetadataType GenericMetadata;
        string MetadataSetName, MetadataStructureRef, MetadataStructureAgencyRef, ReportRef, TargetRef;
        string IndicatorNId, IndicatorGId,AreaId;
        Dictionary<string, string> DictIndicatorMapping, DictMetadataMapping,DictAreaMapping;
        DataTable DtIndicator,DtArea;
        ReportedAttributeType ReportedAttribute;
        DateTime CurrentTime;
        ErrorMessage = string.Empty;
        RetVal = false;
        CurrentTime = DateTime.Now;
        GeneratedMetadataFiles = new List<string>();

        XmlDocument UploadedHeaderXml = new XmlDocument();
        string AppSettingFile = string.Empty;
        XmlDocument XmlDoc;
        SDMXApi_2_0.Message.StructureType UploadedDSDStructure = new SDMXApi_2_0.Message.StructureType();
        SDMXApi_2_0.Message.HeaderType Header = new SDMXApi_2_0.Message.HeaderType();
        DataSet ds = new DataSet();
        Callback objCallBack = new Callback();
        AppSettingFile = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, ConfigurationManager.AppSettings[Constants.WebConfigKey.AppSettingFile]);
        if (File.Exists(HeaderfilePath))
        {
            UploadedHeaderXml.Load(HeaderfilePath);
            UploadedDSDStructure = (SDMXApi_2_0.Message.StructureType)SDMXApi_2_0.Deserializer.LoadFromXmlDocument(typeof(SDMXApi_2_0.Message.StructureType), UploadedHeaderXml);
            Header = UploadedDSDStructure.Header;
        }
        if (File.Exists(xmlMetaFilePath))
        {
            ds.ReadXml(xmlMetaFilePath);

        }
        try
        {
            Summary = (SDMXApi_2_0.Message.StructureType)SDMXApi_2_0.Deserializer.LoadFromFile(typeof(SDMXApi_2_0.Message.StructureType), SummaryFileName);
            MetadataSetName = "CountryData Metadata";

            if (Summary.MetadataStructureDefinitions.Count > 0)
            {
                MetadataStructureRef = Summary.MetadataStructureDefinitions[0].id;
                MetadataStructureAgencyRef = Summary.MetadataStructureDefinitions[0].agencyID;
                ReportRef = Summary.MetadataStructureDefinitions[0].ReportStructure[0].id;
                TargetRef = Summary.MetadataStructureDefinitions[0].ReportStructure[0].target;

                DtIndicator = DIConnection.ExecuteDataTable(DIQueries.Indicators.GetIndicator(FilterFieldType.NId, IndicatorNIds, FieldSelection.Light));
                DtIndicator = DtIndicator.DefaultView.ToTable(true, DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Indicator.IndicatorNId,
                              DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Indicator.IndicatorGId);

                DtArea = DIConnection.ExecuteDataTable(DIQueries.Area.GetAreaByAreaLevel(Global.registryAreaLevel));
                DtArea = DtArea.DefaultView.ToTable(true, DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Area.AreaID,
                            DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Area.AreaGId);

                DictIndicatorMapping = RegTwoZeroFunctionality.Get_Indicator_Mapping_Dict(CodelistMappingFileName, string.Empty);
                DictAreaMapping = RegTwoZeroFunctionality.Get_Area_Mapping_Dict(CodelistMappingFileName);
                foreach (DataRow DrArea in DtArea.Rows)
                {
                    AreaId = DrArea[DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Area.AreaID].ToString();
                    if (DictAreaMapping.ContainsKey(AreaId))
                    {
                        if (DictAreaMapping.Count == 1)
                        {
                            TargetAreaId = DictAreaMapping[AreaId].ToString();//DrArea[DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Area.AreaID].ToString();
                        }
                    }
                }

                if (TargetAreaId != Global.registryMSDAreaId)
                {
                    XmlDoc = new XmlDocument();
                    XmlDoc.Load(AppSettingFile);
                    objCallBack.SaveAppSettingValue(XmlDoc, Constants.AppSettingKeys.registryMSDAreaId, TargetAreaId);
                    XmlDoc.Save(AppSettingFile);
                }

                if (File.Exists(MetadataMappingFileName))
                {
                    DictMetadataMapping = Get_Metadata_Mapping_Dict(MetadataMappingFileName);
                    foreach (DataRow DrIndicator in DtIndicator.Rows)
                    {
                        IndicatorNId = DrIndicator[DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Indicator.IndicatorNId].ToString();
                        IndicatorGId = DrIndicator[DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Indicator.IndicatorGId].ToString();

                        if (DictIndicatorMapping.ContainsKey(IndicatorGId))
                        {
                            if (File.Exists(xmlMetaFilePath))
                            {
                                foreach (DataRow DSRow in ds.Tables["Data"].Select("Ind=" + IndicatorNId))
                                {

                                    IndicatorNId = DSRow["Ind"].ToString();

                                }
                            }
                            GenericMetadata = new SDMXApi_2_0.Message.GenericMetadataType();
                            // GenericMetadata.Header = RegTwoZeroFunctionality.Get_Appropriate_Header();
                            if (!File.Exists(HeaderfilePath))
                            {
//.........这里部分代码省略.........
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:101,代码来源:RegTwoZeroMetadata.cs


注:本文中的Callback.SaveAppSettingValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。