You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
796 lines
36 KiB
796 lines
36 KiB
' ///////////////////////////////////////////////////////////////////////////
|
|
' // Description: Data Access class for the table 'ReportingSortOrderUser'
|
|
' // Generated by LLBLGen v1.2.1045.38210 Final on: Donnerstag, 27. November 2003, 19:03:21
|
|
' // 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 'ReportingSortOrderUser'.
|
|
' /// </summary>
|
|
Public Class clsReportingSortOrderUser
|
|
Inherits clsDBInteractionBase
|
|
|
|
#Region " Class Member Declarations "
|
|
|
|
Private m_bAufsteigend, m_bLoeschen, m_bAktiv As SqlBoolean
|
|
Private m_daErstellt_Am, m_daMutiert_Am As SqlDateTime
|
|
Private m_iMandant_Nr, m_iMutierer, m_iSortOrder, m_iReportingSortOrderID, m_iReportID, m_iMitarbeiternr, m_iID As SqlInt32
|
|
Private m_sReportFieldName, m_sDisplayFieldName 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>iID</LI>
|
|
' /// <LI>iReportingSortOrderID. May be SqlInt32.Null</LI>
|
|
' /// <LI>iReportID</LI>
|
|
' /// <LI>sDisplayFieldName. May be SqlString.Null</LI>
|
|
' /// <LI>sReportFieldName. May be SqlString.Null</LI>
|
|
' /// <LI>bAufsteigend. May be SqlBoolean.Null</LI>
|
|
' /// <LI>iMitarbeiternr</LI>
|
|
' /// <LI>iSortOrder. 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>bLoeschen. May be SqlBoolean.Null</LI>
|
|
' /// <LI>iMandant_Nr. 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_ReportingSortOrderUser_Insert]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
|
' // Use base class' connection object
|
|
scmCmdToExecute.Connection = m_scoMainConnection
|
|
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iID))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReportingSortOrderID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iReportingSortOrderID))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReportID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iReportID))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDisplayFieldName", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDisplayFieldName))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sReportFieldName", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sReportFieldName))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAufsteigend", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAufsteigend))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSortOrder", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSortOrder))
|
|
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("@bLoeschen", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bLoeschen))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMandant_Nr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandant_Nr))
|
|
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_ReportingSortOrderUser_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("clsReportingSortOrderUser::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>iID</LI>
|
|
' /// <LI>iReportingSortOrderID. May be SqlInt32.Null</LI>
|
|
' /// <LI>iReportID</LI>
|
|
' /// <LI>sDisplayFieldName. May be SqlString.Null</LI>
|
|
' /// <LI>sReportFieldName. May be SqlString.Null</LI>
|
|
' /// <LI>bAufsteigend. May be SqlBoolean.Null</LI>
|
|
' /// <LI>iMitarbeiternr</LI>
|
|
' /// <LI>iSortOrder. 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>bLoeschen. May be SqlBoolean.Null</LI>
|
|
' /// <LI>iMandant_Nr. 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_ReportingSortOrderUser_Update]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
|
' // Use base class' connection object
|
|
scmCmdToExecute.Connection = m_scoMainConnection
|
|
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iID))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReportingSortOrderID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iReportingSortOrderID))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReportID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iReportID))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDisplayFieldName", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDisplayFieldName))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sReportFieldName", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sReportFieldName))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAufsteigend", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAufsteigend))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSortOrder", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSortOrder))
|
|
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("@bLoeschen", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bLoeschen))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMandant_Nr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandant_Nr))
|
|
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_ReportingSortOrderUser_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("clsReportingSortOrderUser::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>iID</LI>
|
|
' /// <LI>iReportID</LI>
|
|
' /// <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_ReportingSortOrderUser_Delete]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
|
' // Use base class' connection object
|
|
scmCmdToExecute.Connection = m_scoMainConnection
|
|
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iID))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReportID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iReportID))
|
|
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 = 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_ReportingSortOrderUser_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("clsReportingSortOrderUser::Delete::Error occured.", ex)
|
|
Finally
|
|
If m_bMainConnectionIsCreatedLocal Then
|
|
' // Close connection.
|
|
m_scoMainConnection.Close()
|
|
End If
|
|
scmCmdToExecute.Dispose()
|
|
End Try
|
|
End Function
|
|
|
|
|
|
' /// <summary>
|
|
' /// Purpose: Delete method using PK field 'ID'. This method will
|
|
' /// delete one or more rows from the database, based on the Primary Key field 'ID'.
|
|
' /// </summary>
|
|
' /// <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
|
' /// <remarks>
|
|
' /// Properties needed for this method:
|
|
' /// <UL>
|
|
' /// <LI>iID</LI>
|
|
' /// </UL>
|
|
' /// Properties set after a succesful call of this method:
|
|
' /// <UL>
|
|
' /// <LI>iErrorCode</LI>
|
|
' /// </UL>
|
|
' /// </remarks>
|
|
Public Function DeleteWIDLogic() As Boolean
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.[pr_ReportingSortOrderUser_DeleteWIDLogic]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
|
' // Use base class' connection object
|
|
scmCmdToExecute.Connection = m_scoMainConnection
|
|
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iID))
|
|
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_ReportingSortOrderUser_DeleteWIDLogic' 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("clsReportingSortOrderUser::DeleteWIDLogic::Error occured.", ex)
|
|
Finally
|
|
If m_bMainConnectionIsCreatedLocal Then
|
|
' // Close connection.
|
|
m_scoMainConnection.Close()
|
|
End If
|
|
scmCmdToExecute.Dispose()
|
|
End Try
|
|
End Function
|
|
|
|
|
|
' /// <summary>
|
|
' /// Purpose: Delete method using PK field 'ReportID'. This method will
|
|
' /// delete one or more rows from the database, based on the Primary Key field 'ReportID'.
|
|
' /// </summary>
|
|
' /// <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
|
' /// <remarks>
|
|
' /// Properties needed for this method:
|
|
' /// <UL>
|
|
' /// <LI>iReportID</LI>
|
|
' /// </UL>
|
|
' /// Properties set after a succesful call of this method:
|
|
' /// <UL>
|
|
' /// <LI>iErrorCode</LI>
|
|
' /// </UL>
|
|
' /// </remarks>
|
|
Public Function DeleteWReportIDLogic() As Boolean
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.[pr_ReportingSortOrderUser_DeleteWReportIDLogic]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
|
' // Use base class' connection object
|
|
scmCmdToExecute.Connection = m_scoMainConnection
|
|
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(new SqlParameter("@iReportID", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iReportID))
|
|
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_ReportingSortOrderUser_DeleteWReportIDLogic' 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("clsReportingSortOrderUser::DeleteWReportIDLogic::Error occured.", ex)
|
|
Finally
|
|
If m_bMainConnectionIsCreatedLocal Then
|
|
' // Close connection.
|
|
m_scoMainConnection.Close()
|
|
End If
|
|
scmCmdToExecute.Dispose()
|
|
End Try
|
|
End Function
|
|
|
|
|
|
' /// <summary>
|
|
' /// Purpose: Delete method using PK field 'mitarbeiternr'. This method will
|
|
' /// delete one or more rows from the database, based on the Primary Key field 'mitarbeiternr'.
|
|
' /// </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>
|
|
Public Function DeleteWmitarbeiternrLogic() As Boolean
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.[pr_ReportingSortOrderUser_DeleteWmitarbeiternrLogic]"
|
|
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 = 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_ReportingSortOrderUser_DeleteWmitarbeiternrLogic' 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("clsReportingSortOrderUser::DeleteWmitarbeiternrLogic::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>iID</LI>
|
|
' /// <LI>iReportID</LI>
|
|
' /// <LI>iMitarbeiternr</LI>
|
|
' /// </UL>
|
|
' /// Properties set after a succesful call of this method:
|
|
' /// <UL>
|
|
' /// <LI>iErrorCode</LI>
|
|
' /// <LI>iID</LI>
|
|
' /// <LI>iReportingSortOrderID</LI>
|
|
' /// <LI>iReportID</LI>
|
|
' /// <LI>sDisplayFieldName</LI>
|
|
' /// <LI>sReportFieldName</LI>
|
|
' /// <LI>bAufsteigend</LI>
|
|
' /// <LI>iMitarbeiternr</LI>
|
|
' /// <LI>iSortOrder</LI>
|
|
' /// <LI>bAktiv</LI>
|
|
' /// <LI>daErstellt_Am</LI>
|
|
' /// <LI>daMutiert_Am</LI>
|
|
' /// <LI>iMutierer</LI>
|
|
' /// <LI>bLoeschen</LI>
|
|
' /// <LI>iMandant_Nr</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_ReportingSortOrderUser_SelectOne]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
Dim dtToReturn As DataTable = new DataTable("ReportingSortOrderUser")
|
|
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
|
|
|
' // Use base class' connection object
|
|
scmCmdToExecute.Connection = m_scoMainConnection
|
|
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(new SqlParameter("@iID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iID))
|
|
scmCmdToExecute.Parameters.Add(new SqlParameter("@iReportID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iReportID))
|
|
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
|
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
|
|
|
If m_bMainConnectionIsCreatedLocal Then
|
|
' // Open connection.
|
|
m_scoMainConnection.Open()
|
|
Else
|
|
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
|
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
|
End If
|
|
End If
|
|
|
|
' // Execute query.
|
|
sdaAdapter.Fill(dtToReturn)
|
|
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
|
|
|
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
|
' // Throw error.
|
|
Throw New Exception("Stored Procedure 'pr_ReportingSortOrderUser_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
|
End If
|
|
|
|
If dtToReturn.Rows.Count > 0 Then
|
|
m_iID = New SqlInt32(CType(dtToReturn.Rows(0)("ID"), Integer))
|
|
If dtToReturn.Rows(0)("ReportingSortOrderID") Is System.DBNull.Value Then
|
|
m_iReportingSortOrderID = SqlInt32.Null
|
|
Else
|
|
m_iReportingSortOrderID = New SqlInt32(CType(dtToReturn.Rows(0)("ReportingSortOrderID"), Integer))
|
|
End If
|
|
m_iReportID = New SqlInt32(CType(dtToReturn.Rows(0)("ReportID"), Integer))
|
|
If dtToReturn.Rows(0)("DisplayFieldName") Is System.DBNull.Value Then
|
|
m_sDisplayFieldName = SqlString.Null
|
|
Else
|
|
m_sDisplayFieldName = New SqlString(CType(dtToReturn.Rows(0)("DisplayFieldName"), String))
|
|
End If
|
|
If dtToReturn.Rows(0)("ReportFieldName") Is System.DBNull.Value Then
|
|
m_sReportFieldName = SqlString.Null
|
|
Else
|
|
m_sReportFieldName = New SqlString(CType(dtToReturn.Rows(0)("ReportFieldName"), String))
|
|
End If
|
|
If dtToReturn.Rows(0)("Aufsteigend") Is System.DBNull.Value Then
|
|
m_bAufsteigend = SqlBoolean.Null
|
|
Else
|
|
m_bAufsteigend = New SqlBoolean(CType(dtToReturn.Rows(0)("Aufsteigend"), Boolean))
|
|
End If
|
|
m_iMitarbeiternr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiternr"), Integer))
|
|
If dtToReturn.Rows(0)("SortOrder") Is System.DBNull.Value Then
|
|
m_iSortOrder = SqlInt32.Null
|
|
Else
|
|
m_iSortOrder = New SqlInt32(CType(dtToReturn.Rows(0)("SortOrder"), 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)("Loeschen") Is System.DBNull.Value Then
|
|
m_bLoeschen = SqlBoolean.Null
|
|
Else
|
|
m_bLoeschen = New SqlBoolean(CType(dtToReturn.Rows(0)("Loeschen"), Boolean))
|
|
End If
|
|
If dtToReturn.Rows(0)("Mandant_Nr") Is System.DBNull.Value Then
|
|
m_iMandant_Nr = SqlInt32.Null
|
|
Else
|
|
m_iMandant_Nr = New SqlInt32(CType(dtToReturn.Rows(0)("Mandant_Nr"), 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("clsReportingSortOrderUser::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>
|
|
Public Overrides Function SelectAll() As DataTable
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.[pr_ReportingSortOrderUser_SelectAll]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
Dim dtToReturn As DataTable = New DataTable("ReportingSortOrderUser")
|
|
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_ReportingSortOrderUser_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("clsReportingSortOrderUser::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 [iID]() As SqlInt32
|
|
Get
|
|
Return m_iID
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
Dim iIDTmp As SqlInt32 = Value
|
|
If iIDTmp.IsNull Then
|
|
Throw New ArgumentOutOfRangeException("iID", "iID can't be NULL")
|
|
End If
|
|
m_iID = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [iReportingSortOrderID]() As SqlInt32
|
|
Get
|
|
Return m_iReportingSortOrderID
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
m_iReportingSortOrderID = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [iReportID]() As SqlInt32
|
|
Get
|
|
Return m_iReportID
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
Dim iReportIDTmp As SqlInt32 = Value
|
|
If iReportIDTmp.IsNull Then
|
|
Throw New ArgumentOutOfRangeException("iReportID", "iReportID can't be NULL")
|
|
End If
|
|
m_iReportID = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [sDisplayFieldName]() As SqlString
|
|
Get
|
|
Return m_sDisplayFieldName
|
|
End Get
|
|
Set(ByVal Value As SqlString)
|
|
m_sDisplayFieldName = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [sReportFieldName]() As SqlString
|
|
Get
|
|
Return m_sReportFieldName
|
|
End Get
|
|
Set(ByVal Value As SqlString)
|
|
m_sReportFieldName = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [bAufsteigend]() As SqlBoolean
|
|
Get
|
|
Return m_bAufsteigend
|
|
End Get
|
|
Set(ByVal Value As SqlBoolean)
|
|
m_bAufsteigend = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
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 [iSortOrder]() As SqlInt32
|
|
Get
|
|
Return m_iSortOrder
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
m_iSortOrder = 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 [bLoeschen]() As SqlBoolean
|
|
Get
|
|
Return m_bLoeschen
|
|
End Get
|
|
Set(ByVal Value As SqlBoolean)
|
|
m_bLoeschen = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [iMandant_Nr]() As SqlInt32
|
|
Get
|
|
Return m_iMandant_Nr
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
m_iMandant_Nr = Value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
End Class
|
|
End Namespace
|