本文整理汇总了C#中DevInfo.Lib.DI_LibDAL.Connection.DIConnection类的典型用法代码示例。如果您正苦于以下问题:C# DIConnection类的具体用法?C# DIConnection怎么用?C# DIConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DIConnection类属于DevInfo.Lib.DI_LibDAL.Connection命名空间,在下文中一共展示了DIConnection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SeparateTextualandNemericData
//-- Check orgTextual_Data_value exists or not. If column exists then move textual & numeric values into their respective column.
public static void SeparateTextualandNemericData(DIConnection dbConnection, DIQueries dbQueries)
{
string SqlQuery = string.Empty;
try
{
if (ISColumnExists(dbConnection, Constants.Data.Orginal_Data_valueColumn, dbQueries.TablesName.Data))
{
//--Update Textual value true if data value is not Numeric
SqlQuery = "UPDATE " + dbQueries.TablesName.Data + " SET " + Data.IsTextualData + " = 1 WHERE NOT ISNUMERIC(" + Data.DataValue + ")";
dbConnection.ExecuteNonQuery(SqlQuery);
//-- move orgData_Value values into Data_Value
SqlQuery = "UPDATE " + dbQueries.TablesName.Data + " Set " + Constants.Data.Orginal_Data_valueColumn + "=" + Data.DataValue + " WHERE " + Data.IsTextualData + " = 0";
dbConnection.ExecuteNonQuery(SqlQuery);
//--move orgTextual_Data_value into Textual_Data_value if ISTextual is true
SqlQuery = "UPDATE " + dbQueries.TablesName.Data + " Set " + Constants.Data.Orginal_Textual_Data_valueColumn + " = " + Data.DataValue + " WHERE " + Data.IsTextualData + "<>0";
dbConnection.ExecuteNonQuery(SqlQuery);
//2. Remove Data_Value column and rename orgTextual_Data_Value and orgData_Value to Textual_Data_Value and Data_value"
DIDataValueHelper.RemoveDataValueAndRenameOrgColumns(dbConnection, dbQueries);
}
}
catch (Exception ex)
{
throw ex;
}
}
示例2: RegistryService
public RegistryService()
{
int DBNIdOut;
if (this.Context.Request.QueryString["p"] != null && !string.IsNullOrEmpty(this.Context.Request.QueryString["p"]) &&
int.TryParse(this.Context.Request.QueryString["p"], out DBNIdOut))
{
DBNId = DBNIdOut;
}
else
{
Global.GetAppSetting();
DBNId = Convert.ToInt32(Global.GetDefaultDbNId());
}
if (Global.IsDSDUploadedFromAdmin(DBNId))
{
this.DIConnection = Global.GetDbConnection(this.Get_AssociatedDB_NId(DBNId.ToString()));
}
else
{
this.DIConnection = Global.GetDbConnection(DBNId);
}
this.DIQueries = new DIQueries(this.DIConnection.DIDataSetDefault(), this.DIConnection.DILanguageCodeDefault(this.DIConnection.DIDataSetDefault()));
}
示例3: Generate_Categorization
public static List<ArtefactInfo> Generate_Categorization(SDMXSchemaType schemaType, string agencyId, string language, Header header, string outputFolder, DIConnection DIConnection, DIQueries DIQueries,string IcType)
{
List<ArtefactInfo> RetVal;
CategorizationUtility CategorizationUtility;
RetVal = null;
CategorizationUtility = null;
try
{
CategorizationUtility = new CategorizationUtility(agencyId, language, header, outputFolder, DIConnection, DIQueries);
// RetVal = CategorizationUtility.Generate_Artefact();
RetVal = CategorizationUtility.Generate_CompleteArtefact(IcType);
CategorizationUtility.Save_Artefacts(RetVal);
}
catch (Exception ex)
{
RetVal = null;
throw ex;
}
finally
{
}
return RetVal;
}
示例4: CreateInstance
public static DIData CreateInstance(DIImportFileType importFileType, List<string> sourceFileNamesWPath,
string tempFolderPath, DIConnection dbConnection, DIQueries dbQueries)
{
DIData RetVal = null;
switch (importFileType)
{
case DIImportFileType.DataEntrySpreasheet:
break;
case DIImportFileType.Database:
break;
case DIImportFileType.Template:
break;
case DIImportFileType.SDMXXml:
RetVal = new SDMX.SDMXXml(sourceFileNamesWPath, tempFolderPath, dbConnection, dbQueries);
break;
default:
break;
}
if (RetVal != null)
{
RetVal.ImportFileType = importFileType;
}
return RetVal;
}
示例5: SummarySheetGenerator
internal SummarySheetGenerator(bool isComparison,ref DIConnection dbConnection,ref DIConnection targetDBConnection,string targetFile,string sourceDB)
{
this.ForComparisonReport = isComparison;
this.ReferenceDataBaseFile = sourceDB;
this.RefDBConnection = dbConnection;
this.TargetDBConnection = targetDBConnection;
}
示例6: ExportOnlineDatabase
internal ExportOnlineDatabase(UserSelection userSelection, DIConnection sourceDBConnection, DIQueries sourceDBQueries)
{
if (sourceDBConnection != null && userSelection != null)
{
this.UserSelection = userSelection;
//-- Assign NIDs in userSelection.
if (userSelection.ShowIUS)
{
this.IUSNIDs = userSelection.IndicatorNIds;
}
else
{
this.IndicatorNIDs = userSelection.IndicatorNIds;
}
this.AreaNIDs = userSelection.AreaNIds;
this.TimePeriodNIDs = userSelection.TimePeriodNIds;
this.SourceNIDs = userSelection.SourceNIds;
this.ApplyMRD = userSelection.DataViewFilters.MostRecentData;
this.SourceDBConnection = sourceDBConnection;
this.SourceDBQueries = sourceDBQueries; //new DIQueries(this.SourceDBConnection.DIDataSetDefault(), this.SourceDBConnection.DILanguageCodeDefault(this.SourceDBConnection.DIDataSetDefault()));
}
}
示例7: CategorySchemeUtility
internal CategorySchemeUtility(CategorySchemeTypes categorySchemeType, bool completeOrSummaryFlag, string agencyId, string language, Header header, string outputFolder, Dictionary<string, string> DictIndicator, Dictionary<string, string> DictIndicatorMapping, DIConnection DIConnection, DIQueries DIQueries)
: base(agencyId, language, header, outputFolder)
{
this._categorySchemeType = categorySchemeType;
this._completeOrSummaryFlag = completeOrSummaryFlag;
this._diConnection = DIConnection;
this._diQueries = DIQueries;
if (string.IsNullOrEmpty(language))
{
this.Language = this._diQueries.LanguageCode.Substring(1);
this._multiLanguageHandlingRequired = true;
}
else
{
if (this._diConnection.IsValidDILanguage(this._diQueries.DataPrefix, language))
{
this.Language = language;
this._multiLanguageHandlingRequired = false;
}
else
{
this.Language = this._diQueries.LanguageCode.Substring(1);
this._multiLanguageHandlingRequired = false;
}
}
this._dictIndicator = DictIndicator;
this._dictIndicatorMapping = DictIndicatorMapping;
}
示例8: DI6ToDI5Converter
/// <summary>
/// Constructor
/// </summary>
/// <param name="fileNameWPath"></param>
public DI6ToDI5Converter(string fileNameWPath)
{
this.DBConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, fileNameWPath, string.Empty, string.Empty);
this.DBQueries = new DIQueries(this.DBConnection.DIDataSetDefault(), this.DBConnection.DILanguageCodeDefault("UT_"));
this.FilenameWPath = fileNameWPath;
}
示例9: CreateTmpIndSearchTbl
/// <summary>
/// Create and insert into TmpDI7SearchIndicators table
/// </summary>
/// <param name="dbConnection"></param>
/// <param name="tableNames"></param>
/// <param name="searchIndicators"></param>
/// <param name="isSearchForQS"></param>
public static void CreateTmpIndSearchTbl(DIConnection dbConnection, DITables tableNames, string searchIndicators, bool isSearchForQS)
{
StringBuilder SBQry = new StringBuilder();
string StrQry = string.Empty;
string SearchLanguage = string.Empty;
try
{
CacheUtility.CreateSearchIndicatorsTable(dbConnection);
if (!string.IsNullOrEmpty(searchIndicators))
{
CacheUtility.GetSplittedList(dbConnection, searchIndicators, ",", true);
SBQry.Remove(0, SBQry.Length);
SBQry.Append("INSERT INTO " + QDSConstants.QDSTables.SearchIndicators.TableName);
SBQry.Append(" (" + QDSConstants.QDSTables.SearchIndicators.Columns.IndicatorNId + ")");
SBQry.Append(" SELECT Ind."+ Indicator.IndicatorNId +" As IndicatorNId FROM "+ tableNames.Indicator +" As Ind");
SBQry.Append(" INNER JOIN " + QDSConstants.QDSTables.SplittedList.TableName + " L");
SBQry.Append(" ON Ind." + Indicator.IndicatorNId + " = L." + QDSConstants.QDSTables.SplittedList.Columns.Value);
StrQry = SBQry.ToString();
dbConnection.ExecuteNonQuery(StrQry);
}
}
catch (Exception)
{
throw;
}
}
示例10: GetDataQueryResponseJSON
public string GetDataQueryResponseJSON(string dbNId, string language, string key)
{
string ResponseString;
XmlDocument QueryDocument;
ResponseString = string.Empty;
QueryDocument = null;
try
{
this.DIConnection = Global.GetDbConnection(Convert.ToInt32(dbNId));
this.DIQueries = new DIQueries(this.DIConnection.DIDataSetDefault(), this.DIConnection.DILanguageCodeDefault(this.DIConnection.DIDataSetDefault()));
QueryDocument = this.Get_Query(key, Constants.WSQueryStrings.ResponseFormatTypes.JSON, Constants.WSQueryStrings.SDMXFormatTypes.StructureSpecificTS, language);
ResponseString = DATAUtility.Get_Data(QueryDocument, DataTypes.JSON, DIConnection, DIQueries);
}
catch (Exception ex)
{
Global.CreateExceptionString(ex, null);
throw ex;
}
finally
{
}
return ResponseString;
}
示例11: ElementMapper
public ElementMapper(DIConnection dbConnection, DIQueries dbQueries, Dictionary<TemplateMergeControlType, MergeTableInfo> mappedTables)
{
this.DBConnection = dbConnection;
this.DBQueries = dbQueries;
this.TemplateQueries = new MergeTemplateQueries(this.DBQueries.DataPrefix, this.DBQueries.LanguageCode);
this.MappedTables = mappedTables;
}
示例12: MetadataReportUtility
internal MetadataReportUtility(string agencyId, string language, Header header, DIConnection DIConnection, DIQueries DIQueries)
{
this._agencyId = agencyId;
this._header = header;
this._diConnection = DIConnection;
this._diQueries = DIQueries;
if (string.IsNullOrEmpty(language))
{
this._language = this._diQueries.LanguageCode.Substring(1);
this._multiLanguageHandlingRequired = true;
}
else
{
if (this._diConnection.IsValidDILanguage(this._diQueries.DataPrefix, language))
{
this._language = language;
this._multiLanguageHandlingRequired = false;
}
else
{
this._language = this._diQueries.LanguageCode.Substring(1);
this._multiLanguageHandlingRequired = false;
}
}
}
示例13: CodelistUtility
internal CodelistUtility(CodelistTypes codelistType, bool completeOrSummaryFlag, string agencyId, string language, Header header, string outputFolder, DIConnection DIConnection, DIQueries DIQueries)
: base(agencyId, language, header, outputFolder)
{
this._codelistType = codelistType;
this._completeOrSummaryFlag = completeOrSummaryFlag;
this._diConnection = DIConnection;
this._diQueries = DIQueries;
if (string.IsNullOrEmpty(language))
{
this.Language = this._diQueries.LanguageCode.Substring(1);
this._multiLanguageHandlingRequired = true;
}
else
{
if (this._diConnection.IsValidDILanguage(this._diQueries.DataPrefix, language))
{
this.Language = language;
this._multiLanguageHandlingRequired = false;
}
else
{
this.Language = this._diQueries.LanguageCode.Substring(1);
this._multiLanguageHandlingRequired = false;
}
}
}
示例14: MergeTextualandNumericDataValueColumn
/// <summary>
/// Rename Data_value and TextualValue column into OrgData_value and OrgTextualValue
/// and merge both column value into new column Data_Value
/// </summary>
/// <param name="dbConnection"></param>
/// <param name="dbQueries"></param>
public static void MergeTextualandNumericDataValueColumn(DIConnection dbConnection, DIQueries dbQueries)
{
try
{
if (!ISColumnExists(dbConnection, Constants.Data.Orginal_Data_valueColumn, dbQueries.TablesName.Data))
{
//1. Rename Textual_Data_Value & Data_value to orgTextual_Data_value & orgData_Value respectively
RenameOriganalDataTableColumnInDatabase(dbConnection, dbQueries, Data.TextualDataValue, Constants.Data.Orginal_Textual_Data_valueColumn, " Memo");
RenameOriganalDataTableColumnInDatabase(dbConnection, dbQueries, Data.DataValue, Constants.Data.Orginal_Data_valueColumn, " Double ");
System.Threading.Thread.Sleep(100);
//2. Create new column Data_Value of memo data type
string SqlQuery = "ALTER Table " + dbQueries.TablesName.Data + " Add Column " + Data.DataValue + " Memo NULL";
dbConnection.ExecuteNonQuery(SqlQuery);
System.Threading.Thread.Sleep(10);
//3. Merge all data values into Data_Value column
SqlQuery = "UPDATE " + dbQueries.TablesName.Data + " SET " + Data.DataValue + "=" + Constants.Data.Orginal_Data_valueColumn;
dbConnection.ExecuteNonQuery(SqlQuery);
SqlQuery = "UPDATE " + dbQueries.TablesName.Data + " SET " + Data.DataValue + "=" + Constants.Data.Orginal_Textual_Data_valueColumn + " WHERE " + Data.IsTextualData + "=" + true;
dbConnection.ExecuteNonQuery(SqlQuery);
}
}
catch (Exception ex)
{
throw ex;
}
}
示例15: CategorizationUtility
internal CategorizationUtility(string agencyId, string language, Header header, string outputFolder, DIConnection DIConnection, DIQueries DIQueries)
: base(agencyId, language, header, outputFolder)
{
this._diConnection = DIConnection;
this._diQueries = DIQueries;
if (string.IsNullOrEmpty(language))
{
this.Language = this._diQueries.LanguageCode.Substring(1);
this._multiLanguageHandlingRequired = true;
}
else
{
if (this._diConnection.IsValidDILanguage(this._diQueries.DataPrefix, language))
{
this.Language = language;
this._multiLanguageHandlingRequired = false;
}
else
{
this.Language = this._diQueries.LanguageCode.Substring(1);
this._multiLanguageHandlingRequired = false;
}
}
}