' ///////////////////////////////////////////////////////////////////////////
' // Description: Data Access class for the table 'Serienbrief_BL_Physiche_Ablage'
' // Generated by LLBLGen v1.21.2003.712 Final on: Sonntag, 19. September 2010, 09:41:03
' // 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 'Serienbrief_BL_Physiche_Ablage'.
'''
Public Class clsSerienbrief_BL_Physiche_Ablage
Inherits clsDBInteractionBase
#Region " Class Member Declarations "
Private m_daTimestampe As SqlDateTime
Private m_iEintragnr, m_iPartnernr, m_iSerienbriefnr As SqlInt32
Private m_sTGNumer_Ersteller, m_sDokumentid, m_sBezeichnung As SqlString
#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:
'''
''' - iSerienbriefnr. May be SqlInt32.Null
''' - sBezeichnung. May be SqlString.Null
''' - sTGNumer_Ersteller. May be SqlString.Null
''' - iPartnernr. May be SqlInt32.Null
''' - sDokumentid. May be SqlString.Null
''' - daTimestampe. May be SqlDateTime.Null
'''
''' Properties set after a succesful call of this method:
'''
''' - iEintragnr
''' - iErrorCode
'''
'''
Overrides Public Function Insert() As Boolean
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = "dbo.[pr_Serienbrief_BL_Physiche_Ablage_Insert]"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
' // Use base class' connection object
scmCmdToExecute.Connection = m_scoMainConnection
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSerienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTGNumer_Ersteller", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTGNumer_Ersteller))
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPartnernr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr))
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDokumentid", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTimestampe", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTimestampe))
scmCmdToExecute.Parameters.Add(new SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
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_iEintragnr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iEintragnr").Value, SqlInt32))
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_Serienbrief_BL_Physiche_Ablage_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("clsSerienbrief_BL_Physiche_Ablage::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:
'''
''' - iEintragnr
''' - iSerienbriefnr. May be SqlInt32.Null
''' - sBezeichnung. May be SqlString.Null
''' - sTGNumer_Ersteller. May be SqlString.Null
''' - iPartnernr. May be SqlInt32.Null
''' - sDokumentid. May be SqlString.Null
''' - daTimestampe. May be SqlDateTime.Null
'''
''' 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_Serienbrief_BL_Physiche_Ablage_Update]"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
' // Use base class' connection object
scmCmdToExecute.Connection = m_scoMainConnection
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSerienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTGNumer_Ersteller", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTGNumer_Ersteller))
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPartnernr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr))
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDokumentid", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTimestampe", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTimestampe))
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_Serienbrief_BL_Physiche_Ablage_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("clsSerienbrief_BL_Physiche_Ablage::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:
'''
'''
Overrides Public Function Delete() As Boolean
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = "dbo.[pr_Serienbrief_BL_Physiche_Ablage_Delete]"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
' // Use base class' connection object
scmCmdToExecute.Connection = m_scoMainConnection
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
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_Serienbrief_BL_Physiche_Ablage_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("clsSerienbrief_BL_Physiche_Ablage::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:
'''
''' - iErrorCode
''' - iEintragnr
''' - iSerienbriefnr
''' - sBezeichnung
''' - sTGNumer_Ersteller
''' - iPartnernr
''' - sDokumentid
''' - daTimestampe
'''
''' 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_Serienbrief_BL_Physiche_Ablage_SelectOne]"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
Dim dtToReturn As DataTable = new DataTable("Serienbrief_BL_Physiche_Ablage")
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
' // Use base class' connection object
scmCmdToExecute.Connection = m_scoMainConnection
Try
scmCmdToExecute.Parameters.Add(new SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
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_Serienbrief_BL_Physiche_Ablage_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
End If
If dtToReturn.Rows.Count > 0 Then
m_iEintragnr = New SqlInt32(CType(dtToReturn.Rows(0)("Eintragnr"), Integer))
If dtToReturn.Rows(0)("Serienbriefnr") Is System.DBNull.Value Then
m_iSerienbriefnr = SqlInt32.Null
Else
m_iSerienbriefnr = New SqlInt32(CType(dtToReturn.Rows(0)("Serienbriefnr"), Integer))
End If
If dtToReturn.Rows(0)("Bezeichnung") Is System.DBNull.Value Then
m_sBezeichnung = SqlString.Null
Else
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("Bezeichnung"), String))
End If
If dtToReturn.Rows(0)("TGNumer_Ersteller") Is System.DBNull.Value Then
m_sTGNumer_Ersteller = SqlString.Null
Else
m_sTGNumer_Ersteller = New SqlString(CType(dtToReturn.Rows(0)("TGNumer_Ersteller"), String))
End If
If dtToReturn.Rows(0)("Partnernr") Is System.DBNull.Value Then
m_iPartnernr = SqlInt32.Null
Else
m_iPartnernr = New SqlInt32(CType(dtToReturn.Rows(0)("Partnernr"), Integer))
End If
If dtToReturn.Rows(0)("Dokumentid") Is System.DBNull.Value Then
m_sDokumentid = SqlString.Null
Else
m_sDokumentid = New SqlString(CType(dtToReturn.Rows(0)("Dokumentid"), String))
End If
If dtToReturn.Rows(0)("Timestampe") Is System.DBNull.Value Then
m_daTimestampe = SqlDateTime.Null
Else
m_daTimestampe = New SqlDateTime(CType(dtToReturn.Rows(0)("Timestampe"), Date))
End If
End If
Return dtToReturn
Catch ex As Exception
' // some error occured. Bubble it to caller and encapsulate Exception object
Throw New Exception("clsSerienbrief_BL_Physiche_Ablage::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:
'''
'''
Overrides Public Function SelectAll() As DataTable
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = "dbo.[pr_Serienbrief_BL_Physiche_Ablage_SelectAll]"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
Dim dtToReturn As DataTable = new DataTable("Serienbrief_BL_Physiche_Ablage")
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_Serienbrief_BL_Physiche_Ablage_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("clsSerienbrief_BL_Physiche_Ablage::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 [iEintragnr]() As SqlInt32
Get
Return m_iEintragnr
End Get
Set(ByVal Value As SqlInt32)
Dim iEintragnrTmp As SqlInt32 = Value
If iEintragnrTmp.IsNull Then
Throw New ArgumentOutOfRangeException("iEintragnr", "iEintragnr can't be NULL")
End If
m_iEintragnr = Value
End Set
End Property
Public Property [iSerienbriefnr]() As SqlInt32
Get
Return m_iSerienbriefnr
End Get
Set(ByVal Value As SqlInt32)
m_iSerienbriefnr = Value
End Set
End Property
Public Property [sBezeichnung]() As SqlString
Get
Return m_sBezeichnung
End Get
Set(ByVal Value As SqlString)
m_sBezeichnung = Value
End Set
End Property
Public Property [sTGNumer_Ersteller]() As SqlString
Get
Return m_sTGNumer_Ersteller
End Get
Set(ByVal Value As SqlString)
m_sTGNumer_Ersteller = Value
End Set
End Property
Public Property [iPartnernr]() As SqlInt32
Get
Return m_iPartnernr
End Get
Set(ByVal Value As SqlInt32)
m_iPartnernr = Value
End Set
End Property
Public Property [sDokumentid]() As SqlString
Get
Return m_sDokumentid
End Get
Set(ByVal Value As SqlString)
m_sDokumentid = Value
End Set
End Property
Public Property [daTimestampe]() As SqlDateTime
Get
Return m_daTimestampe
End Get
Set(ByVal Value As SqlDateTime)
m_daTimestampe = Value
End Set
End Property
#End Region
End Class
End Namespace