/// <summary> /// Selects NET_Defaultprofile values from Database and assigns them to the appropriate DO_NET_Defaultprofile property. /// </summary> /// <param name="IDDefaultprofile_in">IDDefaultprofile</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 NET_Defaultprofile doesn't exists at Database</returns> public static SO_NET_Defaultprofile getObject( long IDDefaultprofile_in, DBConnection dbConnection_in ) { SO_NET_Defaultprofile _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("IDDefaultprofile_", DbType.Int64, ParameterDirection.InputOutput, IDDefaultprofile_in, 0), _connection.newDBDataParameter("IFProfile_", DbType.Int64, ParameterDirection.Output, null, 0) }; _connection.Execute_SQLFunction("sp0_NET_Defaultprofile_getObject", _dataparameters); if (dbConnection_in == null) { _connection.Dispose(); } if (_dataparameters[0].Value != DBNull.Value) { _output = new SO_NET_Defaultprofile(); if (_dataparameters[0].Value == System.DBNull.Value) { _output.IDDefaultprofile = 0L; } else { _output.IDDefaultprofile = (long)_dataparameters[0].Value; } if (_dataparameters[1].Value == System.DBNull.Value) { _output.IFProfile = 0L; } else { _output.IFProfile = (long)_dataparameters[1].Value; } _output.haschanges_ = false; return _output; } return null; }
private static SO_NET_Defaultprofile[] getRecord( DataTable dataTable_in ) { DataColumn _dc_iddefaultprofile = null; DataColumn _dc_ifprofile = null; SO_NET_Defaultprofile[] _output = new SO_NET_Defaultprofile[dataTable_in.Rows.Count]; for (int r = 0; r < dataTable_in.Rows.Count; r++) { if (r == 0) { _dc_iddefaultprofile = dataTable_in.Columns["IDDefaultprofile"]; _dc_ifprofile = dataTable_in.Columns["IFProfile"]; } _output[r] = new SO_NET_Defaultprofile(); if (dataTable_in.Rows[r][_dc_iddefaultprofile] == System.DBNull.Value) { _output[r].iddefaultprofile_ = 0L; } else { _output[r].iddefaultprofile_ = (long)dataTable_in.Rows[r][_dc_iddefaultprofile]; } if (dataTable_in.Rows[r][_dc_ifprofile] == System.DBNull.Value) { _output[r].ifprofile_ = 0L; } else { _output[r].ifprofile_ = (long)dataTable_in.Rows[r][_dc_ifprofile]; } _output[r].haschanges_ = false; } return _output; }
/// <summary> /// Updates NET_Defaultprofile values on Database. /// </summary> /// <param name="forceUpdate_in">assign with True if you wish to force an Update (even if no changes have been made since last time getObject method was run) and False if not</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> public static void updObject( SO_NET_Defaultprofile NET_Defaultprofile_in, bool forceUpdate_in, DBConnection dbConnection_in ) { if (forceUpdate_in || NET_Defaultprofile_in.haschanges_) { 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("IDDefaultprofile_", DbType.Int64, ParameterDirection.Input, NET_Defaultprofile_in.IDDefaultprofile, 0), _connection.newDBDataParameter("IFProfile_", DbType.Int64, ParameterDirection.Input, NET_Defaultprofile_in.IFProfile, 0) }; _connection.Execute_SQLFunction( "sp0_NET_Defaultprofile_updObject", _dataparameters ); if (dbConnection_in == null) { _connection.Dispose(); } NET_Defaultprofile_in.haschanges_ = false; } }
/// <summary> /// Updates NET_Defaultprofile values on Database. /// </summary> /// <param name="forceUpdate_in">assign with True if you wish to force an Update (even if no changes have been made since last time getObject method was run) and False if not</param> public static void updObject( SO_NET_Defaultprofile NET_Defaultprofile_in, bool forceUpdate_in ) { updObject( NET_Defaultprofile_in, forceUpdate_in, null ); }
/// <summary> /// Inserts NET_Defaultprofile values into Database. /// </summary> /// <param name="selectIdentity_in">assign with True if you wish to retrieve insertion sequence/identity seed and with False if not</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>insertion sequence/identity seed</returns> public static long insObject( SO_NET_Defaultprofile NET_Defaultprofile_in, bool selectIdentity_in, DBConnection dbConnection_in ) { 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("IDDefaultprofile_", DbType.Int64, ParameterDirection.Output, null, 0), _connection.newDBDataParameter("IFProfile_", DbType.Int64, ParameterDirection.Input, NET_Defaultprofile_in.IFProfile, 0), _connection.newDBDataParameter("SelectIdentity_", DbType.Boolean, ParameterDirection.Input, selectIdentity_in, 1) }; _connection.Execute_SQLFunction( "sp0_NET_Defaultprofile_insObject", _dataparameters ); if (dbConnection_in == null) { _connection.Dispose(); } NET_Defaultprofile_in.IDDefaultprofile = (long)_dataparameters[0].Value;NET_Defaultprofile_in.haschanges_ = false; return NET_Defaultprofile_in.IDDefaultprofile; }
/// <summary> /// Inserts NET_Defaultprofile values into Database. /// </summary> /// <param name="selectIdentity_in">assign with True if you wish to retrieve insertion sequence/identity seed and with False if not</param> /// <returns>insertion sequence/identity seed</returns> public static long insObject( SO_NET_Defaultprofile NET_Defaultprofile_in, bool selectIdentity_in ) { return insObject( NET_Defaultprofile_in, selectIdentity_in, null ); }
public static DataTable getDataTable( SO_NET_Defaultprofile[] serializableobjects_in ) { DataTable _output = new DataTable(); DataRow _dr; DataColumn _dc_iddefaultprofile = new DataColumn("IDDefaultprofile", typeof(long)); _output.Columns.Add(_dc_iddefaultprofile); DataColumn _dc_ifprofile = new DataColumn("IFProfile", typeof(long)); _output.Columns.Add(_dc_ifprofile); foreach (SO_NET_Defaultprofile _serializableobject in serializableobjects_in) { _dr = _output.NewRow(); _dr[_dc_iddefaultprofile] = _serializableobject.IDDefaultprofile; _dr[_dc_ifprofile] = _serializableobject.IFProfile; _output.Rows.Add(_dr); } return _output; }