You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
259 lines
8.6 KiB
259 lines
8.6 KiB
' ///////////////////////////////////////////////////////////////////////////
|
|
' // Description: Data Access class for the table 'BAA_SHU_Extrakt_Beziehungen'
|
|
' // Generated by LLBLGen v1.21.2003.712 Final on: Freitag, 8. März 2013, 18:25:42
|
|
' // 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 db
|
|
''' <summary>
|
|
''' Purpose: Data Access class for the table 'BAA_SHU_Extrakt_Beziehungen'.
|
|
''' </summary>
|
|
Public Class clsBAA_SHU_Extrakt_Beziehungen
|
|
Inherits clsDBInteractionBase
|
|
|
|
#Region " Class Member Declarations "
|
|
|
|
Private m_iSequenz, m_iID, m_iTypNr, m_iParent As SqlInt32
|
|
Private m_sTyp, m_sTyp_Bezeichung, m_sParent_Typ, m_sParent_Bezeichnung, m_sBezeichnung As SqlString
|
|
|
|
#End Region
|
|
|
|
|
|
''' <summary>
|
|
''' Purpose: Class constructor.
|
|
''' </summary>
|
|
Public Sub New()
|
|
' // Nothing for now.
|
|
End Sub
|
|
|
|
|
|
''' <summary>
|
|
''' Purpose: Insert method. This method will insert one new row into the database.
|
|
''' </summary>
|
|
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
|
''' <remarks>
|
|
''' Properties needed for this method:
|
|
''' <UL>
|
|
''' <LI>iParent. May be SqlInt32.Null</LI>
|
|
''' <LI>sParent_Bezeichnung. May be SqlString.Null</LI>
|
|
''' <LI>sParent_Typ. May be SqlString.Null</LI>
|
|
''' <LI>iSequenz. May be SqlInt32.Null</LI>
|
|
''' <LI>iID. May be SqlInt32.Null</LI>
|
|
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
|
''' <LI>sTyp. May be SqlString.Null</LI>
|
|
''' <LI>iTypNr. May be SqlInt32.Null</LI>
|
|
''' <LI>sTyp_Bezeichung. May be SqlString.Null</LI>
|
|
''' </UL>
|
|
''' Properties set after a succesful call of this method:
|
|
''' <UL>
|
|
''' <LI>iErrorCode</LI>
|
|
'''</UL>
|
|
''' </remarks>
|
|
Overrides Public Function Insert() As Boolean
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.[pr_BAA_SHU_Extrakt_Beziehungen_Insert]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
|
' // Use base class' connection object
|
|
scmCmdToExecute.Connection = m_scoMainConnection
|
|
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParent", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParent))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sParent_Bezeichnung", SqlDbType.NVarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sParent_Bezeichnung))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sParent_Typ", SqlDbType.NVarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sParent_Typ))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iID))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.NVarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTyp", SqlDbType.NVarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTyp))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iTypNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTypNr))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTyp_Bezeichung", SqlDbType.NVarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTyp_Bezeichung))
|
|
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.
|
|
m_iRowsAffected = 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_BAA_SHU_Extrakt_Beziehungen_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("clsBAA_SHU_Extrakt_Beziehungen::Insert::Error occured.", ex)
|
|
Finally
|
|
If m_bMainConnectionIsCreatedLocal Then
|
|
' // Close connection.
|
|
m_scoMainConnection.Close()
|
|
End If
|
|
scmCmdToExecute.Dispose()
|
|
End Try
|
|
End Function
|
|
|
|
|
|
''' <summary>
|
|
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
|
''' </summary>
|
|
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
|
''' <remarks>
|
|
''' Properties set after a succesful call of this method:
|
|
''' <UL>
|
|
''' <LI>iErrorCode</LI>
|
|
'''</UL>
|
|
''' </remarks>
|
|
Overrides Public Function SelectAll() As DataTable
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.[pr_BAA_SHU_Extrakt_Beziehungen_SelectAll]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
Dim dtToReturn As DataTable = new DataTable("BAA_SHU_Extrakt_Beziehungen")
|
|
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_BAA_SHU_Extrakt_Beziehungen_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("clsBAA_SHU_Extrakt_Beziehungen::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 [iParent]() As SqlInt32
|
|
Get
|
|
Return m_iParent
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
m_iParent = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [sParent_Bezeichnung]() As SqlString
|
|
Get
|
|
Return m_sParent_Bezeichnung
|
|
End Get
|
|
Set(ByVal Value As SqlString)
|
|
m_sParent_Bezeichnung = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [sParent_Typ]() As SqlString
|
|
Get
|
|
Return m_sParent_Typ
|
|
End Get
|
|
Set(ByVal Value As SqlString)
|
|
m_sParent_Typ = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [iSequenz]() As SqlInt32
|
|
Get
|
|
Return m_iSequenz
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
m_iSequenz = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [iID]() As SqlInt32
|
|
Get
|
|
Return m_iID
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
m_iID = 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 [sTyp]() As SqlString
|
|
Get
|
|
Return m_sTyp
|
|
End Get
|
|
Set(ByVal Value As SqlString)
|
|
m_sTyp = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [iTypNr]() As SqlInt32
|
|
Get
|
|
Return m_iTypNr
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
m_iTypNr = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [sTyp_Bezeichung]() As SqlString
|
|
Get
|
|
Return m_sTyp_Bezeichung
|
|
End Get
|
|
Set(ByVal Value As SqlString)
|
|
m_sTyp_Bezeichung = Value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
End Class
|
|
End Namespace
|