' /////////////////////////////////////////////////////////////////////////// ' // Description: Data Access class for the table 'edoka_etbez0' ' // Generated by LLBLGen v1.2.1045.38210 Final on: Dienstag, 26. April 2005, 15:08:37 ' // Because the Base Class already implements IDispose, this class doesn't. ' /////////////////////////////////////////////////////////////////////////// Imports System Imports System.Data Imports System.Data.SqlTypes Imports System.Data.SqlClient Namespace edokadb ' /// ' /// Purpose: Data Access class for the table 'edoka_etbez0'. ' /// Public Class clsEdoka_etbez0 Inherits clsDBInteractionBase #Region " Class Member Declarations " Private m_sCDMUTER, m_sSAREC00 As SqlString Private m_daTSMUT00, m_daDMERF00 As SqlDateTime Private m_iNRVVG00, m_iNRPAR00, m_iNRBEU01, m_iNRBEZ00, m_iNRBEU02 As SqlInt32 Private m_siNRBEO00, m_siNRVRN00, m_siNRPDM00 As SqlInt16 #End Region ' /// ' /// Purpose: Class constructor. ' /// Public Sub New() ' // Nothing for now. End Sub ' /// ' /// Purpose: Insert method. This method will insert one new row into the database. ' /// ' /// True if succeeded, otherwise an Exception is thrown. ' /// ' /// Properties needed for this method: ' /// ' /// Properties set after a succesful call of this method: ' /// ' /// Overrides Public Function Insert() As Boolean Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[pr_edoka_etbez0_Insert]" scmCmdToExecute.CommandType = CommandType.StoredProcedure ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRBEZ00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRBEZ00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@siNRVRN00", SqlDbType.SmallInt, 2, ParameterDirection.Input, False, 5, 0, "", DataRowVersion.Proposed, m_siNRVRN00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRBEU01", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRBEU01)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRBEU02", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRBEU02)) scmCmdToExecute.Parameters.Add(New SqlParameter("@siNRBEO00", SqlDbType.SmallInt, 2, ParameterDirection.Input, False, 5, 0, "", DataRowVersion.Proposed, m_siNRBEO00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRPAR00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRPAR00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRVVG00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRVVG00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@siNRPDM00", SqlDbType.SmallInt, 2, ParameterDirection.Input, True, 5, 0, "", DataRowVersion.Proposed, m_siNRPDM00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sCDMUTER", SqlDbType.Char, 8, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sCDMUTER)) scmCmdToExecute.Parameters.Add(New SqlParameter("@daTSMUT00", SqlDbType.DateTime, 8, ParameterDirection.Input, False, 23, 3, "", DataRowVersion.Proposed, m_daTSMUT00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@daDMERF00", SqlDbType.DateTime, 8, ParameterDirection.Input, False, 23, 3, "", DataRowVersion.Proposed, m_daDMERF00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sSAREC00", SqlDbType.Char, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sSAREC00)) scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode)) If m_bMainConnectionIsCreatedLocal Then ' // Open connection. m_scoMainConnection.Open() Else If m_cpMainConnectionProvider.bIsTransactionPending Then scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction End If End If ' // Execute query. scmCmdToExecute.ExecuteNonQuery() m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32)) If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then ' // Throw error. Throw New Exception("Stored Procedure 'pr_edoka_etbez0_Insert' reported the ErrorCode: " & m_iErrorCode.ToString()) End If Return True Catch ex As Exception ' // some error occured. Bubble it to caller and encapsulate Exception object Throw New Exception("clsEdoka_etbez0::Insert::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() End Try End Function ' /// ' /// Purpose: Update method. This method will Update one existing row in the database. ' /// ' /// True if succeeded, otherwise an Exception is thrown. ' /// ' /// Properties needed for this method: ' /// ' /// Properties set after a succesful call of this method: ' /// ' /// Overrides Public Function Update() As Boolean Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[pr_edoka_etbez0_Update]" scmCmdToExecute.CommandType = CommandType.StoredProcedure ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRBEZ00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRBEZ00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@siNRVRN00", SqlDbType.SmallInt, 2, ParameterDirection.Input, False, 5, 0, "", DataRowVersion.Proposed, m_siNRVRN00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRBEU01", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRBEU01)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRBEU02", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRBEU02)) scmCmdToExecute.Parameters.Add(New SqlParameter("@siNRBEO00", SqlDbType.SmallInt, 2, ParameterDirection.Input, False, 5, 0, "", DataRowVersion.Proposed, m_siNRBEO00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRPAR00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRPAR00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRVVG00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRVVG00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@siNRPDM00", SqlDbType.SmallInt, 2, ParameterDirection.Input, True, 5, 0, "", DataRowVersion.Proposed, m_siNRPDM00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sCDMUTER", SqlDbType.Char, 8, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sCDMUTER)) scmCmdToExecute.Parameters.Add(New SqlParameter("@daTSMUT00", SqlDbType.DateTime, 8, ParameterDirection.Input, False, 23, 3, "", DataRowVersion.Proposed, m_daTSMUT00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@daDMERF00", SqlDbType.DateTime, 8, ParameterDirection.Input, False, 23, 3, "", DataRowVersion.Proposed, m_daDMERF00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sSAREC00", SqlDbType.Char, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sSAREC00)) scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode)) If m_bMainConnectionIsCreatedLocal Then ' // Open connection. m_scoMainConnection.Open() Else If m_cpMainConnectionProvider.bIsTransactionPending Then scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction End If End If ' // Execute query. scmCmdToExecute.ExecuteNonQuery() m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32)) If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then ' // Throw error. Throw New Exception("Stored Procedure 'pr_edoka_etbez0_Update' reported the ErrorCode: " & m_iErrorCode.ToString()) End If Return True Catch ex As Exception ' // some error occured. Bubble it to caller and encapsulate Exception object Throw New Exception("clsEdoka_etbez0::Update::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() End Try End Function ' /// ' /// Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key. ' /// ' /// True if succeeded, otherwise an Exception is thrown. ' /// ' /// Properties needed for this method: ' /// ' /// Properties set after a succesful call of this method: ' /// ' /// Public Overrides Function Delete() As Boolean Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[pr_edoka_etbez0_Delete]" scmCmdToExecute.CommandType = CommandType.StoredProcedure ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRBEZ00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRBEZ00)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode)) If m_bMainConnectionIsCreatedLocal Then ' // Open connection. m_scoMainConnection.Open() Else If m_cpMainConnectionProvider.bIsTransactionPending Then scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction End If End If ' // Execute query. scmCmdToExecute.ExecuteNonQuery() m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32)) If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then ' // Throw error. Throw New Exception("Stored Procedure 'pr_edoka_etbez0_Delete' reported the ErrorCode: " & m_iErrorCode.ToString()) End If Return True Catch ex As Exception ' // some error occured. Bubble it to caller and encapsulate Exception object Throw New Exception("clsEdoka_etbez0::Delete::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() End Try End Function ' /// ' /// Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key. ' /// ' /// DataTable object if succeeded, otherwise an Exception is thrown. ' /// ' /// Properties needed for this method: ' /// ' /// Properties set after a succesful call of this method: ' /// ' /// Will fill all properties corresponding with a field in the table with the value of the row selected. ' /// Overrides Public Function SelectOne() As DataTable Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[pr_edoka_etbez0_SelectOne]" scmCmdToExecute.CommandType = CommandType.StoredProcedure Dim dtToReturn As DataTable = new DataTable("edoka_etbez0") Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute) ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(new SqlParameter("@iNRBEZ00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRBEZ00)) scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode)) If m_bMainConnectionIsCreatedLocal Then ' // Open connection. m_scoMainConnection.Open() Else If m_cpMainConnectionProvider.bIsTransactionPending Then scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction End If End If ' // Execute query. sdaAdapter.Fill(dtToReturn) m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32)) If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then ' // Throw error. Throw New Exception("Stored Procedure 'pr_edoka_etbez0_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString()) End If If dtToReturn.Rows.Count > 0 Then m_iNRBEZ00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRBEZ00"), Integer)) m_siNRVRN00 = New SqlInt16(CType(dtToReturn.Rows(0)("NRVRN00"), Short)) m_iNRBEU01 = New SqlInt32(CType(dtToReturn.Rows(0)("NRBEU01"), Integer)) If dtToReturn.Rows(0)("NRBEU02") Is System.DBNull.Value Then m_iNRBEU02 = SqlInt32.Null Else m_iNRBEU02 = New SqlInt32(CType(dtToReturn.Rows(0)("NRBEU02"), Integer)) End If m_siNRBEO00 = New SqlInt16(CType(dtToReturn.Rows(0)("NRBEO00"), Short)) If dtToReturn.Rows(0)("NRPAR00") Is System.DBNull.Value Then m_iNRPAR00 = SqlInt32.Null Else m_iNRPAR00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRPAR00"), Integer)) End If If dtToReturn.Rows(0)("NRVVG00") Is System.DBNull.Value Then m_iNRVVG00 = SqlInt32.Null Else m_iNRVVG00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRVVG00"), Integer)) End If If dtToReturn.Rows(0)("NRPDM00") Is System.DBNull.Value Then m_siNRPDM00 = SqlInt16.Null Else m_siNRPDM00 = New SqlInt16(CType(dtToReturn.Rows(0)("NRPDM00"), Short)) End If m_sCDMUTER = New SqlString(CType(dtToReturn.Rows(0)("CDMUTER"), String)) m_daTSMUT00 = New SqlDateTime(CType(dtToReturn.Rows(0)("TSMUT00"), Date)) m_daDMERF00 = New SqlDateTime(CType(dtToReturn.Rows(0)("DMERF00"), Date)) m_sSAREC00 = New SqlString(CType(dtToReturn.Rows(0)("SAREC00"), String)) End If Return dtToReturn Catch ex As Exception ' // some error occured. Bubble it to caller and encapsulate Exception object Throw New Exception("clsEdoka_etbez0::SelectOne::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() sdaAdapter.Dispose() End Try End Function ' /// ' /// Purpose: SelectAll method. This method will Select all rows from the table. ' /// ' /// DataTable object if succeeded, otherwise an Exception is thrown. ' /// ' /// Properties set after a succesful call of this method: ' /// ' /// Public Overrides Function SelectAll() As DataTable Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[pr_edoka_etbez0_SelectAll]" scmCmdToExecute.CommandType = CommandType.StoredProcedure Dim dtToReturn As DataTable = New DataTable("edoka_etbez0") Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute) ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode)) If m_bMainConnectionIsCreatedLocal Then ' // Open connection. m_scoMainConnection.Open() Else If m_cpMainConnectionProvider.bIsTransactionPending Then scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction End If End If ' // Execute query. sdaAdapter.Fill(dtToReturn) m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32)) If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then ' // Throw error. Throw New Exception("Stored Procedure 'pr_edoka_etbez0_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString()) End If Return dtToReturn Catch ex As Exception ' // some error occured. Bubble it to caller and encapsulate Exception object Throw New Exception("clsEdoka_etbez0::SelectAll::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() sdaAdapter.Dispose() End Try End Function #Region " Class Property Declarations " Public Property [iNRBEZ00]() As SqlInt32 Get Return m_iNRBEZ00 End Get Set(ByVal Value As SqlInt32) Dim iNRBEZ00Tmp As SqlInt32 = Value If iNRBEZ00Tmp.IsNull Then Throw New ArgumentOutOfRangeException("iNRBEZ00", "iNRBEZ00 can't be NULL") End If m_iNRBEZ00 = Value End Set End Property Public Property [siNRVRN00]() As SqlInt16 Get Return m_siNRVRN00 End Get Set(ByVal Value As SqlInt16) Dim siNRVRN00Tmp As SqlInt16 = Value If siNRVRN00Tmp.IsNull Then Throw New ArgumentOutOfRangeException("siNRVRN00", "siNRVRN00 can't be NULL") End If m_siNRVRN00 = Value End Set End Property Public Property [iNRBEU01]() As SqlInt32 Get Return m_iNRBEU01 End Get Set(ByVal Value As SqlInt32) Dim iNRBEU01Tmp As SqlInt32 = Value If iNRBEU01Tmp.IsNull Then Throw New ArgumentOutOfRangeException("iNRBEU01", "iNRBEU01 can't be NULL") End If m_iNRBEU01 = Value End Set End Property Public Property [iNRBEU02]() As SqlInt32 Get Return m_iNRBEU02 End Get Set(ByVal Value As SqlInt32) m_iNRBEU02 = Value End Set End Property Public Property [siNRBEO00]() As SqlInt16 Get Return m_siNRBEO00 End Get Set(ByVal Value As SqlInt16) Dim siNRBEO00Tmp As SqlInt16 = Value If siNRBEO00Tmp.IsNull Then Throw New ArgumentOutOfRangeException("siNRBEO00", "siNRBEO00 can't be NULL") End If m_siNRBEO00 = Value End Set End Property Public Property [iNRPAR00]() As SqlInt32 Get Return m_iNRPAR00 End Get Set(ByVal Value As SqlInt32) m_iNRPAR00 = Value End Set End Property Public Property [iNRVVG00]() As SqlInt32 Get Return m_iNRVVG00 End Get Set(ByVal Value As SqlInt32) m_iNRVVG00 = Value End Set End Property Public Property [siNRPDM00]() As SqlInt16 Get Return m_siNRPDM00 End Get Set(ByVal Value As SqlInt16) m_siNRPDM00 = Value End Set End Property Public Property [sCDMUTER]() As SqlString Get Return m_sCDMUTER End Get Set(ByVal Value As SqlString) Dim sCDMUTERTmp As SqlString = Value If sCDMUTERTmp.IsNull Then Throw New ArgumentOutOfRangeException("sCDMUTER", "sCDMUTER can't be NULL") End If m_sCDMUTER = Value End Set End Property Public Property [daTSMUT00]() As SqlDateTime Get Return m_daTSMUT00 End Get Set(ByVal Value As SqlDateTime) Dim daTSMUT00Tmp As SqlDateTime = Value If daTSMUT00Tmp.IsNull Then Throw New ArgumentOutOfRangeException("daTSMUT00", "daTSMUT00 can't be NULL") End If m_daTSMUT00 = Value End Set End Property Public Property [daDMERF00]() As SqlDateTime Get Return m_daDMERF00 End Get Set(ByVal Value As SqlDateTime) Dim daDMERF00Tmp As SqlDateTime = Value If daDMERF00Tmp.IsNull Then Throw New ArgumentOutOfRangeException("daDMERF00", "daDMERF00 can't be NULL") End If m_daDMERF00 = Value End Set End Property Public Property [sSAREC00]() As SqlString Get Return m_sSAREC00 End Get Set(ByVal Value As SqlString) Dim sSAREC00Tmp As SqlString = Value If sSAREC00Tmp.IsNull Then Throw New ArgumentOutOfRangeException("sSAREC00", "sSAREC00 can't be NULL") End If m_sSAREC00 = Value End Set End Property #End Region End Class End Namespace