Initial commit
This commit is contained in:
510
BEA - Kopie/DB/Generierte Objekte/clsApplication.vb
Normal file
510
BEA - Kopie/DB/Generierte Objekte/clsApplication.vb
Normal file
@@ -0,0 +1,510 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Application'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'Application'.
|
||||
''' </summary>
|
||||
Public Class clsApplication
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bShowlogin, m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iApplikationsnr As SqlInt32
|
||||
Private m_sTmp_filepath, m_sVersion 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>iApplikationsnr</LI>
|
||||
''' <LI>sVersion. May be SqlString.Null</LI>
|
||||
''' <LI>bShowlogin. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sTmp_filepath. 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_Application_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationsnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationsnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sversion", SqlDbType.VarChar, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVersion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bshowlogin", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bShowlogin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stmp_filepath", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTmp_filepath))
|
||||
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_Application_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("clsApplication::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' <LI>sVersion. May be SqlString.Null</LI>
|
||||
''' <LI>bShowlogin. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sTmp_filepath. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Application_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationsnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationsnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sversion", SqlDbType.VarChar, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVersion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bshowlogin", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bShowlogin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stmp_filepath", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTmp_filepath))
|
||||
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_Application_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("clsApplication::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Application_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationsnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationsnr))
|
||||
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_Application_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("clsApplication::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' <LI>sVersion</LI>
|
||||
''' <LI>bShowlogin</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>sTmp_filepath</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Application_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Application")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iapplikationsnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationsnr))
|
||||
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_Application_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iApplikationsnr = New SqlInt32(CType(dtToReturn.Rows(0)("applikationsnr"), Integer))
|
||||
If dtToReturn.Rows(0)("version") Is System.DBNull.Value Then
|
||||
m_sVersion = SqlString.Null
|
||||
Else
|
||||
m_sVersion = New SqlString(CType(dtToReturn.Rows(0)("version"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("showlogin") Is System.DBNull.Value Then
|
||||
m_bShowlogin = SqlBoolean.Null
|
||||
Else
|
||||
m_bShowlogin = New SqlBoolean(CType(dtToReturn.Rows(0)("showlogin"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tmp_filepath") Is System.DBNull.Value Then
|
||||
m_sTmp_filepath = SqlString.Null
|
||||
Else
|
||||
m_sTmp_filepath = New SqlString(CType(dtToReturn.Rows(0)("tmp_filepath"), String))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsApplication::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_Application_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Application")
|
||||
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_Application_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("clsApplication::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 [iApplikationsnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iApplikationsnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iApplikationsnrTmp As SqlInt32 = Value
|
||||
If iApplikationsnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iApplikationsnr", "iApplikationsnr can't be NULL")
|
||||
End If
|
||||
m_iApplikationsnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sVersion]() As SqlString
|
||||
Get
|
||||
Return m_sVersion
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sVersion = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bShowlogin]() As SqlBoolean
|
||||
Get
|
||||
Return m_bShowlogin
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bShowlogin = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTmp_filepath]() As SqlString
|
||||
Get
|
||||
Return m_sTmp_filepath
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTmp_filepath = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
424
BEA - Kopie/DB/Generierte Objekte/clsBerechtigung.vb
Normal file
424
BEA - Kopie/DB/Generierte Objekte/clsBerechtigung.vb
Normal file
@@ -0,0 +1,424 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsBerechtigung
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iCID, m_iMutierer, m_iBerechtigungNr, m_iParentID, m_iSequenz As SqlInt32
|
||||
Private m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Berechtigung_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iBerechtigungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBerechtigungNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iCID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iCID))
|
||||
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_Berechtigung_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("clsBerechtigung::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Berechtigung_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iBerechtigungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBerechtigungNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iCID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iCID))
|
||||
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_Berechtigung_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("clsBerechtigung::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Berechtigung_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iBerechtigungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBerechtigungNr))
|
||||
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_Berechtigung_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("clsBerechtigung::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Berechtigung_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Berechtigung")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iBerechtigungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBerechtigungNr))
|
||||
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_Berechtigung_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iBerechtigungNr = New SqlInt32(CType(dtToReturn.Rows(0)("BerechtigungNr"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), 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)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sequenz") Is System.DBNull.Value Then
|
||||
m_iSequenz = SqlInt32.Null
|
||||
Else
|
||||
m_iSequenz = New SqlInt32(CType(dtToReturn.Rows(0)("Sequenz"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("CID") Is System.DBNull.Value Then
|
||||
m_iCID = SqlInt32.Null
|
||||
Else
|
||||
m_iCID = New SqlInt32(CType(dtToReturn.Rows(0)("CID"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsBerechtigung::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Berechtigung_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Berechtigung")
|
||||
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_Berechtigung_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("clsBerechtigung::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 [iBerechtigungNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iBerechtigungNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iBerechtigungNrTmp As SqlInt32 = Value
|
||||
If iBerechtigungNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iBerechtigungNr", "iBerechtigungNr can't be NULL")
|
||||
End If
|
||||
m_iBerechtigungNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iCID]() As SqlInt32
|
||||
Get
|
||||
Return m_iCID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iCID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
236
BEA - Kopie/DB/Generierte Objekte/clsConnectionProvider.vb
Normal file
236
BEA - Kopie/DB/Generierte Objekte/clsConnectionProvider.vb
Normal file
@@ -0,0 +1,236 @@
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Collections
|
||||
|
||||
Namespace DB
|
||||
Public Class clsConnectionProvider
|
||||
Implements IDisposable
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_scoDBConnection As SqlConnection
|
||||
Private m_bIsTransactionPending, m_bIsDisposed As Boolean
|
||||
Private m_stCurrentTransaction As SqlTransaction
|
||||
Private m_alSavePoints As ArrayList
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Init the class
|
||||
InitClass()
|
||||
End Sub
|
||||
|
||||
|
||||
Overloads Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
|
||||
Overridable Overloads Protected Sub Dispose(ByVal bIsDisposing As Boolean)
|
||||
' // Check to see if Dispose has already been called.
|
||||
If Not m_bIsDisposed Then
|
||||
If bIsDisposing Then
|
||||
' // Dispose managed resources.
|
||||
If Not (m_stCurrentTransaction Is Nothing) Then
|
||||
m_stCurrentTransaction.Dispose()
|
||||
m_stCurrentTransaction = Nothing
|
||||
End If
|
||||
If Not (m_scoDBConnection Is Nothing) Then
|
||||
' // closing the connection will abort (rollback) any pending transactions
|
||||
m_scoDBConnection.Close()
|
||||
m_scoDBConnection.Dispose()
|
||||
m_scoDBConnection = Nothing
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
m_bIsDisposed = True
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub InitClass()
|
||||
' // Create all the objects and initialize other members.
|
||||
m_scoDBConnection = new SqlConnection()
|
||||
m_bIsDisposed = False
|
||||
m_stCurrentTransaction = Nothing
|
||||
m_bIsTransactionPending = False
|
||||
m_alSavePoints = new ArrayList()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Function OpenConnection() As Boolean
|
||||
Try
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) > 0 Then
|
||||
' // It's already open.
|
||||
Throw New Exception("OpenConnection::Connection is already open.")
|
||||
End If
|
||||
m_scoDBConnection.Open()
|
||||
m_bIsTransactionPending = False
|
||||
m_alSavePoints.Clear()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Function BeginTransaction(sTransactionName As String) As Boolean
|
||||
Try
|
||||
If m_bIsTransactionPending Then
|
||||
' // no nested transactions allowed.
|
||||
Throw New Exception("BeginTransaction::Already transaction pending. Nesting not allowed")
|
||||
End If
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // no open connection
|
||||
Throw New Exception("BeginTransaction::Connection is not open.")
|
||||
End If
|
||||
' // begin the transaction and store the transaction object.
|
||||
m_stCurrentTransaction = m_scoDBConnection.BeginTransaction(IsolationLevel.ReadCommitted, sTransactionName)
|
||||
m_bIsTransactionPending = True
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Function CommitTransaction() As Boolean
|
||||
Try
|
||||
If Not m_bIsTransactionPending Then
|
||||
' // no transaction pending
|
||||
Throw New Exception("CommitTransaction::No transaction pending.")
|
||||
End If
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // no open connection
|
||||
Throw New Exception("CommitTransaction::Connection is not open.")
|
||||
End if
|
||||
' // commit the transaction
|
||||
m_stCurrentTransaction.Commit()
|
||||
m_bIsTransactionPending = False
|
||||
m_stCurrentTransaction.Dispose()
|
||||
m_stCurrentTransaction = Nothing
|
||||
m_alSavePoints.Clear()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Function RollbackTransaction(sTransactionToRollback As String) As Boolean
|
||||
Try
|
||||
If Not m_bIsTransactionPending Then
|
||||
' // no transaction pending
|
||||
Throw New Exception("RollbackTransaction::No transaction pending.")
|
||||
End If
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // no open connection
|
||||
Throw New Exception("RollbackTransaction::Connection is not open.")
|
||||
End If
|
||||
' // rollback the transaction
|
||||
m_stCurrentTransaction.Rollback(sTransactionToRollback)
|
||||
' // if this wasn't a savepoint, we've rolled back the complete transaction, so we
|
||||
' // can clean it up.
|
||||
If Not m_alSavePoints.Contains(sTransactionToRollback) Then
|
||||
' // it's not a savepoint
|
||||
m_bIsTransactionPending = False
|
||||
m_stCurrentTransaction.Dispose()
|
||||
m_stCurrentTransaction = Nothing
|
||||
m_alSavePoints.Clear()
|
||||
End If
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Function SaveTransaction(sSavePointName As String) As Boolean
|
||||
Try
|
||||
If Not m_bIsTransactionPending Then
|
||||
' // no transaction pending
|
||||
Throw New Exception("SaveTransaction::No transaction pending.")
|
||||
End If
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // no open connection
|
||||
Throw New Exception("SaveTransaction::Connection is not open.")
|
||||
End If
|
||||
' // save the transaction
|
||||
m_stCurrentTransaction.Save(sSavePointName)
|
||||
' // Store the savepoint in the list.
|
||||
m_alSavePoints.Add(sSavePointName)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Function CloseConnection(bCommitPendingTransaction As Boolean) As Boolean
|
||||
Try
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // No open connection
|
||||
Return False
|
||||
End If
|
||||
If m_bIsTransactionPending Then
|
||||
If bCommitPendingTransaction Then
|
||||
' // Commit the pending transaction
|
||||
m_stCurrentTransaction.Commit()
|
||||
Else
|
||||
' // Rollback the pending transaction
|
||||
m_stCurrentTransaction.Rollback()
|
||||
End If
|
||||
m_bIsTransactionPending = False
|
||||
m_stCurrentTransaction.Dispose()
|
||||
m_stCurrentTransaction = Nothing
|
||||
m_alSavePoints.Clear()
|
||||
End If
|
||||
' // close the connection
|
||||
m_scoDBConnection.Close()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public ReadOnly Property stCurrentTransaction() As SqlTransaction
|
||||
Get
|
||||
Return m_stCurrentTransaction
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property bIsTransactionPending() As Boolean
|
||||
Get
|
||||
Return m_bIsTransactionPending
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property scoDBConnection() As SqlConnection
|
||||
Get
|
||||
Return m_scoDBConnection
|
||||
End Get
|
||||
End Property
|
||||
Public WriteOnly Property sConnectionString() As String
|
||||
Set (ByVal Value As String)
|
||||
m_scoDBConnection.ConnectionString = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
167
BEA - Kopie/DB/Generierte Objekte/clsDBInteractionBase.vb
Normal file
167
BEA - Kopie/DB/Generierte Objekte/clsDBInteractionBase.vb
Normal file
@@ -0,0 +1,167 @@
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
|
||||
Namespace DB
|
||||
Public Enum LLBLError
|
||||
AllOk
|
||||
' // Add more here (check the comma's!)
|
||||
End Enum
|
||||
|
||||
|
||||
Public Interface ICommonDBAccess
|
||||
Function Insert() As Boolean
|
||||
Function Update() As Boolean
|
||||
Function Delete() As Boolean
|
||||
Function SelectOne() As DataTable
|
||||
Function SelectAll() As DataTable
|
||||
End Interface
|
||||
|
||||
|
||||
Public MustInherit Class clsDBInteractionBase
|
||||
Implements IDisposable
|
||||
Implements ICommonDBAccess
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Protected m_scoMainConnection As SqlConnection
|
||||
Protected m_iRowsAffected As Integer
|
||||
Protected m_iErrorCode As SqlInt32
|
||||
Protected m_bMainConnectionIsCreatedLocal As Boolean
|
||||
Protected m_cpMainConnectionProvider As clsConnectionProvider
|
||||
Private m_sConnectionString As String
|
||||
Private m_bIsDisposed As Boolean
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Initialize the class' members.
|
||||
InitClass()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub InitClass()
|
||||
' // create all the objects and initialize other members.
|
||||
m_scoMainConnection = new SqlConnection()
|
||||
m_bMainConnectionIsCreatedLocal = True
|
||||
m_cpMainConnectionProvider = Nothing
|
||||
m_iErrorCode = New SqlInt32(LLBLError.AllOk)
|
||||
m_bIsDisposed = False
|
||||
End Sub
|
||||
|
||||
|
||||
Overloads Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
|
||||
Overridable Overloads Protected Sub Dispose(ByVal bIsDisposing As Boolean)
|
||||
' // Check to see if Dispose has already been called.
|
||||
If Not m_bIsDisposed Then
|
||||
If bIsDisposing Then
|
||||
' // Dispose managed resources.
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Object is created in this class, so destroy it here.
|
||||
m_scoMainConnection.Close()
|
||||
m_scoMainConnection.Dispose()
|
||||
m_bMainConnectionIsCreatedLocal = True
|
||||
End If
|
||||
m_cpMainConnectionProvider = Nothing
|
||||
m_scoMainConnection = Nothing
|
||||
End If
|
||||
End If
|
||||
m_bIsDisposed = True
|
||||
End Sub
|
||||
|
||||
|
||||
Public Overridable Function Insert() As Boolean Implements ICommonDBAccess.Insert
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function Delete() As Boolean Implements ICommonDBAccess.Delete
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function Update() As Boolean Implements ICommonDBAccess.Update
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function SelectOne() As DataTable Implements ICommonDBAccess.SelectOne
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function SelectAll() As DataTable Implements ICommonDBAccess.SelectAll
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public WriteOnly Property cpMainConnectionProvider() As clsConnectionProvider
|
||||
Set(ByVal Value As clsConnectionProvider)
|
||||
If Value Is Nothing Then
|
||||
' // Invalid value
|
||||
Throw New ArgumentNullException("cpMainConnectionProvider", "Nothing passed as value to this property which is not allowed.")
|
||||
End If
|
||||
|
||||
' // A connection provider object is passed to this class.
|
||||
' // Retrieve the SqlConnection object, if present and create a
|
||||
' // reference to it. If there is already a MainConnection object
|
||||
' // referenced by the membervar, destroy that one or simply
|
||||
' // remove the reference, based on the flag.
|
||||
If Not (m_scoMainConnection Is Nothing) Then
|
||||
' // First get rid of current connection object. Caller is responsible
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Is local created object, close it and dispose it.
|
||||
m_scoMainConnection.Close()
|
||||
m_scoMainConnection.Dispose()
|
||||
End If
|
||||
' // Remove reference.
|
||||
m_scoMainConnection = Nothing
|
||||
End If
|
||||
m_cpMainConnectionProvider = CType(Value, clsConnectionProvider)
|
||||
m_scoMainConnection = m_cpMainConnectionProvider.scoDBConnection
|
||||
m_bMainConnectionIsCreatedLocal = False
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property iErrorCode() As SqlInt32
|
||||
Get
|
||||
Return m_iErrorCode
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public Property sConnectionString() As String
|
||||
Get
|
||||
Return m_sConnectionString
|
||||
End Get
|
||||
Set (ByVal Value As String)
|
||||
m_sConnectionString = Value
|
||||
m_scoMainConnection.ConnectionString = m_sConnectionString
|
||||
End Set
|
||||
End Property
|
||||
Public Readonly Property iRowsAffected() As Integer
|
||||
Get
|
||||
Return m_iRowsAffected
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
407
BEA - Kopie/DB/Generierte Objekte/clsFunktionsgruppe.vb
Normal file
407
BEA - Kopie/DB/Generierte Objekte/clsFunktionsgruppe.vb
Normal file
@@ -0,0 +1,407 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsFunktionsgruppe
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iFunktionsgruppenr As SqlInt32
|
||||
Private m_sZugehoerigkeit, m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@szugehoerigkeit", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sZugehoerigkeit))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_funktionsgruppe_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("clsFunktionsgruppe::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@szugehoerigkeit", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sZugehoerigkeit))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_funktionsgruppe_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("clsFunktionsgruppe::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
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_funktionsgruppe_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("clsFunktionsgruppe::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("funktionsgruppe")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
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_funktionsgruppe_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iFunktionsgruppenr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionsgruppenr"), Integer))
|
||||
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)("beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("zugehoerigkeit") Is System.DBNull.Value Then
|
||||
m_sZugehoerigkeit = SqlString.Null
|
||||
Else
|
||||
m_sZugehoerigkeit = New SqlString(CType(dtToReturn.Rows(0)("zugehoerigkeit"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("funktionsgruppe")
|
||||
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_funktionsgruppe_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("clsFunktionsgruppe::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 [iFunktionsgruppenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionsgruppenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFunktionsgruppenrTmp As SqlInt32 = Value
|
||||
If iFunktionsgruppenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFunktionsgruppenr", "iFunktionsgruppenr can't be NULL")
|
||||
End If
|
||||
m_iFunktionsgruppenr = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sZugehoerigkeit]() As SqlString
|
||||
Get
|
||||
Return m_sZugehoerigkeit
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sZugehoerigkeit = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
489
BEA - Kopie/DB/Generierte Objekte/clsFunktionsgruppe_rolle.vb
Normal file
489
BEA - Kopie/DB/Generierte Objekte/clsFunktionsgruppe_rolle.vb
Normal file
@@ -0,0 +1,489 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'funktionsgruppe_rolle'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'funktionsgruppe_rolle'.
|
||||
''' </summary>
|
||||
Public Class clsFunktionsgruppe_rolle
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iFunktionsgruppenr, m_iFunktionsgrupperollenr, m_iMandantnr, m_iRollenr As SqlInt32
|
||||
|
||||
#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>iFunktionsgrupperollenr</LI>
|
||||
''' <LI>iFunktionsgruppenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.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_funktionsgruppe_rolle_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionsgrupperollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgrupperollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_funktionsgruppe_rolle_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("clsFunktionsgruppe_rolle::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' <LI>iFunktionsgruppenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_rolle_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionsgrupperollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgrupperollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_funktionsgruppe_rolle_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("clsFunktionsgruppe_rolle::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_rolle_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionsgrupperollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgrupperollenr))
|
||||
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_funktionsgruppe_rolle_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("clsFunktionsgruppe_rolle::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' <LI>iFunktionsgruppenr</LI>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_rolle_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("funktionsgruppe_rolle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iFunktionsgrupperollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgrupperollenr))
|
||||
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_funktionsgruppe_rolle_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iFunktionsgrupperollenr = New SqlInt32(CType(dtToReturn.Rows(0)("Funktionsgrupperollenr"), Integer))
|
||||
If dtToReturn.Rows(0)("funktionsgruppenr") Is System.DBNull.Value Then
|
||||
m_iFunktionsgruppenr = SqlInt32.Null
|
||||
Else
|
||||
m_iFunktionsgruppenr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionsgruppenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("rollenr") Is System.DBNull.Value Then
|
||||
m_iRollenr = SqlInt32.Null
|
||||
Else
|
||||
m_iRollenr = New SqlInt32(CType(dtToReturn.Rows(0)("rollenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe_rolle::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_funktionsgruppe_rolle_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("funktionsgruppe_rolle")
|
||||
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_funktionsgruppe_rolle_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("clsFunktionsgruppe_rolle::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 [iFunktionsgrupperollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionsgrupperollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFunktionsgrupperollenrTmp As SqlInt32 = Value
|
||||
If iFunktionsgrupperollenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFunktionsgrupperollenr", "iFunktionsgrupperollenr can't be NULL")
|
||||
End If
|
||||
m_iFunktionsgrupperollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFunktionsgruppenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionsgruppenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFunktionsgruppenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iRollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iRollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
458
BEA - Kopie/DB/Generierte Objekte/clsFunktionstelle.vb
Normal file
458
BEA - Kopie/DB/Generierte Objekte/clsFunktionstelle.vb
Normal file
@@ -0,0 +1,458 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsFunktionstelle
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iSequenz, m_iMutierer, m_iCID, m_iParentID, m_iFunktionstelleNr As SqlInt32
|
||||
Private m_sFunktionsstelle, m_sFunktionsnummer, m_sBeschreibung, m_sBezeichnung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Funktionstelle_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionstelleNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionstelleNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFunktionsnummer", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFunktionsnummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFunktionsstelle", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFunktionsstelle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iCID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iCID))
|
||||
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_Funktionstelle_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("clsFunktionstelle::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Funktionstelle_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionstelleNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionstelleNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFunktionsnummer", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFunktionsnummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFunktionsstelle", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFunktionsstelle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iCID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iCID))
|
||||
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_Funktionstelle_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("clsFunktionstelle::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Funktionstelle_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionstelleNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionstelleNr))
|
||||
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_Funktionstelle_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("clsFunktionstelle::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Funktionstelle_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Funktionstelle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iFunktionstelleNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionstelleNr))
|
||||
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_Funktionstelle_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iFunktionstelleNr = New SqlInt32(CType(dtToReturn.Rows(0)("FunktionstelleNr"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), 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)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Funktionsnummer") Is System.DBNull.Value Then
|
||||
m_sFunktionsnummer = SqlString.Null
|
||||
Else
|
||||
m_sFunktionsnummer = New SqlString(CType(dtToReturn.Rows(0)("Funktionsnummer"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Funktionsstelle") Is System.DBNull.Value Then
|
||||
m_sFunktionsstelle = SqlString.Null
|
||||
Else
|
||||
m_sFunktionsstelle = New SqlString(CType(dtToReturn.Rows(0)("Funktionsstelle"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sequenz") Is System.DBNull.Value Then
|
||||
m_iSequenz = SqlInt32.Null
|
||||
Else
|
||||
m_iSequenz = New SqlInt32(CType(dtToReturn.Rows(0)("Sequenz"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("CID") Is System.DBNull.Value Then
|
||||
m_iCID = SqlInt32.Null
|
||||
Else
|
||||
m_iCID = New SqlInt32(CType(dtToReturn.Rows(0)("CID"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionstelle::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Funktionstelle_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Funktionstelle")
|
||||
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_Funktionstelle_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("clsFunktionstelle::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 [iFunktionstelleNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionstelleNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFunktionstelleNrTmp As SqlInt32 = Value
|
||||
If iFunktionstelleNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFunktionstelleNr", "iFunktionstelleNr can't be NULL")
|
||||
End If
|
||||
m_iFunktionstelleNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFunktionsnummer]() As SqlString
|
||||
Get
|
||||
Return m_sFunktionsnummer
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFunktionsnummer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFunktionsstelle]() As SqlString
|
||||
Get
|
||||
Return m_sFunktionsstelle
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFunktionsstelle = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iCID]() As SqlInt32
|
||||
Get
|
||||
Return m_iCID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iCID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
491
BEA - Kopie/DB/Generierte Objekte/clsKey_tabelle.vb
Normal file
491
BEA - Kopie/DB/Generierte Objekte/clsKey_tabelle.vb
Normal file
@@ -0,0 +1,491 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'key_tabelle'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'key_tabelle'.
|
||||
''' </summary>
|
||||
Public Class clsKey_tabelle
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iKeynr, m_iKey_wert, m_iMandantnr As SqlInt32
|
||||
Private m_sBeschreibung 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>sBeschreibung</LI>
|
||||
''' <LI>iKey_wert</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ikey_wert", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKey_wert))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iKeynr))
|
||||
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_iKeynr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@ikeynr").Value, Integer))
|
||||
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_key_tabelle_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("clsKey_tabelle::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>iKey_wert</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKeynr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ikey_wert", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKey_wert))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_key_tabelle_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("clsKey_tabelle::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKeynr))
|
||||
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_key_tabelle_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("clsKey_tabelle::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>iKey_wert</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("key_tabelle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKeynr))
|
||||
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_key_tabelle_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iKeynr = New SqlInt32(CType(dtToReturn.Rows(0)("keynr"), Integer))
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("beschreibung"), String))
|
||||
m_iKey_wert = New SqlInt32(CType(dtToReturn.Rows(0)("key_wert"), Integer))
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsKey_tabelle::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_key_tabelle_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("key_tabelle")
|
||||
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_key_tabelle_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("clsKey_tabelle::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 [iKeynr]() As SqlInt32
|
||||
Get
|
||||
Return m_iKeynr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iKeynrTmp As SqlInt32 = Value
|
||||
If iKeynrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iKeynr", "iKeynr can't be NULL")
|
||||
End If
|
||||
m_iKeynr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
Dim sBeschreibungTmp As SqlString = Value
|
||||
If sBeschreibungTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("sBeschreibung", "sBeschreibung can't be NULL")
|
||||
End If
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iKey_wert]() As SqlInt32
|
||||
Get
|
||||
Return m_iKey_wert
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iKey_wertTmp As SqlInt32 = Value
|
||||
If iKey_wertTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iKey_wert", "iKey_wert can't be NULL")
|
||||
End If
|
||||
m_iKey_wert = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
632
BEA - Kopie/DB/Generierte Objekte/clsMeldungstexte.vb
Normal file
632
BEA - Kopie/DB/Generierte Objekte/clsMeldungstexte.vb
Normal file
@@ -0,0 +1,632 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'meldungstexte'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'meldungstexte'.
|
||||
''' </summary>
|
||||
Public Class clsMeldungstexte
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iSprache, m_iMeldungstextnr As SqlInt32
|
||||
Private m_sBeschreibung, m_sInhalt 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>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>sInhalt. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.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_meldungstexte_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sinhalt", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sInhalt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
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_meldungstexte_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("clsMeldungstexte::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>sInhalt. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sinhalt", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sInhalt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
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_meldungstexte_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("clsMeldungstexte::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
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_meldungstexte_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("clsMeldungstexte::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method using PK field 'meldungstextnr'. This method will
|
||||
''' delete one or more rows from the database, based on the Primary Key field 'meldungstextnr'.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' </UL>
|
||||
''' </remarks>
|
||||
Public Function DeleteAllWmeldungstextnrLogic() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_DeleteAllWmeldungstextnrLogic]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
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_iMeldungstextnr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@imeldungstextnr").Value, Integer))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_DeleteAllWmeldungstextnrLogic' 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("clsMeldungstexte::DeleteAllWmeldungstextnrLogic::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method using PK field 'sprache'. This method will
|
||||
''' delete one or more rows from the database, based on the Primary Key field 'sprache'.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSprache</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' </UL>
|
||||
''' </remarks>
|
||||
Public Function DeleteAllWspracheLogic() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_DeleteAllWspracheLogic]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
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_iSprache = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@isprache").Value, Integer))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_DeleteAllWspracheLogic' 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("clsMeldungstexte::DeleteAllWspracheLogic::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>sInhalt</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("meldungstexte")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
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_meldungstexte_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMeldungstextnr = New SqlInt32(CType(dtToReturn.Rows(0)("meldungstextnr"), Integer))
|
||||
m_iSprache = New SqlInt32(CType(dtToReturn.Rows(0)("sprache"), Integer))
|
||||
If dtToReturn.Rows(0)("inhalt") Is System.DBNull.Value Then
|
||||
m_sInhalt = SqlString.Null
|
||||
Else
|
||||
m_sInhalt = New SqlString(CType(dtToReturn.Rows(0)("inhalt"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMeldungstexte::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_meldungstexte_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("meldungstexte")
|
||||
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_meldungstexte_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("clsMeldungstexte::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 [iMeldungstextnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMeldungstextnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMeldungstextnrTmp As SqlInt32 = Value
|
||||
If iMeldungstextnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMeldungstextnr", "iMeldungstextnr can't be NULL")
|
||||
End If
|
||||
m_iMeldungstextnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSprache]() As SqlInt32
|
||||
Get
|
||||
Return m_iSprache
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSpracheTmp As SqlInt32 = Value
|
||||
If iSpracheTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSprache", "iSprache can't be NULL")
|
||||
End If
|
||||
m_iSprache = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sInhalt]() As SqlString
|
||||
Get
|
||||
Return m_sInhalt
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sInhalt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bAktivTmp As SqlBoolean = Value
|
||||
If bAktivTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bAktiv", "bAktiv can't be NULL")
|
||||
End If
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
530
BEA - Kopie/DB/Generierte Objekte/clsMitarbeiter.vb
Normal file
530
BEA - Kopie/DB/Generierte Objekte/clsMitarbeiter.vb
Normal file
@@ -0,0 +1,530 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'mitarbeiter'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'mitarbeiter'.
|
||||
''' </summary>
|
||||
Public Class clsMitarbeiter
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMandantnr, m_iMutierer, m_iMitarbeiternr As SqlInt32
|
||||
Private m_sEmail, m_sVorname, m_sTgnummer, m_sName 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>iMitarbeiternr</LI>
|
||||
''' <LI>sVorname. May be SqlString.Null</LI>
|
||||
''' <LI>sName. May be SqlString.Null</LI>
|
||||
''' <LI>sTgnummer. May be SqlString.Null</LI>
|
||||
''' <LI>sEmail. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.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_mitarbeiter_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@svorname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stgnummer", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@semail", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEmail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_mitarbeiter_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("clsMitarbeiter::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' <LI>sVorname. May be SqlString.Null</LI>
|
||||
''' <LI>sName. May be SqlString.Null</LI>
|
||||
''' <LI>sTgnummer. May be SqlString.Null</LI>
|
||||
''' <LI>sEmail. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@svorname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stgnummer", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@semail", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEmail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_mitarbeiter_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("clsMitarbeiter::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
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_mitarbeiter_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("clsMitarbeiter::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' <LI>sVorname</LI>
|
||||
''' <LI>sName</LI>
|
||||
''' <LI>sTgnummer</LI>
|
||||
''' <LI>sEmail</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
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_mitarbeiter_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMitarbeiternr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiternr"), Integer))
|
||||
If dtToReturn.Rows(0)("vorname") Is System.DBNull.Value Then
|
||||
m_sVorname = SqlString.Null
|
||||
Else
|
||||
m_sVorname = New SqlString(CType(dtToReturn.Rows(0)("vorname"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("name") Is System.DBNull.Value Then
|
||||
m_sName = SqlString.Null
|
||||
Else
|
||||
m_sName = New SqlString(CType(dtToReturn.Rows(0)("name"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tgnummer") Is System.DBNull.Value Then
|
||||
m_sTgnummer = SqlString.Null
|
||||
Else
|
||||
m_sTgnummer = New SqlString(CType(dtToReturn.Rows(0)("tgnummer"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("email") Is System.DBNull.Value Then
|
||||
m_sEmail = SqlString.Null
|
||||
Else
|
||||
m_sEmail = New SqlString(CType(dtToReturn.Rows(0)("email"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_mitarbeiter_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter")
|
||||
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_mitarbeiter_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("clsMitarbeiter::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 [iMitarbeiternr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMitarbeiternr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMitarbeiternrTmp As SqlInt32 = Value
|
||||
If iMitarbeiternrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMitarbeiternr", "iMitarbeiternr can't be NULL")
|
||||
End If
|
||||
m_iMitarbeiternr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sVorname]() As SqlString
|
||||
Get
|
||||
Return m_sVorname
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sVorname = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sName]() As SqlString
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTgnummer]() As SqlString
|
||||
Get
|
||||
Return m_sTgnummer
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTgnummer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sEmail]() As SqlString
|
||||
Get
|
||||
Return m_sEmail
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sEmail = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,489 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'mitarbeiter_funktionsgruppe'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'mitarbeiter_funktionsgruppe'.
|
||||
''' </summary>
|
||||
Public Class clsMitarbeiter_funktionsgruppe
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iMitarbeiternr, m_iFunktionsgruppenr, m_iMitarbeiter_funktionsgruppenr As SqlInt32
|
||||
|
||||
#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>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' <LI>iMitarbeiternr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFunktionsgruppenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.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_mitarbeiter_funktionsgruppe_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiter_funktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiter_funktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_mitarbeiter_funktionsgruppe_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("clsMitarbeiter_funktionsgruppe::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' <LI>iMitarbeiternr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFunktionsgruppenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_funktionsgruppe_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiter_funktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiter_funktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_mitarbeiter_funktionsgruppe_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("clsMitarbeiter_funktionsgruppe::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_funktionsgruppe_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiter_funktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiter_funktionsgruppenr))
|
||||
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_mitarbeiter_funktionsgruppe_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("clsMitarbeiter_funktionsgruppe::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' <LI>iFunktionsgruppenr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_funktionsgruppe_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter_funktionsgruppe")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiter_funktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiter_funktionsgruppenr))
|
||||
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_mitarbeiter_funktionsgruppe_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMitarbeiter_funktionsgruppenr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiter_funktionsgruppenr"), Integer))
|
||||
If dtToReturn.Rows(0)("mitarbeiternr") Is System.DBNull.Value Then
|
||||
m_iMitarbeiternr = SqlInt32.Null
|
||||
Else
|
||||
m_iMitarbeiternr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiternr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("funktionsgruppenr") Is System.DBNull.Value Then
|
||||
m_iFunktionsgruppenr = SqlInt32.Null
|
||||
Else
|
||||
m_iFunktionsgruppenr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionsgruppenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter_funktionsgruppe::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_mitarbeiter_funktionsgruppe_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter_funktionsgruppe")
|
||||
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_mitarbeiter_funktionsgruppe_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("clsMitarbeiter_funktionsgruppe::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 [iMitarbeiter_funktionsgruppenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMitarbeiter_funktionsgruppenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMitarbeiter_funktionsgruppenrTmp As SqlInt32 = Value
|
||||
If iMitarbeiter_funktionsgruppenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMitarbeiter_funktionsgruppenr", "iMitarbeiter_funktionsgruppenr can't be NULL")
|
||||
End If
|
||||
m_iMitarbeiter_funktionsgruppenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMitarbeiternr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMitarbeiternr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMitarbeiternr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFunktionsgruppenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionsgruppenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFunktionsgruppenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
490
BEA - Kopie/DB/Generierte Objekte/clsObjekt.vb
Normal file
490
BEA - Kopie/DB/Generierte Objekte/clsObjekt.vb
Normal file
@@ -0,0 +1,490 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Objekt'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Sonntag, 10. Februar 2013, 19:52:14
|
||||
' // 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 'Objekt'.
|
||||
''' </summary>
|
||||
Public Class clsObjekt
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iObjektnr As SqlInt32
|
||||
Private m_sDBOBject, m_sBezeichnung, m_sBeschreibung 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>iObjektnr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sDBOBject. 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_Objekt_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjektnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iObjektnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDBOBject", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDBOBject))
|
||||
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_Objekt_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("clsObjekt::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iObjektnr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sDBOBject. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Objekt_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjektnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iObjektnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDBOBject", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDBOBject))
|
||||
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_Objekt_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("clsObjekt::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iObjektnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Objekt_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjektnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iObjektnr))
|
||||
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_Objekt_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("clsObjekt::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iObjektnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iObjektnr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>sDBOBject</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Objekt_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Objekt")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iObjektnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iObjektnr))
|
||||
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_Objekt_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iObjektnr = New SqlInt32(CType(dtToReturn.Rows(0)("Objektnr"), Integer))
|
||||
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)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("DBOBject") Is System.DBNull.Value Then
|
||||
m_sDBOBject = SqlString.Null
|
||||
Else
|
||||
m_sDBOBject = New SqlString(CType(dtToReturn.Rows(0)("DBOBject"), String))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsObjekt::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_Objekt_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Objekt")
|
||||
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_Objekt_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("clsObjekt::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 [iObjektnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iObjektnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iObjektnrTmp As SqlInt32 = Value
|
||||
If iObjektnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iObjektnr", "iObjektnr can't be NULL")
|
||||
End If
|
||||
m_iObjektnr = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDBOBject]() As SqlString
|
||||
Get
|
||||
Return m_sDBOBject
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDBOBject = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
530
BEA - Kopie/DB/Generierte Objekte/clsObjektBeziehung.vb
Normal file
530
BEA - Kopie/DB/Generierte Objekte/clsObjektBeziehung.vb
Normal file
@@ -0,0 +1,530 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'ObjektBeziehung'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Mittwoch, 6. Februar 2013, 12:26:16
|
||||
' // 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 'ObjektBeziehung'.
|
||||
''' </summary>
|
||||
Public Class clsObjektBeziehung
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iObjekt_BeziehungNr, m_iObjekt1, m_iObjekt2 As SqlInt32
|
||||
Private m_sKeyField2, m_sKeyField1, m_sObjektname 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>iObjekt_BeziehungNr</LI>
|
||||
''' <LI>iObjekt1. May be SqlInt32.Null</LI>
|
||||
''' <LI>iObjekt2. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sObjektname. May be SqlString.Null</LI>
|
||||
''' <LI>sKeyField1. May be SqlString.Null</LI>
|
||||
''' <LI>sKeyField2. 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_ObjektBeziehung_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjekt_BeziehungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iObjekt_BeziehungNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjekt1", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iObjekt1))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjekt2", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iObjekt2))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sObjektname", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sObjektname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKeyField1", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKeyField1))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKeyField2", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKeyField2))
|
||||
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_ObjektBeziehung_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("clsObjektBeziehung::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iObjekt_BeziehungNr</LI>
|
||||
''' <LI>iObjekt1. May be SqlInt32.Null</LI>
|
||||
''' <LI>iObjekt2. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sObjektname. May be SqlString.Null</LI>
|
||||
''' <LI>sKeyField1. May be SqlString.Null</LI>
|
||||
''' <LI>sKeyField2. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ObjektBeziehung_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjekt_BeziehungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iObjekt_BeziehungNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjekt1", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iObjekt1))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjekt2", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iObjekt2))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sObjektname", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sObjektname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKeyField1", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKeyField1))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKeyField2", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKeyField2))
|
||||
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_ObjektBeziehung_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("clsObjektBeziehung::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iObjekt_BeziehungNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ObjektBeziehung_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iObjekt_BeziehungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iObjekt_BeziehungNr))
|
||||
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_ObjektBeziehung_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("clsObjektBeziehung::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iObjekt_BeziehungNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iObjekt_BeziehungNr</LI>
|
||||
''' <LI>iObjekt1</LI>
|
||||
''' <LI>iObjekt2</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>sObjektname</LI>
|
||||
''' <LI>sKeyField1</LI>
|
||||
''' <LI>sKeyField2</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ObjektBeziehung_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("ObjektBeziehung")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iObjekt_BeziehungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iObjekt_BeziehungNr))
|
||||
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_ObjektBeziehung_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iObjekt_BeziehungNr = New SqlInt32(CType(dtToReturn.Rows(0)("Objekt_BeziehungNr"), Integer))
|
||||
If dtToReturn.Rows(0)("Objekt1") Is System.DBNull.Value Then
|
||||
m_iObjekt1 = SqlInt32.Null
|
||||
Else
|
||||
m_iObjekt1 = New SqlInt32(CType(dtToReturn.Rows(0)("Objekt1"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Objekt2") Is System.DBNull.Value Then
|
||||
m_iObjekt2 = SqlInt32.Null
|
||||
Else
|
||||
m_iObjekt2 = New SqlInt32(CType(dtToReturn.Rows(0)("Objekt2"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Objektname") Is System.DBNull.Value Then
|
||||
m_sObjektname = SqlString.Null
|
||||
Else
|
||||
m_sObjektname = New SqlString(CType(dtToReturn.Rows(0)("Objektname"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("KeyField1") Is System.DBNull.Value Then
|
||||
m_sKeyField1 = SqlString.Null
|
||||
Else
|
||||
m_sKeyField1 = New SqlString(CType(dtToReturn.Rows(0)("KeyField1"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("KeyField2") Is System.DBNull.Value Then
|
||||
m_sKeyField2 = SqlString.Null
|
||||
Else
|
||||
m_sKeyField2 = New SqlString(CType(dtToReturn.Rows(0)("KeyField2"), String))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsObjektBeziehung::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_ObjektBeziehung_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("ObjektBeziehung")
|
||||
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_ObjektBeziehung_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("clsObjektBeziehung::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 [iObjekt_BeziehungNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iObjekt_BeziehungNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iObjekt_BeziehungNrTmp As SqlInt32 = Value
|
||||
If iObjekt_BeziehungNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iObjekt_BeziehungNr", "iObjekt_BeziehungNr can't be NULL")
|
||||
End If
|
||||
m_iObjekt_BeziehungNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iObjekt1]() As SqlInt32
|
||||
Get
|
||||
Return m_iObjekt1
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iObjekt1 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iObjekt2]() As SqlInt32
|
||||
Get
|
||||
Return m_iObjekt2
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iObjekt2 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sObjektname]() As SqlString
|
||||
Get
|
||||
Return m_sObjektname
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sObjektname = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKeyField1]() As SqlString
|
||||
Get
|
||||
Return m_sKeyField1
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKeyField1 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKeyField2]() As SqlString
|
||||
Get
|
||||
Return m_sKeyField2
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKeyField2 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
441
BEA - Kopie/DB/Generierte Objekte/clsPersonal.vb
Normal file
441
BEA - Kopie/DB/Generierte Objekte/clsPersonal.vb
Normal file
@@ -0,0 +1,441 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPersonal
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iSequenz, m_iParentID, m_iPersonalnr As SqlInt32
|
||||
Private m_sName, m_sTGNummer, m_sBeschreibung, m_sBezeichnung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Personal_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPersonalnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPersonalnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTGNummer", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTGNummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sName", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_Personal_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("clsPersonal::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Personal_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPersonalnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPersonalnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTGNummer", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTGNummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sName", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_Personal_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("clsPersonal::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Personal_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPersonalnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPersonalnr))
|
||||
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_Personal_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("clsPersonal::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Personal_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Personal")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPersonalnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPersonalnr))
|
||||
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_Personal_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPersonalnr = New SqlInt32(CType(dtToReturn.Rows(0)("Personalnr"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), 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)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("TGNummer") Is System.DBNull.Value Then
|
||||
m_sTGNummer = SqlString.Null
|
||||
Else
|
||||
m_sTGNummer = New SqlString(CType(dtToReturn.Rows(0)("TGNummer"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Name") Is System.DBNull.Value Then
|
||||
m_sName = SqlString.Null
|
||||
Else
|
||||
m_sName = New SqlString(CType(dtToReturn.Rows(0)("Name"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sequenz") Is System.DBNull.Value Then
|
||||
m_iSequenz = SqlInt32.Null
|
||||
Else
|
||||
m_iSequenz = New SqlInt32(CType(dtToReturn.Rows(0)("Sequenz"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsPersonal::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Personal_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Personal")
|
||||
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_Personal_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("clsPersonal::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 [iPersonalnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPersonalnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPersonalnrTmp As SqlInt32 = Value
|
||||
If iPersonalnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPersonalnr", "iPersonalnr can't be NULL")
|
||||
End If
|
||||
m_iPersonalnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTGNummer]() As SqlString
|
||||
Get
|
||||
Return m_sTGNummer
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTGNummer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sName]() As SqlString
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sName = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
424
BEA - Kopie/DB/Generierte Objekte/clsPlattform.vb
Normal file
424
BEA - Kopie/DB/Generierte Objekte/clsPlattform.vb
Normal file
@@ -0,0 +1,424 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPlattform
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iCID, m_iMutierer, m_iPlattformNr, m_iParentID, m_iSequenz As SqlInt32
|
||||
Private m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Plattform_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPlattformNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPlattformNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iCID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iCID))
|
||||
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_Plattform_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("clsPlattform::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Plattform_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPlattformNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPlattformNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iCID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iCID))
|
||||
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_Plattform_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("clsPlattform::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Plattform_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPlattformNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPlattformNr))
|
||||
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_Plattform_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("clsPlattform::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Plattform_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Plattform")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPlattformNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPlattformNr))
|
||||
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_Plattform_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPlattformNr = New SqlInt32(CType(dtToReturn.Rows(0)("PlattformNr"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), 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)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sequenz") Is System.DBNull.Value Then
|
||||
m_iSequenz = SqlInt32.Null
|
||||
Else
|
||||
m_iSequenz = New SqlInt32(CType(dtToReturn.Rows(0)("Sequenz"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("CID") Is System.DBNull.Value Then
|
||||
m_iCID = SqlInt32.Null
|
||||
Else
|
||||
m_iCID = New SqlInt32(CType(dtToReturn.Rows(0)("CID"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsPlattform::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Plattform_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Plattform")
|
||||
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_Plattform_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("clsPlattform::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 [iPlattformNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPlattformNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPlattformNrTmp As SqlInt32 = Value
|
||||
If iPlattformNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPlattformNr", "iPlattformNr can't be NULL")
|
||||
End If
|
||||
m_iPlattformNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iCID]() As SqlInt32
|
||||
Get
|
||||
Return m_iCID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iCID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
510
BEA - Kopie/DB/Generierte Objekte/clsRolle.vb
Normal file
510
BEA - Kopie/DB/Generierte Objekte/clsRolle.vb
Normal file
@@ -0,0 +1,510 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'rolle'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'rolle'.
|
||||
''' </summary>
|
||||
Public Class clsRolle
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bSysadminrolle, m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iRollenr, m_iMandantnr As SqlInt32
|
||||
Private m_sBeschreibung, 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>iRollenr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bSysadminrolle. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.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_rolle_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bsysadminrolle", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bSysadminrolle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_rolle_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("clsRolle::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bSysadminrolle. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bsysadminrolle", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bSysadminrolle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_rolle_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("clsRolle::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
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_rolle_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("clsRolle::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>bSysadminrolle</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("rolle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
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_rolle_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iRollenr = New SqlInt32(CType(dtToReturn.Rows(0)("rollenr"), Integer))
|
||||
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)("beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("sysadminrolle") Is System.DBNull.Value Then
|
||||
m_bSysadminrolle = SqlBoolean.Null
|
||||
Else
|
||||
m_bSysadminrolle = New SqlBoolean(CType(dtToReturn.Rows(0)("sysadminrolle"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_rolle_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("rolle")
|
||||
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_rolle_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("clsRolle::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 [iRollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iRollenrTmp As SqlInt32 = Value
|
||||
If iRollenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iRollenr", "iRollenr can't be NULL")
|
||||
End If
|
||||
m_iRollenr = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bSysadminrolle]() As SqlBoolean
|
||||
Get
|
||||
Return m_bSysadminrolle
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bSysadminrolle = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
529
BEA - Kopie/DB/Generierte Objekte/clsRolle_SecurityObject.vb
Normal file
529
BEA - Kopie/DB/Generierte Objekte/clsRolle_SecurityObject.vb
Normal file
@@ -0,0 +1,529 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Rolle_SecurityObject'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'Rolle_SecurityObject'.
|
||||
''' </summary>
|
||||
Public Class clsRolle_SecurityObject
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bReadonly, m_bAktiv, m_bInvisible As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iRollenr, m_iSecurityobjectnr, m_iRolle_securityobjectnr As SqlInt32
|
||||
|
||||
#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>iRolle_securityobjectnr</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSecurityobjectnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bReadonly. May be SqlBoolean.Null</LI>
|
||||
''' <LI>bInvisible. May be SqlBoolean.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.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_Rolle_SecurityObject_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_securityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_securityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isecurityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSecurityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@breadonly", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bReadonly))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@binvisible", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bInvisible))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
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_Rolle_SecurityObject_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("clsRolle_SecurityObject::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSecurityobjectnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bReadonly. May be SqlBoolean.Null</LI>
|
||||
''' <LI>bInvisible. May be SqlBoolean.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Rolle_SecurityObject_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_securityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_securityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isecurityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSecurityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@breadonly", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bReadonly))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@binvisible", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bInvisible))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
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_Rolle_SecurityObject_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("clsRolle_SecurityObject::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Rolle_SecurityObject_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_securityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_securityobjectnr))
|
||||
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_Rolle_SecurityObject_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("clsRolle_SecurityObject::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>iSecurityobjectnr</LI>
|
||||
''' <LI>bReadonly</LI>
|
||||
''' <LI>bInvisible</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Rolle_SecurityObject_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Rolle_SecurityObject")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@irolle_securityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_securityobjectnr))
|
||||
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_Rolle_SecurityObject_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iRolle_securityobjectnr = New SqlInt32(CType(dtToReturn.Rows(0)("rolle_securityobjectnr"), Integer))
|
||||
If dtToReturn.Rows(0)("rollenr") Is System.DBNull.Value Then
|
||||
m_iRollenr = SqlInt32.Null
|
||||
Else
|
||||
m_iRollenr = New SqlInt32(CType(dtToReturn.Rows(0)("rollenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("securityobjectnr") Is System.DBNull.Value Then
|
||||
m_iSecurityobjectnr = SqlInt32.Null
|
||||
Else
|
||||
m_iSecurityobjectnr = New SqlInt32(CType(dtToReturn.Rows(0)("securityobjectnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("readonly") Is System.DBNull.Value Then
|
||||
m_bReadonly = SqlBoolean.Null
|
||||
Else
|
||||
m_bReadonly = New SqlBoolean(CType(dtToReturn.Rows(0)("readonly"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("invisible") Is System.DBNull.Value Then
|
||||
m_bInvisible = SqlBoolean.Null
|
||||
Else
|
||||
m_bInvisible = New SqlBoolean(CType(dtToReturn.Rows(0)("invisible"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_SecurityObject::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_Rolle_SecurityObject_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Rolle_SecurityObject")
|
||||
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_Rolle_SecurityObject_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("clsRolle_SecurityObject::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 [iRolle_securityobjectnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRolle_securityobjectnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iRolle_securityobjectnrTmp As SqlInt32 = Value
|
||||
If iRolle_securityobjectnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iRolle_securityobjectnr", "iRolle_securityobjectnr can't be NULL")
|
||||
End If
|
||||
m_iRolle_securityobjectnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iRollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iRollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSecurityobjectnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSecurityobjectnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSecurityobjectnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bReadonly]() As SqlBoolean
|
||||
Get
|
||||
Return m_bReadonly
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bReadonly = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bInvisible]() As SqlBoolean
|
||||
Get
|
||||
Return m_bInvisible
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bInvisible = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
489
BEA - Kopie/DB/Generierte Objekte/clsRolle_sysadminfunktion.vb
Normal file
489
BEA - Kopie/DB/Generierte Objekte/clsRolle_sysadminfunktion.vb
Normal file
@@ -0,0 +1,489 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'rolle_sysadminfunktion'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'rolle_sysadminfunktion'.
|
||||
''' </summary>
|
||||
Public Class clsRolle_sysadminfunktion
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iRollenr, m_iMandant, m_iSysadminfnktnr, m_iRolle_sysadminfnktnr, m_iMutierer As SqlInt32
|
||||
|
||||
#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>iRolle_sysadminfnktnr</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSysadminfnktnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandant. May be SqlInt32.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_rolle_sysadminfunktion_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_sysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_sysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandant", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandant))
|
||||
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_rolle_sysadminfunktion_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("clsRolle_sysadminfunktion::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSysadminfnktnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandant. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_sysadminfunktion_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_sysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_sysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandant", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandant))
|
||||
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_rolle_sysadminfunktion_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("clsRolle_sysadminfunktion::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_sysadminfunktion_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_sysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_sysadminfnktnr))
|
||||
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_rolle_sysadminfunktion_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("clsRolle_sysadminfunktion::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>iMandant</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_sysadminfunktion_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("rolle_sysadminfunktion")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@irolle_sysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_sysadminfnktnr))
|
||||
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_rolle_sysadminfunktion_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iRolle_sysadminfnktnr = New SqlInt32(CType(dtToReturn.Rows(0)("rolle_sysadminfnktnr"), Integer))
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("sysadminfnktnr") Is System.DBNull.Value Then
|
||||
m_iSysadminfnktnr = SqlInt32.Null
|
||||
Else
|
||||
m_iSysadminfnktnr = New SqlInt32(CType(dtToReturn.Rows(0)("sysadminfnktnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("rollenr") Is System.DBNull.Value Then
|
||||
m_iRollenr = SqlInt32.Null
|
||||
Else
|
||||
m_iRollenr = New SqlInt32(CType(dtToReturn.Rows(0)("rollenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandant") Is System.DBNull.Value Then
|
||||
m_iMandant = SqlInt32.Null
|
||||
Else
|
||||
m_iMandant = New SqlInt32(CType(dtToReturn.Rows(0)("mandant"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_sysadminfunktion::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_rolle_sysadminfunktion_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("rolle_sysadminfunktion")
|
||||
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_rolle_sysadminfunktion_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("clsRolle_sysadminfunktion::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 [iRolle_sysadminfnktnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRolle_sysadminfnktnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iRolle_sysadminfnktnrTmp As SqlInt32 = Value
|
||||
If iRolle_sysadminfnktnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iRolle_sysadminfnktnr", "iRolle_sysadminfnktnr can't be NULL")
|
||||
End If
|
||||
m_iRolle_sysadminfnktnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSysadminfnktnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSysadminfnktnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSysadminfnktnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iRollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iRollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandant]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandant
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandant = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
570
BEA - Kopie/DB/Generierte Objekte/clsSecurityObject.vb
Normal file
570
BEA - Kopie/DB/Generierte Objekte/clsSecurityObject.vb
Normal file
@@ -0,0 +1,570 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'SecurityObject'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 'SecurityObject'.
|
||||
''' </summary>
|
||||
Public Class clsSecurityObject
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iLevel, m_iMutierer, m_iMandantnr, m_iSecurityObjectNr As SqlInt32
|
||||
Private m_sSecurityForm, m_sSecurityObjectDescriotion, m_sSecurityObjectItem, m_sSecurityObject, m_sSecurityObjectType 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>iSecurityObjectNr</LI>
|
||||
''' <LI>sSecurityForm. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectType. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObject. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectItem. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectDescriotion. May be SqlString.Null</LI>
|
||||
''' <LI>iLevel. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.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_SecurityObject_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSecurityObjectNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSecurityObjectNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityForm", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityForm))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectType", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectType))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObject", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObject))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectItem", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectItem))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectDescriotion", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectDescriotion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iLevel", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iLevel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
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_SecurityObject_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("clsSecurityObject::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' <LI>sSecurityForm. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectType. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObject. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectItem. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectDescriotion. May be SqlString.Null</LI>
|
||||
''' <LI>iLevel. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_SecurityObject_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSecurityObjectNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSecurityObjectNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityForm", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityForm))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectType", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectType))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObject", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObject))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectItem", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectItem))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectDescriotion", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectDescriotion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iLevel", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iLevel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
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_SecurityObject_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("clsSecurityObject::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_SecurityObject_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSecurityObjectNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSecurityObjectNr))
|
||||
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_SecurityObject_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("clsSecurityObject::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' <LI>sSecurityForm</LI>
|
||||
''' <LI>sSecurityObjectType</LI>
|
||||
''' <LI>sSecurityObject</LI>
|
||||
''' <LI>sSecurityObjectItem</LI>
|
||||
''' <LI>sSecurityObjectDescriotion</LI>
|
||||
''' <LI>iLevel</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_SecurityObject_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("SecurityObject")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iSecurityObjectNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSecurityObjectNr))
|
||||
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_SecurityObject_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iSecurityObjectNr = New SqlInt32(CType(dtToReturn.Rows(0)("SecurityObjectNr"), Integer))
|
||||
If dtToReturn.Rows(0)("SecurityForm") Is System.DBNull.Value Then
|
||||
m_sSecurityForm = SqlString.Null
|
||||
Else
|
||||
m_sSecurityForm = New SqlString(CType(dtToReturn.Rows(0)("SecurityForm"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SecurityObjectType") Is System.DBNull.Value Then
|
||||
m_sSecurityObjectType = SqlString.Null
|
||||
Else
|
||||
m_sSecurityObjectType = New SqlString(CType(dtToReturn.Rows(0)("SecurityObjectType"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SecurityObject") Is System.DBNull.Value Then
|
||||
m_sSecurityObject = SqlString.Null
|
||||
Else
|
||||
m_sSecurityObject = New SqlString(CType(dtToReturn.Rows(0)("SecurityObject"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SecurityObjectItem") Is System.DBNull.Value Then
|
||||
m_sSecurityObjectItem = SqlString.Null
|
||||
Else
|
||||
m_sSecurityObjectItem = New SqlString(CType(dtToReturn.Rows(0)("SecurityObjectItem"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SecurityObjectDescriotion") Is System.DBNull.Value Then
|
||||
m_sSecurityObjectDescriotion = SqlString.Null
|
||||
Else
|
||||
m_sSecurityObjectDescriotion = New SqlString(CType(dtToReturn.Rows(0)("SecurityObjectDescriotion"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Level") Is System.DBNull.Value Then
|
||||
m_iLevel = SqlInt32.Null
|
||||
Else
|
||||
m_iLevel = New SqlInt32(CType(dtToReturn.Rows(0)("Level"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("Mandantnr"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSecurityObject::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_SecurityObject_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("SecurityObject")
|
||||
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_SecurityObject_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("clsSecurityObject::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 [iSecurityObjectNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSecurityObjectNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSecurityObjectNrTmp As SqlInt32 = Value
|
||||
If iSecurityObjectNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSecurityObjectNr", "iSecurityObjectNr can't be NULL")
|
||||
End If
|
||||
m_iSecurityObjectNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityForm]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityForm
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityForm = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityObjectType]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityObjectType
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityObjectType = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityObject]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityObject
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityObject = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityObjectItem]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityObjectItem
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityObjectItem = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityObjectDescriotion]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityObjectDescriotion
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityObjectDescriotion = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iLevel]() As SqlInt32
|
||||
Get
|
||||
Return m_iLevel
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iLevel = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
424
BEA - Kopie/DB/Generierte Objekte/clsServer.vb
Normal file
424
BEA - Kopie/DB/Generierte Objekte/clsServer.vb
Normal file
@@ -0,0 +1,424 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsServer
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iCID, m_iMutierer, m_iServerNr, m_iParentID, m_iSequenz As SqlInt32
|
||||
Private m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Server_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iServerNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iServerNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iCID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iCID))
|
||||
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_Server_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("clsServer::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Server_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iServerNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iServerNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iCID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iCID))
|
||||
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_Server_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("clsServer::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Server_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iServerNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iServerNr))
|
||||
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_Server_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("clsServer::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Server_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Server")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iServerNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iServerNr))
|
||||
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_Server_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iServerNr = New SqlInt32(CType(dtToReturn.Rows(0)("ServerNr"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), 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)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sequenz") Is System.DBNull.Value Then
|
||||
m_iSequenz = SqlInt32.Null
|
||||
Else
|
||||
m_iSequenz = New SqlInt32(CType(dtToReturn.Rows(0)("Sequenz"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("CID") Is System.DBNull.Value Then
|
||||
m_iCID = SqlInt32.Null
|
||||
Else
|
||||
m_iCID = New SqlInt32(CType(dtToReturn.Rows(0)("CID"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsServer::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Server_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Server")
|
||||
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_Server_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("clsServer::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 [iServerNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iServerNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iServerNrTmp As SqlInt32 = Value
|
||||
If iServerNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iServerNr", "iServerNr can't be NULL")
|
||||
End If
|
||||
m_iServerNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iCID]() As SqlInt32
|
||||
Get
|
||||
Return m_iCID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iCID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
630
BEA - Kopie/DB/Generierte Objekte/clsSpalten.vb
Normal file
630
BEA - Kopie/DB/Generierte Objekte/clsSpalten.vb
Normal file
@@ -0,0 +1,630 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'spalten'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 13:15:45
|
||||
' // 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 'spalten'.
|
||||
''' </summary>
|
||||
Public Class clsSpalten
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bReadonly, m_bAlsHacken, m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMandantnr, m_iMutierer, m_iReihenfolge, m_iEintragnr, m_iBreite As SqlInt32
|
||||
Private m_sTabelle, m_sNumberFormat, m_sTiptext, m_sSpalte, m_sTabellenspalte 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>iEintragnr</LI>
|
||||
''' <LI>sTabelle. May be SqlString.Null</LI>
|
||||
''' <LI>sTabellenspalte. May be SqlString.Null</LI>
|
||||
''' <LI>sSpalte. May be SqlString.Null</LI>
|
||||
''' <LI>bReadonly</LI>
|
||||
''' <LI>bAlsHacken</LI>
|
||||
''' <LI>iBreite. May be SqlInt32.Null</LI>
|
||||
''' <LI>iReihenfolge. May be SqlInt32.Null</LI>
|
||||
''' <LI>sTiptext. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>sNumberFormat. 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_spalten_Insert]"
|
||||
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("@stabelle", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTabelle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stabellenspalte", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTabellenspalte))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sspalte", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSpalte))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bReadonly", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bReadonly))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@balsHacken", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAlsHacken))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iBreite", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBreite))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReihenfolge", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iReihenfolge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stiptext", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTiptext))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNumberFormat", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNumberFormat))
|
||||
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_spalten_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("clsSpalten::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' <LI>sTabelle. May be SqlString.Null</LI>
|
||||
''' <LI>sTabellenspalte. May be SqlString.Null</LI>
|
||||
''' <LI>sSpalte. May be SqlString.Null</LI>
|
||||
''' <LI>bReadonly</LI>
|
||||
''' <LI>bAlsHacken</LI>
|
||||
''' <LI>iBreite. May be SqlInt32.Null</LI>
|
||||
''' <LI>iReihenfolge. May be SqlInt32.Null</LI>
|
||||
''' <LI>sTiptext. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>sNumberFormat. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_spalten_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("@stabelle", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTabelle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stabellenspalte", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTabellenspalte))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sspalte", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSpalte))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bReadonly", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bReadonly))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@balsHacken", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAlsHacken))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iBreite", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBreite))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReihenfolge", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iReihenfolge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stiptext", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTiptext))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNumberFormat", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNumberFormat))
|
||||
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_spalten_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("clsSpalten::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_spalten_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.
|
||||
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_spalten_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("clsSpalten::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' <LI>sTabelle</LI>
|
||||
''' <LI>sTabellenspalte</LI>
|
||||
''' <LI>sSpalte</LI>
|
||||
''' <LI>bReadonly</LI>
|
||||
''' <LI>bAlsHacken</LI>
|
||||
''' <LI>iBreite</LI>
|
||||
''' <LI>iReihenfolge</LI>
|
||||
''' <LI>sTiptext</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>sNumberFormat</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_spalten_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("spalten")
|
||||
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_spalten_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)("tabelle") Is System.DBNull.Value Then
|
||||
m_sTabelle = SqlString.Null
|
||||
Else
|
||||
m_sTabelle = New SqlString(CType(dtToReturn.Rows(0)("tabelle"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tabellenspalte") Is System.DBNull.Value Then
|
||||
m_sTabellenspalte = SqlString.Null
|
||||
Else
|
||||
m_sTabellenspalte = New SqlString(CType(dtToReturn.Rows(0)("tabellenspalte"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("spalte") Is System.DBNull.Value Then
|
||||
m_sSpalte = SqlString.Null
|
||||
Else
|
||||
m_sSpalte = New SqlString(CType(dtToReturn.Rows(0)("spalte"), String))
|
||||
End If
|
||||
m_bReadonly = New SqlBoolean(CType(dtToReturn.Rows(0)("Readonly"), Boolean))
|
||||
m_bAlsHacken = New SqlBoolean(CType(dtToReturn.Rows(0)("alsHacken"), Boolean))
|
||||
If dtToReturn.Rows(0)("Breite") Is System.DBNull.Value Then
|
||||
m_iBreite = SqlInt32.Null
|
||||
Else
|
||||
m_iBreite = New SqlInt32(CType(dtToReturn.Rows(0)("Breite"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Reihenfolge") Is System.DBNull.Value Then
|
||||
m_iReihenfolge = SqlInt32.Null
|
||||
Else
|
||||
m_iReihenfolge = New SqlInt32(CType(dtToReturn.Rows(0)("Reihenfolge"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tiptext") Is System.DBNull.Value Then
|
||||
m_sTiptext = SqlString.Null
|
||||
Else
|
||||
m_sTiptext = New SqlString(CType(dtToReturn.Rows(0)("tiptext"), String))
|
||||
End If
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NumberFormat") Is System.DBNull.Value Then
|
||||
m_sNumberFormat = SqlString.Null
|
||||
Else
|
||||
m_sNumberFormat = New SqlString(CType(dtToReturn.Rows(0)("NumberFormat"), String))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSpalten::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_spalten_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("spalten")
|
||||
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_spalten_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("clsSpalten::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 [sTabelle]() As SqlString
|
||||
Get
|
||||
Return m_sTabelle
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTabelle = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTabellenspalte]() As SqlString
|
||||
Get
|
||||
Return m_sTabellenspalte
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTabellenspalte = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSpalte]() As SqlString
|
||||
Get
|
||||
Return m_sSpalte
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSpalte = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bReadonly]() As SqlBoolean
|
||||
Get
|
||||
Return m_bReadonly
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bReadonlyTmp As SqlBoolean = Value
|
||||
If bReadonlyTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bReadonly", "bReadonly can't be NULL")
|
||||
End If
|
||||
m_bReadonly = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAlsHacken]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAlsHacken
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bAlsHackenTmp As SqlBoolean = Value
|
||||
If bAlsHackenTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bAlsHacken", "bAlsHacken can't be NULL")
|
||||
End If
|
||||
m_bAlsHacken = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBreite]() As SqlInt32
|
||||
Get
|
||||
Return m_iBreite
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iBreite = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iReihenfolge]() As SqlInt32
|
||||
Get
|
||||
Return m_iReihenfolge
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iReihenfolge = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTiptext]() As SqlString
|
||||
Get
|
||||
Return m_sTiptext
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTiptext = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bAktivTmp As SqlBoolean = Value
|
||||
If bAktivTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bAktiv", "bAktiv can't be NULL")
|
||||
End If
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNumberFormat]() As SqlString
|
||||
Get
|
||||
Return m_sNumberFormat
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNumberFormat = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
710
BEA - Kopie/DB/Generierte Objekte/clsSysadminfunktion.vb
Normal file
710
BEA - Kopie/DB/Generierte Objekte/clsSysadminfunktion.vb
Normal file
@@ -0,0 +1,710 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'sysadminfunktion'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 18:17:09
|
||||
' // 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 'sysadminfunktion'.
|
||||
''' </summary>
|
||||
Public Class clsSysadminfunktion
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iFheight, m_iFwidth, m_iMandantnr, m_iMutierer, m_iSprache, m_iSort, m_iImageIndex, m_iSysadminfnktnr, m_iParentID, m_iFtop, m_iFleft, m_iImageIndexOpen As SqlInt32
|
||||
Private m_sKeyFields, m_sDomaintable, m_sBeschreibung, 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>iSysadminfnktnr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>iParentID. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSort. May be SqlInt32.Null</LI>
|
||||
''' <LI>iImageIndex. May be SqlInt32.Null</LI>
|
||||
''' <LI>iImageIndexOpen. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFtop. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFleft. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFwidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFheight. May be SqlInt32.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sDomaintable. May be SqlString.Null</LI>
|
||||
''' <LI>sKeyFields. 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_sysadminfunktion_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSort", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSort))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImageIndex", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImageIndex))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImageIndexOpen", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImageIndexOpen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iftop", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFtop))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifleft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFleft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifwidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFwidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifheight", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFheight))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDomaintable", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDomaintable))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKeyFields", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKeyFields))
|
||||
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_sysadminfunktion_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("clsSysadminfunktion::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>iParentID. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSort. May be SqlInt32.Null</LI>
|
||||
''' <LI>iImageIndex. May be SqlInt32.Null</LI>
|
||||
''' <LI>iImageIndexOpen. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFtop. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFleft. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFwidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFheight. May be SqlInt32.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sDomaintable. May be SqlString.Null</LI>
|
||||
''' <LI>sKeyFields. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_sysadminfunktion_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSort", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSort))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImageIndex", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImageIndex))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImageIndexOpen", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImageIndexOpen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iftop", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFtop))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifleft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFleft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifwidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFwidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifheight", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFheight))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDomaintable", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDomaintable))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKeyFields", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKeyFields))
|
||||
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_sysadminfunktion_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("clsSysadminfunktion::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_sysadminfunktion_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
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_sysadminfunktion_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("clsSysadminfunktion::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>iParentID</LI>
|
||||
''' <LI>iSort</LI>
|
||||
''' <LI>iImageIndex</LI>
|
||||
''' <LI>iImageIndexOpen</LI>
|
||||
''' <LI>iFtop</LI>
|
||||
''' <LI>iFleft</LI>
|
||||
''' <LI>iFwidth</LI>
|
||||
''' <LI>iFheight</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>sDomaintable</LI>
|
||||
''' <LI>sKeyFields</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_sysadminfunktion_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("sysadminfunktion")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
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_sysadminfunktion_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iSysadminfnktnr = New SqlInt32(CType(dtToReturn.Rows(0)("sysadminfnktnr"), Integer))
|
||||
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)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sort") Is System.DBNull.Value Then
|
||||
m_iSort = SqlInt32.Null
|
||||
Else
|
||||
m_iSort = New SqlInt32(CType(dtToReturn.Rows(0)("Sort"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ImageIndex") Is System.DBNull.Value Then
|
||||
m_iImageIndex = SqlInt32.Null
|
||||
Else
|
||||
m_iImageIndex = New SqlInt32(CType(dtToReturn.Rows(0)("ImageIndex"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ImageIndexOpen") Is System.DBNull.Value Then
|
||||
m_iImageIndexOpen = SqlInt32.Null
|
||||
Else
|
||||
m_iImageIndexOpen = New SqlInt32(CType(dtToReturn.Rows(0)("ImageIndexOpen"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ftop") Is System.DBNull.Value Then
|
||||
m_iFtop = SqlInt32.Null
|
||||
Else
|
||||
m_iFtop = New SqlInt32(CType(dtToReturn.Rows(0)("ftop"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fleft") Is System.DBNull.Value Then
|
||||
m_iFleft = SqlInt32.Null
|
||||
Else
|
||||
m_iFleft = New SqlInt32(CType(dtToReturn.Rows(0)("fleft"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fwidth") Is System.DBNull.Value Then
|
||||
m_iFwidth = SqlInt32.Null
|
||||
Else
|
||||
m_iFwidth = New SqlInt32(CType(dtToReturn.Rows(0)("fwidth"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fheight") Is System.DBNull.Value Then
|
||||
m_iFheight = SqlInt32.Null
|
||||
Else
|
||||
m_iFheight = New SqlInt32(CType(dtToReturn.Rows(0)("fheight"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("beschreibung"), String))
|
||||
End If
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
m_iSprache = New SqlInt32(CType(dtToReturn.Rows(0)("sprache"), Integer))
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Domaintable") Is System.DBNull.Value Then
|
||||
m_sDomaintable = SqlString.Null
|
||||
Else
|
||||
m_sDomaintable = New SqlString(CType(dtToReturn.Rows(0)("Domaintable"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("KeyFields") Is System.DBNull.Value Then
|
||||
m_sKeyFields = SqlString.Null
|
||||
Else
|
||||
m_sKeyFields = New SqlString(CType(dtToReturn.Rows(0)("KeyFields"), String))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSysadminfunktion::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_sysadminfunktion_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("sysadminfunktion")
|
||||
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_sysadminfunktion_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("clsSysadminfunktion::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 [iSysadminfnktnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSysadminfnktnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSysadminfnktnrTmp As SqlInt32 = Value
|
||||
If iSysadminfnktnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSysadminfnktnr", "iSysadminfnktnr can't be NULL")
|
||||
End If
|
||||
m_iSysadminfnktnr = 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 [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSort]() As SqlInt32
|
||||
Get
|
||||
Return m_iSort
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSort = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iImageIndex]() As SqlInt32
|
||||
Get
|
||||
Return m_iImageIndex
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iImageIndex = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iImageIndexOpen]() As SqlInt32
|
||||
Get
|
||||
Return m_iImageIndexOpen
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iImageIndexOpen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFtop]() As SqlInt32
|
||||
Get
|
||||
Return m_iFtop
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFtop = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFleft]() As SqlInt32
|
||||
Get
|
||||
Return m_iFleft
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFleft = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFwidth]() As SqlInt32
|
||||
Get
|
||||
Return m_iFwidth
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFwidth = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFheight]() As SqlInt32
|
||||
Get
|
||||
Return m_iFheight
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFheight = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMandantnrTmp As SqlInt32 = Value
|
||||
If iMandantnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMandantnr", "iMandantnr can't be NULL")
|
||||
End If
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSprache]() As SqlInt32
|
||||
Get
|
||||
Return m_iSprache
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSpracheTmp As SqlInt32 = Value
|
||||
If iSpracheTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSprache", "iSprache can't be NULL")
|
||||
End If
|
||||
m_iSprache = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDomaintable]() As SqlString
|
||||
Get
|
||||
Return m_sDomaintable
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDomaintable = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKeyFields]() As SqlString
|
||||
Get
|
||||
Return m_sKeyFields
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKeyFields = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
490
BEA - Kopie/DB/Generierte Objekte/clsToolTip.vb
Normal file
490
BEA - Kopie/DB/Generierte Objekte/clsToolTip.vb
Normal file
@@ -0,0 +1,490 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'ToolTip'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 14:02:28
|
||||
' // 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 'ToolTip'.
|
||||
''' </summary>
|
||||
Public Class clsToolTip
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iToolTipNr As SqlInt32
|
||||
Private m_sToolTip, m_sControlName, m_sFormularName 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>iToolTipNr</LI>
|
||||
''' <LI>sFormularName. May be SqlString.Null</LI>
|
||||
''' <LI>sControlName. May be SqlString.Null</LI>
|
||||
''' <LI>sToolTip. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.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_ToolTip_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFormularName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFormularName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sControlName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sControlName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sToolTip", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sToolTip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_ToolTip_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("clsToolTip::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' <LI>sFormularName. May be SqlString.Null</LI>
|
||||
''' <LI>sControlName. May be SqlString.Null</LI>
|
||||
''' <LI>sToolTip. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFormularName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFormularName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sControlName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sControlName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sToolTip", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sToolTip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_ToolTip_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("clsToolTip::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
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_ToolTip_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("clsToolTip::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' <LI>sFormularName</LI>
|
||||
''' <LI>sControlName</LI>
|
||||
''' <LI>sToolTip</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("ToolTip")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
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_ToolTip_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iToolTipNr = New SqlInt32(CType(dtToReturn.Rows(0)("ToolTipNr"), Integer))
|
||||
If dtToReturn.Rows(0)("FormularName") Is System.DBNull.Value Then
|
||||
m_sFormularName = SqlString.Null
|
||||
Else
|
||||
m_sFormularName = New SqlString(CType(dtToReturn.Rows(0)("FormularName"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ControlName") Is System.DBNull.Value Then
|
||||
m_sControlName = SqlString.Null
|
||||
Else
|
||||
m_sControlName = New SqlString(CType(dtToReturn.Rows(0)("ControlName"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ToolTip") Is System.DBNull.Value Then
|
||||
m_sToolTip = SqlString.Null
|
||||
Else
|
||||
m_sToolTip = New SqlString(CType(dtToReturn.Rows(0)("ToolTip"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.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_ToolTip_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("ToolTip")
|
||||
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_ToolTip_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("clsToolTip::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 [iToolTipNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iToolTipNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iToolTipNrTmp As SqlInt32 = Value
|
||||
If iToolTipNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iToolTipNr", "iToolTipNr can't be NULL")
|
||||
End If
|
||||
m_iToolTipNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFormularName]() As SqlString
|
||||
Get
|
||||
Return m_sFormularName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFormularName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sControlName]() As SqlString
|
||||
Get
|
||||
Return m_sControlName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sControlName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sToolTip]() As SqlString
|
||||
Get
|
||||
Return m_sToolTip
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sToolTip = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
407
BEA - Kopie/DB/Generierte Objekte/clsVerwaltung_durch.vb
Normal file
407
BEA - Kopie/DB/Generierte Objekte/clsVerwaltung_durch.vb
Normal file
@@ -0,0 +1,407 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsVerwaltung_durch
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iSequenz, m_iParentID, m_iVerwaltung_durchNr As SqlInt32
|
||||
Private m_sBeschreibung, m_sBezeichnung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_durch_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerwaltung_durchNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerwaltung_durchNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_Verwaltung_durch_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("clsVerwaltung_durch::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_durch_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerwaltung_durchNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerwaltung_durchNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_Verwaltung_durch_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("clsVerwaltung_durch::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_durch_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerwaltung_durchNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerwaltung_durchNr))
|
||||
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_Verwaltung_durch_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("clsVerwaltung_durch::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_durch_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Verwaltung_durch")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iVerwaltung_durchNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerwaltung_durchNr))
|
||||
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_Verwaltung_durch_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iVerwaltung_durchNr = New SqlInt32(CType(dtToReturn.Rows(0)("Verwaltung_durchNr"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), 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)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sequenz") Is System.DBNull.Value Then
|
||||
m_iSequenz = SqlInt32.Null
|
||||
Else
|
||||
m_iSequenz = New SqlInt32(CType(dtToReturn.Rows(0)("Sequenz"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsVerwaltung_durch::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_durch_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Verwaltung_durch")
|
||||
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_Verwaltung_durch_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("clsVerwaltung_durch::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 [iVerwaltung_durchNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerwaltung_durchNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iVerwaltung_durchNrTmp As SqlInt32 = Value
|
||||
If iVerwaltung_durchNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iVerwaltung_durchNr", "iVerwaltung_durchNr can't be NULL")
|
||||
End If
|
||||
m_iVerwaltung_durchNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
407
BEA - Kopie/DB/Generierte Objekte/clsVerwaltung_mit.vb
Normal file
407
BEA - Kopie/DB/Generierte Objekte/clsVerwaltung_mit.vb
Normal file
@@ -0,0 +1,407 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsVerwaltung_mit
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iSequenz, m_iParentID, m_iVerwaltung_mitNr As SqlInt32
|
||||
Private m_sBeschreibung, m_sBezeichnung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_mit_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerwaltung_mitNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerwaltung_mitNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_Verwaltung_mit_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("clsVerwaltung_mit::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_mit_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerwaltung_mitNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerwaltung_mitNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSequenz", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSequenz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
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_Verwaltung_mit_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("clsVerwaltung_mit::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_mit_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerwaltung_mitNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerwaltung_mitNr))
|
||||
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_Verwaltung_mit_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("clsVerwaltung_mit::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_mit_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Verwaltung_mit")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iVerwaltung_mitNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerwaltung_mitNr))
|
||||
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_Verwaltung_mit_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iVerwaltung_mitNr = New SqlInt32(CType(dtToReturn.Rows(0)("Verwaltung_mitNr"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), 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)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sequenz") Is System.DBNull.Value Then
|
||||
m_iSequenz = SqlInt32.Null
|
||||
Else
|
||||
m_iSequenz = New SqlInt32(CType(dtToReturn.Rows(0)("Sequenz"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsVerwaltung_mit::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verwaltung_mit_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Verwaltung_mit")
|
||||
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_Verwaltung_mit_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("clsVerwaltung_mit::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 [iVerwaltung_mitNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerwaltung_mitNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iVerwaltung_mitNrTmp As SqlInt32 = Value
|
||||
If iVerwaltung_mitNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iVerwaltung_mitNr", "iVerwaltung_mitNr can't be NULL")
|
||||
End If
|
||||
m_iVerwaltung_mitNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = 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 [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user