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


C# DIConnection.DILanguages方法代码示例

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


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

示例1: GetMapServerQueries

    public static DIQueries GetMapServerQueries(string DataPrefix_UI, string LanguageCode_UI, DIConnection connection)
    {
        //TO Do GetConnection from web service
        DIQueries RetVal = null;

        try
        {
            if (connection.DIDataSets().Select(DBAvailableDatabases.AvlDBPrefix + "='" + DataPrefix_UI.Trim('_') + "'").Length == 0)
            {
                DataPrefix_UI = connection.DIDataSetDefault();
            }

            if (connection.DILanguages(DataPrefix_UI).Select(Language.LanguageCode + "='" + LanguageCode_UI + "'").Length == 0)
            {
                LanguageCode_UI = connection.DILanguageCodeDefault(DataPrefix_UI);
            }

            RetVal = new DIQueries(DataPrefix_UI, LanguageCode_UI);
        }
        catch (Exception ex)
        {
            throw ex;
        }

        return RetVal;
    }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:26,代码来源:Global.cs

示例2: GetAllDBLangaugeCodesByDbNid

 public static DataTable GetAllDBLangaugeCodesByDbNid(int DBNid, DIConnection diConnection)
 {
     DataTable RetVal = null;
     //DIConnection DIConnection;
     if (DBNid != 0)
     {
         //DIConnection = Global.GetDbConnection(DBNid);
         RetVal = diConnection.DILanguages(diConnection.DIDataSetDefault());
     }
     return RetVal;
 }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:11,代码来源:Global.cs

示例3: GetAllAvailableLanguageCode

    /// <summary>
    /// Get all available language code from database
    /// </summary>
    /// <param name="diConnection"></param>
    /// <returns></returns>
    public static string[] GetAllAvailableLanguageCode(DIConnection diConnection)
    {
        string[] RetVal;
        DataTable DTAvailableLanguages = null;
        List<string> AvlLanguages = new List<string>();

        try
        {
            DTAvailableLanguages = diConnection.DILanguages(diConnection.DIDataSetDefault());

            foreach (DataRow Row in DTAvailableLanguages.Rows)
            {
                AvlLanguages.Add(Row["Language_Code"].ToString());
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);

        }

        RetVal = AvlLanguages.ToArray();

        return RetVal;
    }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:30,代码来源:Global.cs

示例4: Generate_Data


//.........这里部分代码省略.........
        Obs = null;
        DictAreaMapping = null;
        CurrentTime = DateTime.Now;
        IndicatorName = string.Empty;
        XmlDocument UploadedHeaderXml = new XmlDocument();
        DataSet ds = new DataSet();
        SDMXApi_2_0.Message.StructureType UploadedDSDStructure = new SDMXApi_2_0.Message.StructureType();
        SDMXApi_2_0.Message.HeaderType Header = new SDMXApi_2_0.Message.HeaderType();
        DuplicateKey = string.Empty;
        DataTable dtIndicator = new DataTable();
           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;
        }
        GeneratedFiles = new List<string>();
        if (dtSelections != null && dtSelections.Rows.Count > 0)
        {
            // register tab
            ds.Tables.Add(dtSelections);
        }
        else
        {
            // Admin
            if (File.Exists(xml))
            {
                ds.ReadXml(xml);
            }
        }
        string IndicatorNId = string.Empty;

        // for each language in database
        foreach (DataRow LanguageRow in DIConnection.DILanguages(DIQueries.DataPrefix).Rows)
        {
            //
            Language = LanguageRow[DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Language.LanguageCode].ToString();

            int dsRowCount = ds.Tables["Data"].Rows.Count;
            RowCount = 0;

            // consider only those indiactors which are selected
            foreach (DataRow DSRow in ds.Tables["Data"].Select("selectedState=true"))
            {

                if (RowCount > dsRowCount)
                {
                    break;
                }
                IndicatorNId = DSRow["Ind"].ToString();
                AreaNIds = DSRow["areas"].ToString();
                TPNIds = DSRow["timeperiods"].ToString();
                SourceNIds = DSRow["source"].ToString();

                // Get data based on Indiactor and associated fileters
                DtData = Get_Language_Specific_Data_Table(Language, IndicatorNId, AreaNIds, TPNIds, SourceNIds, DIConnection);
                dtIndicator = DIConnection.ExecuteDataTable(DIQueries.Indicators.GetIndicator(FilterFieldType.NId, IndicatorNId, FieldSelection.Heavy));
                foreach (DataRow drIndicator in dtIndicator.Rows)
                {
                    IndicatorName = drIndicator[Indicator.IndicatorName].ToString();

                }
                ProcessedIUSA = new List<string>();
                DictAreaMapping = RegTwoZeroFunctionality.Get_Area_Mapping_Dict(Convert.ToInt32(DBOrDSDDBId));

                if ((DtData != null) && (DtData.Rows.Count > 0))
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:67,代码来源:RegTwoZeroData.cs

示例5: SetSelectedConnectionDetail

            /// <summary>
            /// Set the selected connection details on the basis of DBinfo
            /// </summary>
            /// <param name="dbInfo"></param>
            /// <remarks> In case of online connection, Dbinfo contains : ServerType{[]}ConnectionIndex{[]}DatasetPrefix 
            /// In case of offline connection, ServerType{[]}AcessdbPath (Applicable for Dekstop application)  </remarks>
            public void SetSelectedConnectionDetail(string dbInfo)
            {
                DIConnection DIConnection;
                string[] Values = new string[0];
                Values = Utility.DICommon.SplitString(dbInfo, DELIMITER);
                if (Values.Length == 3)
                {
                    //-- In case of Web, it return the connection for all the servert type.
                    this.SelectedConnectionDetail = this.OnlineDatabaseDetails[Convert.ToInt32(Values[1])].DIConnectionDetails;
                    this.SelectedConnectionName = this.OnlineDatabaseDetails[Convert.ToInt32(Values[1])].Connection;
                    for (int i = 0; i <= this.OnlineDatabaseDetails[Convert.ToInt32(Values[1])].OnlineDatasetInfo.Count - 1; i++)
                    {
                        if (this.OnlineDatabaseDetails[Convert.ToInt32(Values[1])].OnlineDatasetInfo[i].Prefix.ToLower() == Values[2].ToLower())
                        {
                            //-- set the selected dataset name and its prefix.
                            this.SelectedDatasetName = this.OnlineDatabaseDetails[Convert.ToInt32(Values[1])].OnlineDatasetInfo[i].DatasetName;
                            this.SelectedDatasetPrefix = this.OnlineDatabaseDetails[Convert.ToInt32(Values[1])].OnlineDatasetInfo[i].Prefix + "_";
                            break;
                        }
                    }
                    this.SelectedDbInfo = dbInfo;
                    DIConnection = new DIConnection(this.SelectedConnectionDetail);
                    //-- Seleted dataset language
                    if (DIConnection.DILanguages(this.SelectedDatasetPrefix).Select(DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Language.LanguageCode + " = '" + this._DatabaseLanguage.Substring(1) + "'").Length > 0)
                    {
                        //-- If the database language exists in the database
                        this.DatabaseLanguage = this._DatabaseLanguage;
                    }
                    else
                    {
                        //-- Set the default language as databaseLanguage, if the last selected language does not exists in the database.
                        this.DatabaseLanguage = DIConnection.DILanguageCodeDefault(this.SelectedDatasetPrefix);
                    }
                }
                else if (Values.Length == 2)
                {
                    //-- Set the connection detail of access db (only for dekstop)
                    this.SelectedConnectionDetail = new DIConnectionDetails(DIServerType.MsAccess, "", "", Values[1], USERNAME, PASSWORD);
                    this.SelectedConnectionName = string.Empty;
                    this.SelectedDatasetName = System.IO.Path.GetFileName(Values[1]);

                    DIConnection = new DIConnection(this.SelectedConnectionDetail);
                    this.SelectedDatasetPrefix = DIConnection.DIDataSetDefault();
                    this.SelectedDbInfo = dbInfo;
                    //-- Seleted dataset language
                    this.DatabaseLanguage = DIConnection.DILanguageCodeDefault(this.SelectedDatasetPrefix);
                }
            }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:54,代码来源:UserPreference.cs

示例6: Fill_Reported_Attribute_Value

    private static void Fill_Reported_Attribute_Value(ReportedAttributeType ReportedAttribute, string IndicatorNId, Dictionary<string, string> DictMetadataMapping, DIConnection DIConnection, DIQueries DIQueries)
    {
        string language, Query;
        string CategoryNId;
        DataTable DtTable;
        SDMXApi_2_0.Common.TextType LanguageSpecificValue;

        if (DictMetadataMapping.ContainsKey(ReportedAttribute.conceptID))
        {
            ReportedAttribute.Value = new List<SDMXApi_2_0.Common.TextType>();

            foreach (DataRow LanguageRow in DIConnection.DILanguages(DIQueries.DataPrefix).Rows)
            {
                language = LanguageRow[DevInfo.Lib.DI_LibDAL.Queries.DIColumns.Language.LanguageCode].ToString();
                Query = "SELECT CategoryNId FROM UT_Metadata_Category_" + language + " WHERE CategoryGId = '" + DictMetadataMapping[ReportedAttribute.conceptID].ToString() + "' AND CategoryType = 'I'";
                DtTable = DIConnection.ExecuteDataTable(Regex.Replace(Query, "UT_", DIConnection.DIDataSetDefault(), RegexOptions.IgnoreCase));

                if (DtTable != null && DtTable.Rows.Count > 0)
                {
                    CategoryNId = DtTable.Rows[0]["CategoryNId"].ToString();
                    Query = "SELECT Metadata FROM UT_MetadataReport_" + language + " WHERE Target_NId = " + IndicatorNId + " AND Category_NId = " + CategoryNId;
                    DtTable = DIConnection.ExecuteDataTable(Regex.Replace(Query, "UT_", DIConnection.DIDataSetDefault(), RegexOptions.IgnoreCase));

                    if (DtTable != null && DtTable.Rows.Count > 0)
                    {
                        LanguageSpecificValue = new SDMXApi_2_0.Common.TextType();
                        LanguageSpecificValue.lang = language;
                        LanguageSpecificValue.Value = DtTable.Rows[0]["Metadata"].ToString();

                        ReportedAttribute.Value.Add(LanguageSpecificValue);
                    }
                }
            }
        }
    }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:35,代码来源:RegTwoZeroMetadata.cs


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