本文整理汇总了C#中OGen.lib.datalayer.DBConnection类的典型用法代码示例。如果您正苦于以下问题:C# DBConnection类的具体用法?C# DBConnection怎么用?C# DBConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DBConnection类属于OGen.lib.datalayer命名空间,在下文中一共展示了DBConnection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updObject
public static void updObject(
DBConnection dbConnection_in,
long idText_in,
params OGen.NTier.Kick.lib.datalayer.shared.structures.SO_DIC__TextLanguage[] textLanguage_in
) {
SO_DIC_TextLanguage _textlanguage;
foreach (OGen.NTier.Kick.lib.datalayer.shared.structures.SO_DIC__TextLanguage _text in textLanguage_in) {
#region _textlanguage = ...;
_textlanguage
= new SO_DIC_TextLanguage(
idText_in,
_text.IFLanguage,
"",
""
);
if (_text.Text.Length > 8000) {
_textlanguage.Text = _text.Text;
_textlanguage.CharVar8000_isNull = true;
} else {
_textlanguage.Text_isNull = true;
_textlanguage.CharVar8000 = _text.Text;
}
#endregion
DO_DIC_TextLanguage.setObject(
_textlanguage,
true,
dbConnection_in
);
}
}
示例2: GetDBServerType
public static DBServerTypes GetDBServerType(
DBConnection connection_in
) {
#if PostgreSQL
if (connection_in is DBConnection_PostgreSQL) {
return DBServerTypes.PostgreSQL;
}
else
#endif
if (connection_in is DBConnection_SQLServer) {
return DBServerTypes.SQLServer;
}
#if MySQL
else
if (connection_in is DBConnection_MySQL) {
return DBServerTypes.MySQL;
}
#endif
throw new Exception(
string.Format(
"unsuported db type: {0}",
connection_in.ToString()
)
);
}
示例3: getObject_byUser
/// <summary>
/// Selects vNET_User values from Database (based on the search condition) and assigns them to the appropriate DO0_vNET_User property.
/// </summary>
/// <param name="IDUser_search_in">IDUser search condition</param>
/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
/// <returns>null if vNET_User doesn't exists at Database</returns>
public static SO_vNET_User getObject_byUser(
long IDUser_search_in,
DBConnection dbConnection_in
) {
SO_vNET_User _output = null;
DBConnection _connection = (dbConnection_in == null)
? DO__utils.DBConnection_createInstance(
DO__utils.DBServerType,
DO__utils.DBConnectionstring,
DO__utils.DBLogfile
)
: dbConnection_in;
IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
_connection.newDBDataParameter("IDUser_search_", DbType.Int64, ParameterDirection.Input, IDUser_search_in, 0),
_connection.newDBDataParameter("IDUser", DbType.Int64, ParameterDirection.Output, null, 0),
_connection.newDBDataParameter("IFApplication", DbType.Int32, ParameterDirection.Output, null, 0),
_connection.newDBDataParameter("Login", DbType.AnsiString, ParameterDirection.Output, null, 255),
_connection.newDBDataParameter("Name", DbType.AnsiString, ParameterDirection.Output, null, 255),
_connection.newDBDataParameter("EMail", DbType.AnsiString, ParameterDirection.Output, null, 255)
};
_connection.Execute_SQLFunction(
"sp0_vNET_User_getObject_byUser",
_dataparameters
);
if (dbConnection_in == null) { _connection.Dispose(); }
if (_dataparameters[1].Value != DBNull.Value) {
_output = new SO_vNET_User();
if (_dataparameters[1].Value == System.DBNull.Value) {
_output.IDUser = 0L;
} else {
_output.IDUser = (long)_dataparameters[1].Value;
}
if (_dataparameters[2].Value == System.DBNull.Value) {
_output.IFApplication_isNull = true;
} else {
_output.IFApplication = (int)_dataparameters[2].Value;
}
if (_dataparameters[3].Value == System.DBNull.Value) {
_output.Login_isNull = true;
} else {
_output.Login = (string)_dataparameters[3].Value;
}
if (_dataparameters[4].Value == System.DBNull.Value) {
_output.Name_isNull = true;
} else {
_output.Name = (string)_dataparameters[4].Value;
}
if (_dataparameters[5].Value == System.DBNull.Value) {
_output.EMail_isNull = true;
} else {
_output.EMail = (string)_dataparameters[5].Value;
}
return _output;
}
return null;
}
示例4: getObject
/// <summary>
/// Selects NWS_Author values from Database and assigns them to the appropriate DO_NWS_Author property.
/// </summary>
/// <param name="IDAuthor_in">IDAuthor</param>
/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
/// <returns>null if NWS_Author doesn't exists at Database</returns>
public static SO_NWS_Author getObject(
long IDAuthor_in,
DBConnection dbConnection_in
) {
SO_NWS_Author _output = null;
DBConnection _connection = (dbConnection_in == null)
? DO__utils.DBConnection_createInstance(
DO__utils.DBServerType,
DO__utils.DBConnectionstring,
DO__utils.DBLogfile
)
: dbConnection_in;
IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
_connection.newDBDataParameter("IDAuthor_", DbType.Int64, ParameterDirection.InputOutput, IDAuthor_in, 0),
_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Output, null, 0),
_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Output, null, 255),
_connection.newDBDataParameter("IFUser__Approved_", DbType.Int64, ParameterDirection.Output, null, 0),
_connection.newDBDataParameter("Approved_date_", DbType.DateTime, ParameterDirection.Output, null, 0)
};
_connection.Execute_SQLFunction("sp0_NWS_Author_getObject", _dataparameters);
if (dbConnection_in == null) { _connection.Dispose(); }
if (_dataparameters[0].Value != DBNull.Value) {
_output = new SO_NWS_Author();
if (_dataparameters[0].Value == System.DBNull.Value) {
_output.IDAuthor = 0L;
} else {
_output.IDAuthor = (long)_dataparameters[0].Value;
}
if (_dataparameters[1].Value == System.DBNull.Value) {
_output.IFApplication_isNull = true;
} else {
_output.IFApplication = (int)_dataparameters[1].Value;
}
if (_dataparameters[2].Value == System.DBNull.Value) {
_output.Name = string.Empty;
} else {
_output.Name = (string)_dataparameters[2].Value;
}
if (_dataparameters[3].Value == System.DBNull.Value) {
_output.IFUser__Approved_isNull = true;
} else {
_output.IFUser__Approved = (long)_dataparameters[3].Value;
}
if (_dataparameters[4].Value == System.DBNull.Value) {
_output.Approved_date_isNull = true;
} else {
_output.Approved_date = (DateTime)_dataparameters[4].Value;
}
_output.haschanges_ = false;
return _output;
}
return null;
}
示例5: DO__base
// #region public DO__base(...);
/// <param name="connection_in">DB Connection</param>
public DO__base(
DBConnection connection_in
) : this (
connection_in,
connection_in.DBServerType,
connection_in.Connectionstring,
false, // connection_insideInstance_in
null
) {}
示例6: base
internal DO0_vUserGroup
#endif
(
DBConnection connection_in
) : base(
connection_in
) {
clrObject();
Fields.haschanges_ = false;
}
示例7: base
internal DO0_Logcode
#endif
(
DBConnection connection_in
) : base(
connection_in
) {
clrObject();
Fields.haschanges_ = false;
}
示例8: base
internal DO0_Language
#endif
(
DBConnection connection_in
) : base(
connection_in
) {
clrObject();
fields_.haschanges_ = false;
}
示例9: base
internal DO0_GroupPermition
#endif
(
DBConnection connection_in
) : base(
connection_in
) {
clrObject();
fields_.haschanges_ = false;
}
示例10: base
internal DO0_vUserDefaultGroup
#endif
(
DBConnection connection_in
) : base(
connection_in
) {
clrObject();
fields_.haschanges_ = false;
}
示例11: getObject
/// <summary>
/// Selects DIC_TextLanguage values from Database and assigns them to the appropriate DO_DIC_TextLanguage property.
/// </summary>
/// <param name="IFText_in">IFText</param>
/// <param name="IFLanguage_in">IFLanguage</param>
/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
/// <returns>null if DIC_TextLanguage doesn't exists at Database</returns>
public static SO_DIC_TextLanguage getObject(
long IFText_in,
int IFLanguage_in,
DBConnection dbConnection_in
) {
SO_DIC_TextLanguage _output = null;
DBConnection _connection = (dbConnection_in == null)
? DO__utils.DBConnection_createInstance(
DO__utils.DBServerType,
DO__utils.DBConnectionstring,
DO__utils.DBLogfile
)
: dbConnection_in;
IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
_connection.newDBDataParameter("IFText_", DbType.Int64, ParameterDirection.InputOutput, IFText_in, 0),
_connection.newDBDataParameter("IFLanguage_", DbType.Int32, ParameterDirection.InputOutput, IFLanguage_in, 0),
_connection.newDBDataParameter("CharVar8000_", DbType.AnsiString, ParameterDirection.Output, null, 8000),
_connection.newDBDataParameter("Text_", DbType.AnsiString, ParameterDirection.Output, null, 0)
};
_connection.Execute_SQLFunction("sp0_DIC_TextLanguage_getObject", _dataparameters);
if (dbConnection_in == null) { _connection.Dispose(); }
if (_dataparameters[0].Value != DBNull.Value) {
_output = new SO_DIC_TextLanguage();
if (_dataparameters[0].Value == System.DBNull.Value) {
_output.IFText = 0L;
} else {
_output.IFText = (long)_dataparameters[0].Value;
}
if (_dataparameters[1].Value == System.DBNull.Value) {
_output.IFLanguage = 0;
} else {
_output.IFLanguage = (int)_dataparameters[1].Value;
}
if (_dataparameters[2].Value == System.DBNull.Value) {
_output.CharVar8000_isNull = true;
} else {
_output.CharVar8000 = (string)_dataparameters[2].Value;
}
if (_dataparameters[3].Value == System.DBNull.Value) {
_output.Text_isNull = true;
} else {
_output.Text = (string)_dataparameters[3].Value;
}
_output.haschanges_ = false;
return _output;
}
return null;
}
示例12: insObject_CreateUser
internal static long insObject_CreateUser(
Sessionuser sessionUser_in,
string login_in,
bool selectIdentity_in,
ref List<int> errorlist_in,
DBConnection con_in
) {
long _output = -1L;
// ToDos: here! must have permition to create user
if (!sessionUser_in.hasPermition(
PermitionType.User__insert
)) {
errorlist_in.Add(ErrorType.user__lack_of_permitions_to_write);
return _output;
}
if (!Sessionuser.checkLogin(login_in, ref errorlist_in)) {
return _output;
}
bool _constraint;
_output = DO_CRD_User.insObject(
new SO_CRD_User(
-1L,
login_in,
// ToDos: here! encrypt before sending...
login_in, // default: password = login
sessionUser_in.IDApplication
),
selectIdentity_in,
out _constraint,
con_in
);
if (_constraint) {
errorlist_in.Add(ErrorType.data__constraint_violation);
} else {
if (con_in == null) {
// assuming NO other (internal) operations are going on
errorlist_in.Add(ErrorType.user__successfully_created__WARNING);
}
}
return _output;
}
示例13: getObject
/// <summary>
/// Selects LOG_Errortype values from Database and assigns them to the appropriate DO_LOG_Errortype property.
/// </summary>
/// <param name="IDErrortype_in">IDErrortype</param>
/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
/// <returns>null if LOG_Errortype doesn't exists at Database</returns>
public static SO_LOG_Errortype getObject(
int IDErrortype_in,
DBConnection dbConnection_in
) {
SO_LOG_Errortype _output = null;
DBConnection _connection = (dbConnection_in == null)
? DO__utils.DBConnection_createInstance(
DO__utils.DBServerType,
DO__utils.DBConnectionstring,
DO__utils.DBLogfile
)
: dbConnection_in;
IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
_connection.newDBDataParameter("IDErrortype_", DbType.Int32, ParameterDirection.InputOutput, IDErrortype_in, 0),
_connection.newDBDataParameter("Name_", DbType.AnsiString, ParameterDirection.Output, null, 255),
_connection.newDBDataParameter("Description_", DbType.AnsiString, ParameterDirection.Output, null, 2048),
_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Output, null, 0)
};
_connection.Execute_SQLFunction("sp0_LOG_Errortype_getObject", _dataparameters);
if (dbConnection_in == null) { _connection.Dispose(); }
if (_dataparameters[0].Value != DBNull.Value) {
_output = new SO_LOG_Errortype();
if (_dataparameters[0].Value == System.DBNull.Value) {
_output.IDErrortype = 0;
} else {
_output.IDErrortype = (int)_dataparameters[0].Value;
}
if (_dataparameters[1].Value == System.DBNull.Value) {
_output.Name = string.Empty;
} else {
_output.Name = (string)_dataparameters[1].Value;
}
if (_dataparameters[2].Value == System.DBNull.Value) {
_output.Description_isNull = true;
} else {
_output.Description = (string)_dataparameters[2].Value;
}
if (_dataparameters[3].Value == System.DBNull.Value) {
_output.IFApplication_isNull = true;
} else {
_output.IFApplication = (int)_dataparameters[3].Value;
}
_output.haschanges_ = false;
return _output;
}
return null;
}
示例14: getObject
/// <summary>
/// Selects DIC_Text values from Database and assigns them to the appropriate DO_DIC_Text property.
/// </summary>
/// <param name="IDText_in">IDText</param>
/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
/// <returns>null if DIC_Text doesn't exists at Database</returns>
public static SO_DIC_Text getObject(
long IDText_in,
DBConnection dbConnection_in
) {
SO_DIC_Text _output = null;
DBConnection _connection = (dbConnection_in == null)
? DO__utils.DBConnection_createInstance(
DO__utils.DBServerType,
DO__utils.DBConnectionstring,
DO__utils.DBLogfile
)
: dbConnection_in;
IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
_connection.newDBDataParameter("IDText_", DbType.Int64, ParameterDirection.InputOutput, IDText_in, 0),
_connection.newDBDataParameter("IFApplication_", DbType.Int32, ParameterDirection.Output, null, 0),
_connection.newDBDataParameter("SourceTableField_ref_", DbType.Int32, ParameterDirection.Output, null, 0)
};
_connection.Execute_SQLFunction("sp0_DIC_Text_getObject", _dataparameters);
if (dbConnection_in == null) { _connection.Dispose(); }
if (_dataparameters[0].Value != DBNull.Value) {
_output = new SO_DIC_Text();
if (_dataparameters[0].Value == System.DBNull.Value) {
_output.IDText = 0L;
} else {
_output.IDText = (long)_dataparameters[0].Value;
}
if (_dataparameters[1].Value == System.DBNull.Value) {
_output.IFApplication_isNull = true;
} else {
_output.IFApplication = (int)_dataparameters[1].Value;
}
if (_dataparameters[2].Value == System.DBNull.Value) {
_output.SourceTableField_ref_isNull = true;
} else {
_output.SourceTableField_ref = (int)_dataparameters[2].Value;
}
_output.haschanges_ = false;
return _output;
}
return null;
}
示例15: getObject
/// <summary>
/// Selects CRD_ProfileProfile values from Database and assigns them to the appropriate DO_CRD_ProfileProfile property.
/// </summary>
/// <param name="IFProfile_in">IFProfile</param>
/// <param name="IFProfile_parent_in">IFProfile_parent</param>
/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
/// <returns>null if CRD_ProfileProfile doesn't exists at Database</returns>
public static SO_CRD_ProfileProfile getObject(
long IFProfile_in,
long IFProfile_parent_in,
DBConnection dbConnection_in
) {
SO_CRD_ProfileProfile _output = null;
DBConnection _connection = (dbConnection_in == null)
? DO__utils.DBConnection_createInstance(
DO__utils.DBServerType,
DO__utils.DBConnectionstring,
DO__utils.DBLogfile
)
: dbConnection_in;
IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
_connection.newDBDataParameter("IFProfile_", DbType.Int64, ParameterDirection.InputOutput, IFProfile_in, 0),
_connection.newDBDataParameter("IFProfile_parent_", DbType.Int64, ParameterDirection.InputOutput, IFProfile_parent_in, 0)
};
_connection.Execute_SQLFunction("sp0_CRD_ProfileProfile_getObject", _dataparameters);
if (dbConnection_in == null) { _connection.Dispose(); }
if (_dataparameters[0].Value != DBNull.Value) {
_output = new SO_CRD_ProfileProfile();
if (_dataparameters[0].Value == System.DBNull.Value) {
_output.IFProfile = 0L;
} else {
_output.IFProfile = (long)_dataparameters[0].Value;
}
if (_dataparameters[1].Value == System.DBNull.Value) {
_output.IFProfile_parent = 0L;
} else {
_output.IFProfile_parent = (long)_dataparameters[1].Value;
}
_output.haschanges_ = false;
return _output;
}
return null;
}