Initial commit
This commit is contained in:
430
EDKB09/DB/Journal/clsApplikation.vb
Normal file
430
EDKB09/DB/Journal/clsApplikation.vb
Normal file
@@ -0,0 +1,430 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Applikation'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 00:06:24
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'Applikation'.
|
||||
' /// </summary>
|
||||
Public Class clsJounralApplikation
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_sBezeichnung As SqlString
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iApplikationnr 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>sBezeichnung. May be SqlString.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>iApplikationnr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Public Overrides Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Applikation_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.Char, 10, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", 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("@iapplikationnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iApplikationnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iApplikationnr = scmCmdToExecute.Parameters.Item("@iapplikationnr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Applikation_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("clsApplikation::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>iApplikationnr</LI>
|
||||
' /// <LI>sBezeichnung. May be SqlString.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>
|
||||
Public Overrides Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Applikation_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.Char, 10, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", 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.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Applikation_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("clsApplikation::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>iApplikationnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Public Overrides Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Applikation_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Applikation_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("clsApplikation::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>iApplikationnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iApplikationnr</LI>
|
||||
' /// <LI>sBezeichnung</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>
|
||||
Public Overrides Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Applikation_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = New DataTable("Applikation")
|
||||
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationnr))
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Applikation_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iApplikationnr = New SqlInt32(CType(dtToReturn.Rows(0)("applikationnr"), 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)("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("clsApplikation::SelectOne::Error occured." + ex.Message, 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>
|
||||
Public Overrides Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Applikation_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = New DataTable("Applikation")
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Applikation_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("clsApplikation::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 [iApplikationnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iApplikationnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iApplikationnrTmp As SqlInt32 = Value
|
||||
If iApplikationnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iApplikationnr", "iApplikationnr can't be NULL")
|
||||
End If
|
||||
m_iApplikationnr = 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 [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
|
||||
453
EDKB09/DB/Journal/clsJournal.vb
Normal file
453
EDKB09/DB/Journal/clsJournal.vb
Normal file
@@ -0,0 +1,453 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Journal'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 00:06:24
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'Journal'.
|
||||
' /// </summary>
|
||||
Public Class clsJournal
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bFehlerhaft As SqlBoolean
|
||||
Private m_daEnde, m_daStart As SqlDateTime
|
||||
Private m_iJournalnr, m_iApplikationnr As SqlInt32
|
||||
Private m_sFehlerbeschreibung 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>iApplikationnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>daStart. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>daEnde. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>bFehlerhaft. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sFehlerbeschreibung. May be SqlString.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iJournalnr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Journal_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iApplikationnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dastart", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daStart))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daende", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daEnde))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bfehlerhaft", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bFehlerhaft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sfehlerbeschreibung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFehlerbeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ijournalnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iJournalnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iJournalnr = scmCmdToExecute.Parameters.Item("@ijournalnr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journal_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
|
||||
Threading.Thread.Sleep(1000)
|
||||
' MsgBox(ex.Message)
|
||||
' Throw New Exception("clsJournal::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>iJournalnr</LI>
|
||||
' /// <LI>iApplikationnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>daStart. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>daEnde. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>bFehlerhaft. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sFehlerbeschreibung. 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_Journal_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ijournalnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iJournalnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iApplikationnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dastart", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daStart))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daende", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daEnde))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bfehlerhaft", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bFehlerhaft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sfehlerbeschreibung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFehlerbeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journal_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("clsJournal::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>iJournalnr</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_Journal_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ijournalnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iJournalnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journal_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("clsJournal::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>iJournalnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iJournalnr</LI>
|
||||
' /// <LI>iApplikationnr</LI>
|
||||
' /// <LI>daStart</LI>
|
||||
' /// <LI>daEnde</LI>
|
||||
' /// <LI>bFehlerhaft</LI>
|
||||
' /// <LI>sFehlerbeschreibung</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_Journal_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Journal")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ijournalnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iJournalnr))
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journal_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iJournalnr = New SqlInt32(CType(dtToReturn.Rows(0)("journalnr"), Integer))
|
||||
If dtToReturn.Rows(0)("applikationnr") Is System.DBNull.Value Then
|
||||
m_iApplikationnr = SqlInt32.Null
|
||||
Else
|
||||
m_iApplikationnr = New SqlInt32(CType(dtToReturn.Rows(0)("applikationnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("start") Is System.DBNull.Value Then
|
||||
m_daStart = SqlDateTime.Null
|
||||
Else
|
||||
m_daStart = New SqlDateTime(CType(dtToReturn.Rows(0)("start"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ende") Is System.DBNull.Value Then
|
||||
m_daEnde = SqlDateTime.Null
|
||||
Else
|
||||
m_daEnde = New SqlDateTime(CType(dtToReturn.Rows(0)("ende"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fehlerhaft") Is System.DBNull.Value Then
|
||||
m_bFehlerhaft = SqlBoolean.Null
|
||||
Else
|
||||
m_bFehlerhaft = New SqlBoolean(CType(dtToReturn.Rows(0)("fehlerhaft"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fehlerbeschreibung") Is System.DBNull.Value Then
|
||||
m_sFehlerbeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sFehlerbeschreibung = New SqlString(CType(dtToReturn.Rows(0)("fehlerbeschreibung"), 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("clsJournal::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_Journal_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Journal")
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journal_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("clsJournal::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 [iJournalnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iJournalnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iJournalnrTmp As SqlInt32 = Value
|
||||
If iJournalnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iJournalnr", "iJournalnr can't be NULL")
|
||||
End If
|
||||
m_iJournalnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iApplikationnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iApplikationnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iApplikationnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daStart]() As SqlDateTime
|
||||
Get
|
||||
Return m_daStart
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daStart = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daEnde]() As SqlDateTime
|
||||
Get
|
||||
Return m_daEnde
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daEnde = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bFehlerhaft]() As SqlBoolean
|
||||
Get
|
||||
Return m_bFehlerhaft
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bFehlerhaft = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFehlerbeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sFehlerbeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFehlerbeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
410
EDKB09/DB/Journal/clsJournaleintrag.vb
Normal file
410
EDKB09/DB/Journal/clsJournaleintrag.vb
Normal file
@@ -0,0 +1,410 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Journaleintrag'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 09:14:59
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'Journaleintrag'.
|
||||
' /// </summary>
|
||||
Public Class clsJournaleintrag
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_daDatumzeit As SqlDateTime
|
||||
Private m_iJournalnr, m_iJournaleintragnr As SqlInt32
|
||||
Private m_sEintrag 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>iJournalnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sEintrag. May be SqlString.Null</LI>
|
||||
' /// <LI>daDatumzeit. May be SqlDateTime.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iJournaleintragnr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Journaleintrag_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ijournalnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iJournalnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@seintrag", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEintrag))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dadatumzeit", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daDatumzeit))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ijournaleintragnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iJournaleintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iJournaleintragnr = scmCmdToExecute.Parameters.Item("@ijournaleintragnr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journaleintrag_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("clsJournaleintrag::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>iJournaleintragnr</LI>
|
||||
' /// <LI>iJournalnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sEintrag. May be SqlString.Null</LI>
|
||||
' /// <LI>daDatumzeit. May be SqlDateTime.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_Journaleintrag_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ijournaleintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iJournaleintragnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ijournalnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iJournalnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@seintrag", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEintrag))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dadatumzeit", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daDatumzeit))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journaleintrag_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("clsJournaleintrag::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>iJournaleintragnr</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_Journaleintrag_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ijournaleintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iJournaleintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journaleintrag_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("clsJournaleintrag::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>iJournaleintragnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iJournaleintragnr</LI>
|
||||
' /// <LI>iJournalnr</LI>
|
||||
' /// <LI>sEintrag</LI>
|
||||
' /// <LI>daDatumzeit</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_Journaleintrag_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Journaleintrag")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ijournaleintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iJournaleintragnr))
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journaleintrag_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iJournaleintragnr = New SqlInt32(CType(dtToReturn.Rows(0)("journaleintragnr"), Integer))
|
||||
If dtToReturn.Rows(0)("journalnr") Is System.DBNull.Value Then
|
||||
m_iJournalnr = SqlInt32.Null
|
||||
Else
|
||||
m_iJournalnr = New SqlInt32(CType(dtToReturn.Rows(0)("journalnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("eintrag") Is System.DBNull.Value Then
|
||||
m_sEintrag = SqlString.Null
|
||||
Else
|
||||
m_sEintrag = New SqlString(CType(dtToReturn.Rows(0)("eintrag"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("datumzeit") Is System.DBNull.Value Then
|
||||
m_daDatumzeit = SqlDateTime.Null
|
||||
Else
|
||||
m_daDatumzeit = New SqlDateTime(CType(dtToReturn.Rows(0)("datumzeit"), Date))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsJournaleintrag::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_Journaleintrag_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Journaleintrag")
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Journaleintrag_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("clsJournaleintrag::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 [iJournaleintragnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iJournaleintragnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iJournaleintragnrTmp As SqlInt32 = Value
|
||||
If iJournaleintragnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iJournaleintragnr", "iJournaleintragnr can't be NULL")
|
||||
End If
|
||||
m_iJournaleintragnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iJournalnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iJournalnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iJournalnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sEintrag]() As SqlString
|
||||
Get
|
||||
Return m_sEintrag
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sEintrag = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daDatumzeit]() As SqlDateTime
|
||||
Get
|
||||
Return m_daDatumzeit
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daDatumzeit = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
1222
EDKB09/DB/clsApplikation.vb
Normal file
1222
EDKB09/DB/clsApplikation.vb
Normal file
File diff suppressed because it is too large
Load Diff
289
EDKB09/DB/clsConnectionProvider.vb
Normal file
289
EDKB09/DB/clsConnectionProvider.vb
Normal file
@@ -0,0 +1,289 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Connection Provider class for Database connection sharing
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 00:06:25
|
||||
' // This class implements IDisposable.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Collections
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: provides a SqlConnection object which can be shared among data-access tier objects
|
||||
' /// to provide a way to do ADO.NET transaction coding without the hassling with SqlConnection objects
|
||||
' /// on a high level.
|
||||
' /// </summary>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the IDispose' method Dispose.
|
||||
' /// </summary>
|
||||
Overloads Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the Dispose functionality.
|
||||
' /// </summary>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Initializes class members.
|
||||
' /// </summary>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Opens the connection object.
|
||||
' /// </summary>
|
||||
' /// <returns>True, if succeeded, otherwise an Exception exception is thrown.</returns>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Starts a new ADO.NET transaction using the open connection object of this class.
|
||||
' /// </summary>
|
||||
' /// <param name="sTransactionName">Name of the transaction to start</param>
|
||||
' /// <returns>True, if transaction is started correctly, otherwise an Exception exception is thrown</returns>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Commits a pending transaction on the open connection object of this class.
|
||||
' /// </summary>
|
||||
' /// <returns>True, if commit was succesful, or an Exception exception is thrown</returns>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Rolls back a pending transaction on the open connection object of this class,
|
||||
' /// or rolls back to the savepoint with the given name. Savepoints are created with SaveTransaction().
|
||||
' /// </summary>
|
||||
' /// <param name="sTransactionToRollback">Name of transaction to roll back. Can be name of savepoint</param>
|
||||
' /// <returns>True, if rollback was succesful, or an Exception exception is thrown</returns>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Saves a pending transaction on the open connection object of this class to a 'savepoint'
|
||||
' /// with the given name.
|
||||
' /// When a rollback is issued, the caller can rollback to this savepoint or roll back the complete transaction.
|
||||
' /// </summary>
|
||||
' /// <param name="sSavePointName">Name of the savepoint to store the current transaction under.</param>
|
||||
' /// <returns>True, if save was succesful, or an Exception exception is thrown</returns>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Closes the open connection. Depending on bCommitPendingTransactions, a pending
|
||||
' /// transaction is commited, or aborted.
|
||||
' /// </summary>
|
||||
' /// <param name="bCommitPendingTransaction">Flag for what to do when a transaction is still pending. True
|
||||
' /// will commit the current transaction, False will abort (rollback) the complete current transaction.</param>
|
||||
' /// <returns>True, if close was succesful, False if connection was already closed, or an Exception exception is thrown when
|
||||
' /// an error occurs</returns>
|
||||
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
|
||||
202
EDKB09/DB/clsDBInteractionBase.vb
Normal file
202
EDKB09/DB/clsDBInteractionBase.vb
Normal file
@@ -0,0 +1,202 @@
|
||||
' //////////////////////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Base class for Database Interaction.
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 00:06:25
|
||||
' // Because this class implements IDisposable, derived classes shouldn't do so.
|
||||
' //////////////////////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Error Enums used by this LLBL library.
|
||||
' /// </summary>
|
||||
Public Enum LLBLError
|
||||
AllOk
|
||||
' // Add more here (check the comma's!)
|
||||
End Enum
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: General interface of the API generated. Contains only common methods of all classes.
|
||||
' /// </summary>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Abstract base class for Database Interaction classes.
|
||||
' /// </summary>
|
||||
Public MustInherit Class clsDBInteractionBase
|
||||
Implements IDisposable
|
||||
Implements ICommonDBAccess
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Protected m_scoMainConnection As SqlConnection
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Class constructor.
|
||||
' /// </summary>
|
||||
Public Sub New()
|
||||
' // Initialize the class' members.
|
||||
InitClass()
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Initializes class members.
|
||||
' /// </summary>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the IDispose' method Dispose.
|
||||
' /// </summary>
|
||||
Overloads Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the Dispose functionality.
|
||||
' /// </summary>
|
||||
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
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Insert() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Insert() As Boolean Implements ICommonDBAccess.Insert
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Delete() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Delete() As Boolean Implements ICommonDBAccess.Delete
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Update() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Update() As Boolean Implements ICommonDBAccess.Update
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.SelectOne() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function SelectOne() As DataTable Implements ICommonDBAccess.SelectOne
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.SelectAll() method.
|
||||
' /// </summary>
|
||||
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
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
1890
EDKB09/DB/clsDokument.vb
Normal file
1890
EDKB09/DB/clsDokument.vb
Normal file
File diff suppressed because it is too large
Load Diff
1430
EDKB09/DB/clsDokumenttyp.vb
Normal file
1430
EDKB09/DB/clsDokumenttyp.vb
Normal file
File diff suppressed because it is too large
Load Diff
891
EDKB09/DB/clsEdex_sb_serienbrief.vb
Normal file
891
EDKB09/DB/clsEdex_sb_serienbrief.vb
Normal file
@@ -0,0 +1,891 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'edex_sb_serienbrief'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Montag, 13. September 2010, 16:18:43
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'edex_sb_serienbrief'.
|
||||
''' </summary>
|
||||
Public Class clsEdex_sb_serienbrief
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daArchivdatum, m_daTermin, m_daDokumentdatum, m_daMutiert_am As SqlDateTime
|
||||
Private m_iDokumenttypnr, m_iWindowheight, m_iWindowwidth, m_iTreewidth, m_iBestaetigt, m_iAusgeloest, m_iBldossier, m_iGedruckt, m_iFehlerhaft, m_iInBearbeitung, m_iErstellt, m_iUnterschriftlinks, m_iUnterschriftrechts, m_iZustaendig, m_iVerantwortlich, m_iPostzustellung, m_iMutierer, m_iStatus, m_iSerienbriefnr, m_iTeam As SqlInt32
|
||||
Private m_sBezeichnung, m_sBemerkung 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>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>iVerantwortlich. May be SqlInt32.Null</LI>
|
||||
''' <LI>iPostzustellung. May be SqlInt32.Null</LI>
|
||||
''' <LI>daDokumentdatum. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iZustaendig. May be SqlInt32.Null</LI>
|
||||
''' <LI>iUnterschriftlinks. May be SqlInt32.Null</LI>
|
||||
''' <LI>iUnterschriftrechts. May be SqlInt32.Null</LI>
|
||||
''' <LI>iTeam. May be SqlInt32.Null</LI>
|
||||
''' <LI>daArchivdatum. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daTermin. May be SqlDateTime.Null</LI>
|
||||
''' <LI>sBemerkung. May be SqlString.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>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iStatus. May be SqlInt32.Null</LI>
|
||||
''' <LI>iDokumenttypnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iWindowwidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iWindowheight. May be SqlInt32.Null</LI>
|
||||
''' <LI>iTreewidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFehlerhaft. May be SqlInt32.Null</LI>
|
||||
''' <LI>iInBearbeitung. May be SqlInt32.Null</LI>
|
||||
''' <LI>iErstellt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iGedruckt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iBestaetigt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iAusgeloest. May be SqlInt32.Null</LI>
|
||||
''' <LI>iBldossier. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iSerienbriefnr</LI>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edex_sb_serienbrief_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iverantwortlich", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlich))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ipostzustellung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPostzustellung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dadokumentdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daDokumentdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@izustaendig", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iZustaendig))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iunterschriftlinks", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iUnterschriftlinks))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iunterschriftrechts", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iUnterschriftrechts))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iteam", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTeam))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daarchivdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daArchivdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@datermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbemerkung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBemerkung))
|
||||
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("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@idokumenttypnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iDokumenttypnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iwindowwidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWindowwidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iwindowheight", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWindowheight))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@itreewidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTreewidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifehlerhaft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFehlerhaft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iinBearbeitung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iInBearbeitung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ierstellt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iErstellt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@igedruckt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iGedruckt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibestaetigt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBestaetigt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iausgeloest", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAusgeloest))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibldossier", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBldossier))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iserienbriefnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iSerienbriefnr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iserienbriefnr").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_edex_sb_serienbrief_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("clsEdex_sb_serienbrief::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>iSerienbriefnr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>iVerantwortlich. May be SqlInt32.Null</LI>
|
||||
''' <LI>iPostzustellung. May be SqlInt32.Null</LI>
|
||||
''' <LI>daDokumentdatum. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iZustaendig. May be SqlInt32.Null</LI>
|
||||
''' <LI>iUnterschriftlinks. May be SqlInt32.Null</LI>
|
||||
''' <LI>iUnterschriftrechts. May be SqlInt32.Null</LI>
|
||||
''' <LI>iTeam. May be SqlInt32.Null</LI>
|
||||
''' <LI>daArchivdatum. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daTermin. May be SqlDateTime.Null</LI>
|
||||
''' <LI>sBemerkung. May be SqlString.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>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iStatus. May be SqlInt32.Null</LI>
|
||||
''' <LI>iDokumenttypnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iWindowwidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iWindowheight. May be SqlInt32.Null</LI>
|
||||
''' <LI>iTreewidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFehlerhaft. May be SqlInt32.Null</LI>
|
||||
''' <LI>iInBearbeitung. May be SqlInt32.Null</LI>
|
||||
''' <LI>iErstellt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iGedruckt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iBestaetigt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iAusgeloest. May be SqlInt32.Null</LI>
|
||||
''' <LI>iBldossier. 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_edex_sb_serienbrief_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iserienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iverantwortlich", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlich))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ipostzustellung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPostzustellung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dadokumentdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daDokumentdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@izustaendig", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iZustaendig))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iunterschriftlinks", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iUnterschriftlinks))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iunterschriftrechts", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iUnterschriftrechts))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iteam", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTeam))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daarchivdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daArchivdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@datermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbemerkung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBemerkung))
|
||||
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("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@idokumenttypnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iDokumenttypnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iwindowwidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWindowwidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iwindowheight", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWindowheight))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@itreewidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTreewidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifehlerhaft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFehlerhaft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iinBearbeitung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iInBearbeitung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ierstellt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iErstellt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@igedruckt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iGedruckt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibestaetigt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBestaetigt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iausgeloest", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAusgeloest))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibldossier", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBldossier))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edex_sb_serienbrief_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("clsEdex_sb_serienbrief::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>iSerienbriefnr</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_edex_sb_serienbrief_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iserienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edex_sb_serienbrief_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("clsEdex_sb_serienbrief::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>iSerienbriefnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iSerienbriefnr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>iVerantwortlich</LI>
|
||||
''' <LI>iPostzustellung</LI>
|
||||
''' <LI>daDokumentdatum</LI>
|
||||
''' <LI>iZustaendig</LI>
|
||||
''' <LI>iUnterschriftlinks</LI>
|
||||
''' <LI>iUnterschriftrechts</LI>
|
||||
''' <LI>iTeam</LI>
|
||||
''' <LI>daArchivdatum</LI>
|
||||
''' <LI>daTermin</LI>
|
||||
''' <LI>sBemerkung</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>iStatus</LI>
|
||||
''' <LI>iDokumenttypnr</LI>
|
||||
''' <LI>iWindowwidth</LI>
|
||||
''' <LI>iWindowheight</LI>
|
||||
''' <LI>iTreewidth</LI>
|
||||
''' <LI>iFehlerhaft</LI>
|
||||
''' <LI>iInBearbeitung</LI>
|
||||
''' <LI>iErstellt</LI>
|
||||
''' <LI>iGedruckt</LI>
|
||||
''' <LI>iBestaetigt</LI>
|
||||
''' <LI>iAusgeloest</LI>
|
||||
''' <LI>iBldossier</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_edex_sb_serienbrief_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("edex_sb_serienbrief")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iserienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
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_edex_sb_serienbrief_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iSerienbriefnr = New SqlInt32(CType(dtToReturn.Rows(0)("serienbriefnr"), 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)("verantwortlich") Is System.DBNull.Value Then
|
||||
m_iVerantwortlich = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortlich = New SqlInt32(CType(dtToReturn.Rows(0)("verantwortlich"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("postzustellung") Is System.DBNull.Value Then
|
||||
m_iPostzustellung = SqlInt32.Null
|
||||
Else
|
||||
m_iPostzustellung = New SqlInt32(CType(dtToReturn.Rows(0)("postzustellung"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dokumentdatum") Is System.DBNull.Value Then
|
||||
m_daDokumentdatum = SqlDateTime.Null
|
||||
Else
|
||||
m_daDokumentdatum = New SqlDateTime(CType(dtToReturn.Rows(0)("dokumentdatum"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("zustaendig") Is System.DBNull.Value Then
|
||||
m_iZustaendig = SqlInt32.Null
|
||||
Else
|
||||
m_iZustaendig = New SqlInt32(CType(dtToReturn.Rows(0)("zustaendig"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("unterschriftlinks") Is System.DBNull.Value Then
|
||||
m_iUnterschriftlinks = SqlInt32.Null
|
||||
Else
|
||||
m_iUnterschriftlinks = New SqlInt32(CType(dtToReturn.Rows(0)("unterschriftlinks"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("unterschriftrechts") Is System.DBNull.Value Then
|
||||
m_iUnterschriftrechts = SqlInt32.Null
|
||||
Else
|
||||
m_iUnterschriftrechts = New SqlInt32(CType(dtToReturn.Rows(0)("unterschriftrechts"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("team") Is System.DBNull.Value Then
|
||||
m_iTeam = SqlInt32.Null
|
||||
Else
|
||||
m_iTeam = New SqlInt32(CType(dtToReturn.Rows(0)("team"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("archivdatum") Is System.DBNull.Value Then
|
||||
m_daArchivdatum = SqlDateTime.Null
|
||||
Else
|
||||
m_daArchivdatum = New SqlDateTime(CType(dtToReturn.Rows(0)("archivdatum"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("termin") Is System.DBNull.Value Then
|
||||
m_daTermin = SqlDateTime.Null
|
||||
Else
|
||||
m_daTermin = New SqlDateTime(CType(dtToReturn.Rows(0)("termin"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("bemerkung") Is System.DBNull.Value Then
|
||||
m_sBemerkung = SqlString.Null
|
||||
Else
|
||||
m_sBemerkung = New SqlString(CType(dtToReturn.Rows(0)("bemerkung"), String))
|
||||
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)("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)("status") Is System.DBNull.Value Then
|
||||
m_iStatus = SqlInt32.Null
|
||||
Else
|
||||
m_iStatus = New SqlInt32(CType(dtToReturn.Rows(0)("status"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dokumenttypnr") Is System.DBNull.Value Then
|
||||
m_iDokumenttypnr = SqlInt32.Null
|
||||
Else
|
||||
m_iDokumenttypnr = New SqlInt32(CType(dtToReturn.Rows(0)("dokumenttypnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("windowwidth") Is System.DBNull.Value Then
|
||||
m_iWindowwidth = SqlInt32.Null
|
||||
Else
|
||||
m_iWindowwidth = New SqlInt32(CType(dtToReturn.Rows(0)("windowwidth"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("windowheight") Is System.DBNull.Value Then
|
||||
m_iWindowheight = SqlInt32.Null
|
||||
Else
|
||||
m_iWindowheight = New SqlInt32(CType(dtToReturn.Rows(0)("windowheight"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("treewidth") Is System.DBNull.Value Then
|
||||
m_iTreewidth = SqlInt32.Null
|
||||
Else
|
||||
m_iTreewidth = New SqlInt32(CType(dtToReturn.Rows(0)("treewidth"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fehlerhaft") Is System.DBNull.Value Then
|
||||
m_iFehlerhaft = SqlInt32.Null
|
||||
Else
|
||||
m_iFehlerhaft = New SqlInt32(CType(dtToReturn.Rows(0)("fehlerhaft"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("inBearbeitung") Is System.DBNull.Value Then
|
||||
m_iInBearbeitung = SqlInt32.Null
|
||||
Else
|
||||
m_iInBearbeitung = New SqlInt32(CType(dtToReturn.Rows(0)("inBearbeitung"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt") Is System.DBNull.Value Then
|
||||
m_iErstellt = SqlInt32.Null
|
||||
Else
|
||||
m_iErstellt = New SqlInt32(CType(dtToReturn.Rows(0)("erstellt"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("gedruckt") Is System.DBNull.Value Then
|
||||
m_iGedruckt = SqlInt32.Null
|
||||
Else
|
||||
m_iGedruckt = New SqlInt32(CType(dtToReturn.Rows(0)("gedruckt"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("bestaetigt") Is System.DBNull.Value Then
|
||||
m_iBestaetigt = SqlInt32.Null
|
||||
Else
|
||||
m_iBestaetigt = New SqlInt32(CType(dtToReturn.Rows(0)("bestaetigt"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ausgeloest") Is System.DBNull.Value Then
|
||||
m_iAusgeloest = SqlInt32.Null
|
||||
Else
|
||||
m_iAusgeloest = New SqlInt32(CType(dtToReturn.Rows(0)("ausgeloest"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("bldossier") Is System.DBNull.Value Then
|
||||
m_iBldossier = SqlInt32.Null
|
||||
Else
|
||||
m_iBldossier = New SqlInt32(CType(dtToReturn.Rows(0)("bldossier"), 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("clsEdex_sb_serienbrief::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_edex_sb_serienbrief_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("edex_sb_serienbrief")
|
||||
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_edex_sb_serienbrief_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("clsEdex_sb_serienbrief::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 [iSerienbriefnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSerienbriefnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSerienbriefnrTmp As SqlInt32 = Value
|
||||
If iSerienbriefnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSerienbriefnr", "iSerienbriefnr can't be NULL")
|
||||
End If
|
||||
m_iSerienbriefnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortlich]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortlich
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortlich = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPostzustellung]() As SqlInt32
|
||||
Get
|
||||
Return m_iPostzustellung
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPostzustellung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daDokumentdatum]() As SqlDateTime
|
||||
Get
|
||||
Return m_daDokumentdatum
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daDokumentdatum = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iZustaendig]() As SqlInt32
|
||||
Get
|
||||
Return m_iZustaendig
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iZustaendig = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iUnterschriftlinks]() As SqlInt32
|
||||
Get
|
||||
Return m_iUnterschriftlinks
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iUnterschriftlinks = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iUnterschriftrechts]() As SqlInt32
|
||||
Get
|
||||
Return m_iUnterschriftrechts
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iUnterschriftrechts = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iTeam]() As SqlInt32
|
||||
Get
|
||||
Return m_iTeam
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iTeam = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daArchivdatum]() As SqlDateTime
|
||||
Get
|
||||
Return m_daArchivdatum
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daArchivdatum = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daTermin]() As SqlDateTime
|
||||
Get
|
||||
Return m_daTermin
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daTermin = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBemerkung]() As SqlString
|
||||
Get
|
||||
Return m_sBemerkung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBemerkung = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iStatus]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatus
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iStatus = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iDokumenttypnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iDokumenttypnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iDokumenttypnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iWindowwidth]() As SqlInt32
|
||||
Get
|
||||
Return m_iWindowwidth
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iWindowwidth = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iWindowheight]() As SqlInt32
|
||||
Get
|
||||
Return m_iWindowheight
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iWindowheight = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iTreewidth]() As SqlInt32
|
||||
Get
|
||||
Return m_iTreewidth
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iTreewidth = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFehlerhaft]() As SqlInt32
|
||||
Get
|
||||
Return m_iFehlerhaft
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFehlerhaft = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iInBearbeitung]() As SqlInt32
|
||||
Get
|
||||
Return m_iInBearbeitung
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iInBearbeitung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iErstellt]() As SqlInt32
|
||||
Get
|
||||
Return m_iErstellt
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iErstellt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iGedruckt]() As SqlInt32
|
||||
Get
|
||||
Return m_iGedruckt
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iGedruckt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBestaetigt]() As SqlInt32
|
||||
Get
|
||||
Return m_iBestaetigt
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iBestaetigt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iAusgeloest]() As SqlInt32
|
||||
Get
|
||||
Return m_iAusgeloest
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAusgeloest = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBldossier]() As SqlInt32
|
||||
Get
|
||||
Return m_iBldossier
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iBldossier = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
910
EDKB09/DB/clsMitarbeiter.vb
Normal file
910
EDKB09/DB/clsMitarbeiter.vb
Normal file
@@ -0,0 +1,910 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'mitarbeiter'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 10. August 2003, 23:09:05
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'mitarbeiter'.
|
||||
' /// </summary>
|
||||
Public Class clsMitarbeiter
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bMailempfang, m_bEdokaMesasge, m_bShowtip, m_bAktiv, m_bMailDirektVersenden, m_bEdoka_mail, m_bJournalisierung, m_bMailDokumentrueckgang As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iPartnernr, m_iKlassifizierung, m_iMutierer, m_iMandantnr, m_iFunktionnr, m_iMitarbeiternr, m_iFuermandant, m_iSprache As SqlInt32
|
||||
Private m_sRang, m_sAnrede, m_sKurzzeichen, m_sVorname, m_sName, m_sFax, m_sTelefon, m_sUnterschrift_text, m_sFunktion, m_sTgnummer, m_sEmail 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>sKurzzeichen. May be SqlString.Null</LI>
|
||||
' /// <LI>sAnrede. May be SqlString.Null</LI>
|
||||
' /// <LI>sTgnummer. May be SqlString.Null</LI>
|
||||
' /// <LI>sEmail. May be SqlString.Null</LI>
|
||||
' /// <LI>sFax. May be SqlString.Null</LI>
|
||||
' /// <LI>sTelefon. May be SqlString.Null</LI>
|
||||
' /// <LI>sUnterschrift_text. May be SqlString.Null</LI>
|
||||
' /// <LI>iFunktionnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iSprache. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iFuermandant</LI>
|
||||
' /// <LI>bShowtip</LI>
|
||||
' /// <LI>iPartnernr</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>bMailempfang. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bEdokaMesasge. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sFunktion. May be SqlString.Null</LI>
|
||||
' /// <LI>bMailDirektVersenden. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sRang. May be SqlString.Null</LI>
|
||||
' /// <LI>bMailDokumentrueckgang. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>iKlassifizierung. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bEdoka_mail. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bJournalisierung. May be SqlBoolean.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("@skurzzeichen", SqlDbType.VarChar, 10, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzzeichen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sanrede", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sAnrede))
|
||||
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("@sfax", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFax))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stelefon", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTelefon))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sunterschrift_text", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sUnterschrift_text))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifuermandant", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFuermandant))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bshowtip", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bShowtip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ipartnernr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr))
|
||||
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, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", 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("@bMailempfang", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailempfang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bEdokaMesasge", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bEdokaMesasge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sfunktion", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFunktion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailDirektVersenden", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailDirektVersenden))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sRang", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sRang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailDokumentrueckgang", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailDokumentrueckgang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iklassifizierung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKlassifizierung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bedoka_mail", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bEdoka_mail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bjournalisierung", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bJournalisierung))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
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>sKurzzeichen. May be SqlString.Null</LI>
|
||||
' /// <LI>sAnrede. May be SqlString.Null</LI>
|
||||
' /// <LI>sTgnummer. May be SqlString.Null</LI>
|
||||
' /// <LI>sEmail. May be SqlString.Null</LI>
|
||||
' /// <LI>sFax. May be SqlString.Null</LI>
|
||||
' /// <LI>sTelefon. May be SqlString.Null</LI>
|
||||
' /// <LI>sUnterschrift_text. May be SqlString.Null</LI>
|
||||
' /// <LI>iFunktionnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iSprache. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iFuermandant</LI>
|
||||
' /// <LI>bShowtip</LI>
|
||||
' /// <LI>iPartnernr</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>bMailempfang. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bEdokaMesasge. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sFunktion. May be SqlString.Null</LI>
|
||||
' /// <LI>bMailDirektVersenden. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sRang. May be SqlString.Null</LI>
|
||||
' /// <LI>bMailDokumentrueckgang. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>iKlassifizierung. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bEdoka_mail. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bJournalisierung. May be SqlBoolean.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("@skurzzeichen", SqlDbType.VarChar, 10, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzzeichen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sanrede", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sAnrede))
|
||||
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("@sfax", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFax))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stelefon", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTelefon))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sunterschrift_text", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sUnterschrift_text))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifuermandant", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFuermandant))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bshowtip", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bShowtip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ipartnernr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr))
|
||||
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, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", 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("@bMailempfang", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailempfang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bEdokaMesasge", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bEdokaMesasge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sfunktion", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFunktion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailDirektVersenden", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailDirektVersenden))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sRang", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sRang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailDokumentrueckgang", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailDokumentrueckgang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iklassifizierung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKlassifizierung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bedoka_mail", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bEdoka_mail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bjournalisierung", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bJournalisierung))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
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.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
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>sKurzzeichen</LI>
|
||||
' /// <LI>sAnrede</LI>
|
||||
' /// <LI>sTgnummer</LI>
|
||||
' /// <LI>sEmail</LI>
|
||||
' /// <LI>sFax</LI>
|
||||
' /// <LI>sTelefon</LI>
|
||||
' /// <LI>sUnterschrift_text</LI>
|
||||
' /// <LI>iFunktionnr</LI>
|
||||
' /// <LI>iSprache</LI>
|
||||
' /// <LI>iFuermandant</LI>
|
||||
' /// <LI>bShowtip</LI>
|
||||
' /// <LI>iPartnernr</LI>
|
||||
' /// <LI>iMandantnr</LI>
|
||||
' /// <LI>bAktiv</LI>
|
||||
' /// <LI>daErstellt_am</LI>
|
||||
' /// <LI>daMutiert_am</LI>
|
||||
' /// <LI>iMutierer</LI>
|
||||
' /// <LI>bMailempfang</LI>
|
||||
' /// <LI>bEdokaMesasge</LI>
|
||||
' /// <LI>sFunktion</LI>
|
||||
' /// <LI>bMailDirektVersenden</LI>
|
||||
' /// <LI>sRang</LI>
|
||||
' /// <LI>bMailDokumentrueckgang</LI>
|
||||
' /// <LI>iKlassifizierung</LI>
|
||||
' /// <LI>bEdoka_mail</LI>
|
||||
' /// <LI>bJournalisierung</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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
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)("kurzzeichen") Is System.DBNull.Value Then
|
||||
m_sKurzzeichen = SqlString.Null
|
||||
Else
|
||||
m_sKurzzeichen = New SqlString(CType(dtToReturn.Rows(0)("kurzzeichen"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("anrede") Is System.DBNull.Value Then
|
||||
m_sAnrede = SqlString.Null
|
||||
Else
|
||||
m_sAnrede = New SqlString(CType(dtToReturn.Rows(0)("anrede"), 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)("fax") Is System.DBNull.Value Then
|
||||
m_sFax = SqlString.Null
|
||||
Else
|
||||
m_sFax = New SqlString(CType(dtToReturn.Rows(0)("fax"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("telefon") Is System.DBNull.Value Then
|
||||
m_sTelefon = SqlString.Null
|
||||
Else
|
||||
m_sTelefon = New SqlString(CType(dtToReturn.Rows(0)("telefon"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("unterschrift_text") Is System.DBNull.Value Then
|
||||
m_sUnterschrift_text = SqlString.Null
|
||||
Else
|
||||
m_sUnterschrift_text = New SqlString(CType(dtToReturn.Rows(0)("unterschrift_text"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("funktionnr") Is System.DBNull.Value Then
|
||||
m_iFunktionnr = SqlInt32.Null
|
||||
Else
|
||||
m_iFunktionnr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("sprache") Is System.DBNull.Value Then
|
||||
m_iSprache = SqlInt32.Null
|
||||
Else
|
||||
m_iSprache = New SqlInt32(CType(dtToReturn.Rows(0)("sprache"), Integer))
|
||||
End If
|
||||
m_iFuermandant = New SqlInt32(CType(dtToReturn.Rows(0)("fuermandant"), Integer))
|
||||
m_bShowtip = New SqlBoolean(CType(dtToReturn.Rows(0)("showtip"), Boolean))
|
||||
m_iPartnernr = New SqlInt32(CType(dtToReturn.Rows(0)("partnernr"), 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
|
||||
If dtToReturn.Rows(0)("Mailempfang") Is System.DBNull.Value Then
|
||||
m_bMailempfang = SqlBoolean.Null
|
||||
Else
|
||||
m_bMailempfang = New SqlBoolean(CType(dtToReturn.Rows(0)("Mailempfang"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("EdokaMesasge") Is System.DBNull.Value Then
|
||||
m_bEdokaMesasge = SqlBoolean.Null
|
||||
Else
|
||||
m_bEdokaMesasge = New SqlBoolean(CType(dtToReturn.Rows(0)("EdokaMesasge"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("funktion") Is System.DBNull.Value Then
|
||||
m_sFunktion = SqlString.Null
|
||||
Else
|
||||
m_sFunktion = New SqlString(CType(dtToReturn.Rows(0)("funktion"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("MailDirektVersenden") Is System.DBNull.Value Then
|
||||
m_bMailDirektVersenden = SqlBoolean.Null
|
||||
Else
|
||||
m_bMailDirektVersenden = New SqlBoolean(CType(dtToReturn.Rows(0)("MailDirektVersenden"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Rang") Is System.DBNull.Value Then
|
||||
m_sRang = SqlString.Null
|
||||
Else
|
||||
m_sRang = New SqlString(CType(dtToReturn.Rows(0)("Rang"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("MailDokumentrueckgang") Is System.DBNull.Value Then
|
||||
m_bMailDokumentrueckgang = SqlBoolean.Null
|
||||
Else
|
||||
m_bMailDokumentrueckgang = New SqlBoolean(CType(dtToReturn.Rows(0)("MailDokumentrueckgang"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("klassifizierung") Is System.DBNull.Value Then
|
||||
m_iKlassifizierung = SqlInt32.Null
|
||||
Else
|
||||
m_iKlassifizierung = New SqlInt32(CType(dtToReturn.Rows(0)("klassifizierung"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("edoka_mail") Is System.DBNull.Value Then
|
||||
m_bEdoka_mail = SqlBoolean.Null
|
||||
Else
|
||||
m_bEdoka_mail = New SqlBoolean(CType(dtToReturn.Rows(0)("edoka_mail"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("journalisierung") Is System.DBNull.Value Then
|
||||
m_bJournalisierung = SqlBoolean.Null
|
||||
Else
|
||||
m_bJournalisierung = New SqlBoolean(CType(dtToReturn.Rows(0)("journalisierung"), Boolean))
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
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 [sKurzzeichen]() As SqlString
|
||||
Get
|
||||
Return m_sKurzzeichen
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKurzzeichen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sAnrede]() As SqlString
|
||||
Get
|
||||
Return m_sAnrede
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sAnrede = 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 [sFax]() As SqlString
|
||||
Get
|
||||
Return m_sFax
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFax = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTelefon]() As SqlString
|
||||
Get
|
||||
Return m_sTelefon
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTelefon = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sUnterschrift_text]() As SqlString
|
||||
Get
|
||||
Return m_sUnterschrift_text
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sUnterschrift_text = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFunktionnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFunktionnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSprache]() As SqlInt32
|
||||
Get
|
||||
Return m_iSprache
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSprache = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFuermandant]() As SqlInt32
|
||||
Get
|
||||
Return m_iFuermandant
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFuermandantTmp As SqlInt32 = Value
|
||||
If iFuermandantTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFuermandant", "iFuermandant can't be NULL")
|
||||
End If
|
||||
m_iFuermandant = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bShowtip]() As SqlBoolean
|
||||
Get
|
||||
Return m_bShowtip
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bShowtipTmp As SqlBoolean = Value
|
||||
If bShowtipTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bShowtip", "bShowtip can't be NULL")
|
||||
End If
|
||||
m_bShowtip = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPartnernr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPartnernr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPartnernrTmp As SqlInt32 = Value
|
||||
If iPartnernrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPartnernr", "iPartnernr can't be NULL")
|
||||
End If
|
||||
m_iPartnernr = 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 [bMailempfang]() As SqlBoolean
|
||||
Get
|
||||
Return m_bMailempfang
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bMailempfang = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bEdokaMesasge]() As SqlBoolean
|
||||
Get
|
||||
Return m_bEdokaMesasge
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bEdokaMesasge = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFunktion]() As SqlString
|
||||
Get
|
||||
Return m_sFunktion
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFunktion = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bMailDirektVersenden]() As SqlBoolean
|
||||
Get
|
||||
Return m_bMailDirektVersenden
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bMailDirektVersenden = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sRang]() As SqlString
|
||||
Get
|
||||
Return m_sRang
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sRang = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bMailDokumentrueckgang]() As SqlBoolean
|
||||
Get
|
||||
Return m_bMailDokumentrueckgang
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bMailDokumentrueckgang = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iKlassifizierung]() As SqlInt32
|
||||
Get
|
||||
Return m_iKlassifizierung
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iKlassifizierung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bEdoka_mail]() As SqlBoolean
|
||||
Get
|
||||
Return m_bEdoka_mail
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bEdoka_mail = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bJournalisierung]() As SqlBoolean
|
||||
Get
|
||||
Return m_bJournalisierung
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bJournalisierung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
850
EDKB09/DB/clsOffice_vorlage.vb
Normal file
850
EDKB09/DB/clsOffice_vorlage.vb
Normal file
@@ -0,0 +1,850 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'office_vorlage'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Donnerstag, 26. Februar 2004, 22:30:42
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'office_vorlage'.
|
||||
' /// </summary>
|
||||
Public Class clsOffice_vorlage
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bDokument_geschuetzt, m_bIdv_nativ, m_bAbsender_ersteller, m_bAktiv, m_bBchorizontal, m_bKopfzeile_generieren, m_bIdv_vorlage As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMandantnr, m_iBch, m_iBcw, m_iOffice_vorlagenr, m_iMutierer, m_iAnwendungnr, m_iOwner, m_iKlassifizierung, m_iVorlageid, m_iBcpl, m_iBcpt As SqlInt32
|
||||
Private m_sPrefix_dokumentname, m_sIdv_id, m_sOffice_vorlage, m_sBezeichnung, m_sBeschreibung, m_sVorlagename 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>iOffice_vorlagenr</LI>
|
||||
' /// <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
' /// <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
' /// <LI>iVorlageid. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sVorlagename. May be SqlString.Null</LI>
|
||||
' /// <LI>sPrefix_dokumentname. May be SqlString.Null</LI>
|
||||
' /// <LI>bIdv_vorlage</LI>
|
||||
' /// <LI>sIdv_id. May be SqlString.Null</LI>
|
||||
' /// <LI>sOffice_vorlage. May be SqlString.Null</LI>
|
||||
' /// <LI>bAbsender_ersteller. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bIdv_nativ</LI>
|
||||
' /// <LI>bDokument_geschuetzt. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bKopfzeile_generieren</LI>
|
||||
' /// <LI>iKlassifizierung. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iBcpt</LI>
|
||||
' /// <LI>iBcpl. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iBcw</LI>
|
||||
' /// <LI>iBch</LI>
|
||||
' /// <LI>bBchorizontal. 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>iAnwendungnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iOwner. 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_office_vorlage_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ioffice_vorlagenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iOffice_vorlagenr))
|
||||
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("@ivorlageid", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVorlageid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@svorlagename", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorlagename))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sprefix_dokumentname", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sPrefix_dokumentname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bidv_vorlage", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bIdv_vorlage))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sidv_id", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sIdv_id))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@soffice_vorlage", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sOffice_vorlage))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@babsender_ersteller", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAbsender_ersteller))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bidv_nativ", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bIdv_nativ))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bdokument_geschuetzt", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bDokument_geschuetzt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bkopfzeile_generieren", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bKopfzeile_generieren))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iklassifizierung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKlassifizierung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibcpt", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBcpt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibcpl", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBcpl))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibcw", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBcw))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibch", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBch))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bbchorizontal", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bBchorizontal))
|
||||
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, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", 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("@ianwendungnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAnwendungnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iowner", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iOwner))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_office_vorlage_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("clsOffice_vorlage::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>iOffice_vorlagenr</LI>
|
||||
' /// <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
' /// <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
' /// <LI>iVorlageid. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sVorlagename. May be SqlString.Null</LI>
|
||||
' /// <LI>sPrefix_dokumentname. May be SqlString.Null</LI>
|
||||
' /// <LI>bIdv_vorlage</LI>
|
||||
' /// <LI>sIdv_id. May be SqlString.Null</LI>
|
||||
' /// <LI>sOffice_vorlage. May be SqlString.Null</LI>
|
||||
' /// <LI>bAbsender_ersteller. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bIdv_nativ</LI>
|
||||
' /// <LI>bDokument_geschuetzt. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bKopfzeile_generieren</LI>
|
||||
' /// <LI>iKlassifizierung. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iBcpt</LI>
|
||||
' /// <LI>iBcpl. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iBcw</LI>
|
||||
' /// <LI>iBch</LI>
|
||||
' /// <LI>bBchorizontal. 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>iAnwendungnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iOwner. 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_office_vorlage_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ioffice_vorlagenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iOffice_vorlagenr))
|
||||
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("@ivorlageid", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVorlageid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@svorlagename", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorlagename))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sprefix_dokumentname", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sPrefix_dokumentname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bidv_vorlage", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bIdv_vorlage))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sidv_id", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sIdv_id))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@soffice_vorlage", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sOffice_vorlage))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@babsender_ersteller", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAbsender_ersteller))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bidv_nativ", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bIdv_nativ))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bdokument_geschuetzt", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bDokument_geschuetzt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bkopfzeile_generieren", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bKopfzeile_generieren))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iklassifizierung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKlassifizierung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibcpt", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBcpt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibcpl", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBcpl))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibcw", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBcw))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibch", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iBch))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bbchorizontal", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bBchorizontal))
|
||||
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, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", 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("@ianwendungnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAnwendungnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iowner", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iOwner))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_office_vorlage_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("clsOffice_vorlage::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>iOffice_vorlagenr</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_office_vorlage_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ioffice_vorlagenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iOffice_vorlagenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_office_vorlage_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("clsOffice_vorlage::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>iOffice_vorlagenr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iOffice_vorlagenr</LI>
|
||||
' /// <LI>sBezeichnung</LI>
|
||||
' /// <LI>sBeschreibung</LI>
|
||||
' /// <LI>iVorlageid</LI>
|
||||
' /// <LI>sVorlagename</LI>
|
||||
' /// <LI>sPrefix_dokumentname</LI>
|
||||
' /// <LI>bIdv_vorlage</LI>
|
||||
' /// <LI>sIdv_id</LI>
|
||||
' /// <LI>sOffice_vorlage</LI>
|
||||
' /// <LI>bAbsender_ersteller</LI>
|
||||
' /// <LI>bIdv_nativ</LI>
|
||||
' /// <LI>bDokument_geschuetzt</LI>
|
||||
' /// <LI>bKopfzeile_generieren</LI>
|
||||
' /// <LI>iKlassifizierung</LI>
|
||||
' /// <LI>iBcpt</LI>
|
||||
' /// <LI>iBcpl</LI>
|
||||
' /// <LI>iBcw</LI>
|
||||
' /// <LI>iBch</LI>
|
||||
' /// <LI>bBchorizontal</LI>
|
||||
' /// <LI>iMandantnr</LI>
|
||||
' /// <LI>bAktiv</LI>
|
||||
' /// <LI>daErstellt_am</LI>
|
||||
' /// <LI>daMutiert_am</LI>
|
||||
' /// <LI>iMutierer</LI>
|
||||
' /// <LI>iAnwendungnr</LI>
|
||||
' /// <LI>iOwner</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_office_vorlage_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("office_vorlage")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ioffice_vorlagenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iOffice_vorlagenr))
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_office_vorlage_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iOffice_vorlagenr = New SqlInt32(CType(dtToReturn.Rows(0)("office_vorlagenr"), 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)("vorlageid") Is System.DBNull.Value Then
|
||||
m_iVorlageid = SqlInt32.Null
|
||||
Else
|
||||
m_iVorlageid = New SqlInt32(CType(dtToReturn.Rows(0)("vorlageid"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("vorlagename") Is System.DBNull.Value Then
|
||||
m_sVorlagename = SqlString.Null
|
||||
Else
|
||||
m_sVorlagename = New SqlString(CType(dtToReturn.Rows(0)("vorlagename"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("prefix_dokumentname") Is System.DBNull.Value Then
|
||||
m_sPrefix_dokumentname = SqlString.Null
|
||||
Else
|
||||
m_sPrefix_dokumentname = New SqlString(CType(dtToReturn.Rows(0)("prefix_dokumentname"), String))
|
||||
End If
|
||||
m_bIdv_vorlage = New SqlBoolean(CType(dtToReturn.Rows(0)("idv_vorlage"), Boolean))
|
||||
If dtToReturn.Rows(0)("idv_id") Is System.DBNull.Value Then
|
||||
m_sIdv_id = SqlString.Null
|
||||
Else
|
||||
m_sIdv_id = New SqlString(CType(dtToReturn.Rows(0)("idv_id"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("office_vorlage") Is System.DBNull.Value Then
|
||||
m_sOffice_vorlage = SqlString.Null
|
||||
Else
|
||||
m_sOffice_vorlage = New SqlString(CType(dtToReturn.Rows(0)("office_vorlage"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("absender_ersteller") Is System.DBNull.Value Then
|
||||
m_bAbsender_ersteller = SqlBoolean.Null
|
||||
Else
|
||||
m_bAbsender_ersteller = New SqlBoolean(CType(dtToReturn.Rows(0)("absender_ersteller"), Boolean))
|
||||
End If
|
||||
m_bIdv_nativ = New SqlBoolean(CType(dtToReturn.Rows(0)("idv_nativ"), Boolean))
|
||||
If dtToReturn.Rows(0)("dokument_geschuetzt") Is System.DBNull.Value Then
|
||||
m_bDokument_geschuetzt = SqlBoolean.Null
|
||||
Else
|
||||
m_bDokument_geschuetzt = New SqlBoolean(CType(dtToReturn.Rows(0)("dokument_geschuetzt"), Boolean))
|
||||
End If
|
||||
m_bKopfzeile_generieren = New SqlBoolean(CType(dtToReturn.Rows(0)("kopfzeile_generieren"), Boolean))
|
||||
If dtToReturn.Rows(0)("klassifizierung") Is System.DBNull.Value Then
|
||||
m_iKlassifizierung = SqlInt32.Null
|
||||
Else
|
||||
m_iKlassifizierung = New SqlInt32(CType(dtToReturn.Rows(0)("klassifizierung"), Integer))
|
||||
End If
|
||||
m_iBcpt = New SqlInt32(CType(dtToReturn.Rows(0)("bcpt"), Integer))
|
||||
If dtToReturn.Rows(0)("bcpl") Is System.DBNull.Value Then
|
||||
m_iBcpl = SqlInt32.Null
|
||||
Else
|
||||
m_iBcpl = New SqlInt32(CType(dtToReturn.Rows(0)("bcpl"), Integer))
|
||||
End If
|
||||
m_iBcw = New SqlInt32(CType(dtToReturn.Rows(0)("bcw"), Integer))
|
||||
m_iBch = New SqlInt32(CType(dtToReturn.Rows(0)("bch"), Integer))
|
||||
If dtToReturn.Rows(0)("bchorizontal") Is System.DBNull.Value Then
|
||||
m_bBchorizontal = SqlBoolean.Null
|
||||
Else
|
||||
m_bBchorizontal = New SqlBoolean(CType(dtToReturn.Rows(0)("bchorizontal"), 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)("anwendungnr") Is System.DBNull.Value Then
|
||||
m_iAnwendungnr = SqlInt32.Null
|
||||
Else
|
||||
m_iAnwendungnr = New SqlInt32(CType(dtToReturn.Rows(0)("anwendungnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("owner") Is System.DBNull.Value Then
|
||||
m_iOwner = SqlInt32.Null
|
||||
Else
|
||||
m_iOwner = New SqlInt32(CType(dtToReturn.Rows(0)("owner"), 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("clsOffice_vorlage::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_office_vorlage_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("office_vorlage")
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_office_vorlage_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("clsOffice_vorlage::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 [iOffice_vorlagenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iOffice_vorlagenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iOffice_vorlagenrTmp As SqlInt32 = Value
|
||||
If iOffice_vorlagenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iOffice_vorlagenr", "iOffice_vorlagenr can't be NULL")
|
||||
End If
|
||||
m_iOffice_vorlagenr = 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 [iVorlageid]() As SqlInt32
|
||||
Get
|
||||
Return m_iVorlageid
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVorlageid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sVorlagename]() As SqlString
|
||||
Get
|
||||
Return m_sVorlagename
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sVorlagename = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sPrefix_dokumentname]() As SqlString
|
||||
Get
|
||||
Return m_sPrefix_dokumentname
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sPrefix_dokumentname = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bIdv_vorlage]() As SqlBoolean
|
||||
Get
|
||||
Return m_bIdv_vorlage
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bIdv_vorlageTmp As SqlBoolean = Value
|
||||
If bIdv_vorlageTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bIdv_vorlage", "bIdv_vorlage can't be NULL")
|
||||
End If
|
||||
m_bIdv_vorlage = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sIdv_id]() As SqlString
|
||||
Get
|
||||
Return m_sIdv_id
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sIdv_id = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sOffice_vorlage]() As SqlString
|
||||
Get
|
||||
Return m_sOffice_vorlage
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sOffice_vorlage = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAbsender_ersteller]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAbsender_ersteller
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAbsender_ersteller = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bIdv_nativ]() As SqlBoolean
|
||||
Get
|
||||
Return m_bIdv_nativ
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bIdv_nativTmp As SqlBoolean = Value
|
||||
If bIdv_nativTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bIdv_nativ", "bIdv_nativ can't be NULL")
|
||||
End If
|
||||
m_bIdv_nativ = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bDokument_geschuetzt]() As SqlBoolean
|
||||
Get
|
||||
Return m_bDokument_geschuetzt
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bDokument_geschuetzt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bKopfzeile_generieren]() As SqlBoolean
|
||||
Get
|
||||
Return m_bKopfzeile_generieren
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bKopfzeile_generierenTmp As SqlBoolean = Value
|
||||
If bKopfzeile_generierenTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bKopfzeile_generieren", "bKopfzeile_generieren can't be NULL")
|
||||
End If
|
||||
m_bKopfzeile_generieren = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iKlassifizierung]() As SqlInt32
|
||||
Get
|
||||
Return m_iKlassifizierung
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iKlassifizierung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBcpt]() As SqlInt32
|
||||
Get
|
||||
Return m_iBcpt
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iBcptTmp As SqlInt32 = Value
|
||||
If iBcptTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iBcpt", "iBcpt can't be NULL")
|
||||
End If
|
||||
m_iBcpt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBcpl]() As SqlInt32
|
||||
Get
|
||||
Return m_iBcpl
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iBcpl = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBcw]() As SqlInt32
|
||||
Get
|
||||
Return m_iBcw
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iBcwTmp As SqlInt32 = Value
|
||||
If iBcwTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iBcw", "iBcw can't be NULL")
|
||||
End If
|
||||
m_iBcw = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBch]() As SqlInt32
|
||||
Get
|
||||
Return m_iBch
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iBchTmp As SqlInt32 = Value
|
||||
If iBchTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iBch", "iBch can't be NULL")
|
||||
End If
|
||||
m_iBch = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bBchorizontal]() As SqlBoolean
|
||||
Get
|
||||
Return m_bBchorizontal
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bBchorizontal = 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 [iAnwendungnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iAnwendungnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAnwendungnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iOwner]() As SqlInt32
|
||||
Get
|
||||
Return m_iOwner
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iOwner = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
470
EDKB09/DB/clsSerienbrief_BL_Physiche_Ablage.vb
Normal file
470
EDKB09/DB/clsSerienbrief_BL_Physiche_Ablage.vb
Normal file
@@ -0,0 +1,470 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Serienbrief_BL_Physiche_Ablage'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Sonntag, 19. September 2010, 09:41:03
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'Serienbrief_BL_Physiche_Ablage'.
|
||||
''' </summary>
|
||||
Public Class clsSerienbrief_BL_Physiche_Ablage
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_daTimestampe As SqlDateTime
|
||||
Private m_iEintragnr, m_iPartnernr, m_iSerienbriefnr As SqlInt32
|
||||
Private m_sTGNumer_Ersteller, m_sDokumentid, m_sBezeichnung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <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>iSerienbriefnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sTGNumer_Ersteller. May be SqlString.Null</LI>
|
||||
''' <LI>iPartnernr. May be SqlInt32.Null</LI>
|
||||
''' <LI>sDokumentid. May be SqlString.Null</LI>
|
||||
''' <LI>daTimestampe. May be SqlDateTime.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Serienbrief_BL_Physiche_Ablage_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSerienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTGNumer_Ersteller", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTGNumer_Ersteller))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPartnernr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDokumentid", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTimestampe", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTimestampe))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iEintragnr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iEintragnr").Value, SqlInt32))
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Serienbrief_BL_Physiche_Ablage_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSerienbrief_BL_Physiche_Ablage::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <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>iSerienbriefnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sTGNumer_Ersteller. May be SqlString.Null</LI>
|
||||
''' <LI>iPartnernr. May be SqlInt32.Null</LI>
|
||||
''' <LI>sDokumentid. May be SqlString.Null</LI>
|
||||
''' <LI>daTimestampe. May be SqlDateTime.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_Serienbrief_BL_Physiche_Ablage_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSerienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTGNumer_Ersteller", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTGNumer_Ersteller))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPartnernr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDokumentid", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTimestampe", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTimestampe))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Serienbrief_BL_Physiche_Ablage_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSerienbrief_BL_Physiche_Ablage::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <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_Serienbrief_BL_Physiche_Ablage_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Serienbrief_BL_Physiche_Ablage_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSerienbrief_BL_Physiche_Ablage::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <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>iSerienbriefnr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>sTGNumer_Ersteller</LI>
|
||||
''' <LI>iPartnernr</LI>
|
||||
''' <LI>sDokumentid</LI>
|
||||
''' <LI>daTimestampe</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_Serienbrief_BL_Physiche_Ablage_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Serienbrief_BL_Physiche_Ablage")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Serienbrief_BL_Physiche_Ablage_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iEintragnr = New SqlInt32(CType(dtToReturn.Rows(0)("Eintragnr"), Integer))
|
||||
If dtToReturn.Rows(0)("Serienbriefnr") Is System.DBNull.Value Then
|
||||
m_iSerienbriefnr = SqlInt32.Null
|
||||
Else
|
||||
m_iSerienbriefnr = New SqlInt32(CType(dtToReturn.Rows(0)("Serienbriefnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("Bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("TGNumer_Ersteller") Is System.DBNull.Value Then
|
||||
m_sTGNumer_Ersteller = SqlString.Null
|
||||
Else
|
||||
m_sTGNumer_Ersteller = New SqlString(CType(dtToReturn.Rows(0)("TGNumer_Ersteller"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Partnernr") Is System.DBNull.Value Then
|
||||
m_iPartnernr = SqlInt32.Null
|
||||
Else
|
||||
m_iPartnernr = New SqlInt32(CType(dtToReturn.Rows(0)("Partnernr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Dokumentid") Is System.DBNull.Value Then
|
||||
m_sDokumentid = SqlString.Null
|
||||
Else
|
||||
m_sDokumentid = New SqlString(CType(dtToReturn.Rows(0)("Dokumentid"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Timestampe") Is System.DBNull.Value Then
|
||||
m_daTimestampe = SqlDateTime.Null
|
||||
Else
|
||||
m_daTimestampe = New SqlDateTime(CType(dtToReturn.Rows(0)("Timestampe"), Date))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSerienbrief_BL_Physiche_Ablage::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <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_Serienbrief_BL_Physiche_Ablage_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Serienbrief_BL_Physiche_Ablage")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Serienbrief_BL_Physiche_Ablage_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSerienbrief_BL_Physiche_Ablage::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iEintragnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iEintragnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iEintragnrTmp As SqlInt32 = Value
|
||||
If iEintragnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iEintragnr", "iEintragnr can't be NULL")
|
||||
End If
|
||||
m_iEintragnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSerienbriefnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSerienbriefnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSerienbriefnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTGNumer_Ersteller]() As SqlString
|
||||
Get
|
||||
Return m_sTGNumer_Ersteller
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTGNumer_Ersteller = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPartnernr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPartnernr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPartnernr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDokumentid]() As SqlString
|
||||
Get
|
||||
Return m_sDokumentid
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDokumentid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daTimestampe]() As SqlDateTime
|
||||
Get
|
||||
Return m_daTimestampe
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daTimestampe = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
37
EDKB09/DB/db_connection.vb
Normal file
37
EDKB09/DB/db_connection.vb
Normal file
@@ -0,0 +1,37 @@
|
||||
Imports System.ComponentModel
|
||||
Imports Microsoft.VisualBasic
|
||||
|
||||
Namespace EDOKA
|
||||
Public Class DB_Connection
|
||||
Public Sub New()
|
||||
''Edoka
|
||||
'FileOpen(1, Globals.ApplicationPath + "edokaconn.cfg", OpenMode.Input)
|
||||
'Input(1, sConnectionString_edoka)
|
||||
'FileClose(1)
|
||||
|
||||
'FileOpen(1, Globals.ApplicationPath + "journaleconn.cfg", OpenMode.Input)
|
||||
'Input(1, sConnectionString_journale)
|
||||
'FileClose(1)
|
||||
'Globals.conn_edoka.sConnectionString = sConnectionString_edoka
|
||||
'Globals.conn_journale.sConnectionString = sConnectionString_journale
|
||||
'Exit Sub
|
||||
|
||||
|
||||
oread = IO.File.OpenText(Globals.ApplicationPath + "edokaconn.cfg")
|
||||
sConnectionString_edoka = oread.ReadLine
|
||||
Globals.sConnectionString_edoka = sConnectionString_edoka
|
||||
oread.Close()
|
||||
|
||||
'Journale
|
||||
oread = IO.File.OpenText(Globals.ApplicationPath + "journaleconn.cfg")
|
||||
sConnectionString_journale = oread.ReadLine
|
||||
Globals.sConnectionString_journale = sConnectionString_journale
|
||||
oread.Close()
|
||||
Globals.conn_edoka.sConnectionString = sConnectionString_edoka
|
||||
Globals.conn_journale.sConnectionString = sConnectionString_journale
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
BIN
EDKB09/DB/vssver.scc
Normal file
BIN
EDKB09/DB/vssver.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user