Initial commit
This commit is contained in:
517
SW/AssessmentMgmt/DB/Generierte Objekte/clsApplication.vb
Normal file
517
SW/AssessmentMgmt/DB/Generierte Objekte/clsApplication.vb
Normal file
@@ -0,0 +1,517 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Application'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'Application'.
|
||||
''' </summary>
|
||||
Public Class clsApplication
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bShowlogin, m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iApplikationsnr As SqlInt32
|
||||
Private m_sTmp_filepath, m_sVersion As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' <LI>sVersion. May be SqlString.Null</LI>
|
||||
''' <LI>bShowlogin. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sTmp_filepath. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Application_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationsnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationsnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sversion", SqlDbType.VarChar, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVersion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bshowlogin", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bShowlogin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stmp_filepath", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTmp_filepath))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Application_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsApplication::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' <LI>sVersion. May be SqlString.Null</LI>
|
||||
''' <LI>bShowlogin. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sTmp_filepath. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Application_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationsnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationsnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sversion", SqlDbType.VarChar, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVersion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bshowlogin", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bShowlogin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stmp_filepath", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTmp_filepath))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Application_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsApplication::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Application_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iapplikationsnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationsnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Application_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsApplication::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iApplikationsnr</LI>
|
||||
''' <LI>sVersion</LI>
|
||||
''' <LI>bShowlogin</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>sTmp_filepath</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Application_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Application")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iapplikationsnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplikationsnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Application_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iApplikationsnr = New SqlInt32(CType(dtToReturn.Rows(0)("applikationsnr"), Integer))
|
||||
If dtToReturn.Rows(0)("version") Is System.DBNull.Value Then
|
||||
m_sVersion = SqlString.Null
|
||||
Else
|
||||
m_sVersion = New SqlString(CType(dtToReturn.Rows(0)("version"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("showlogin") Is System.DBNull.Value Then
|
||||
m_bShowlogin = SqlBoolean.Null
|
||||
Else
|
||||
m_bShowlogin = New SqlBoolean(CType(dtToReturn.Rows(0)("showlogin"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tmp_filepath") Is System.DBNull.Value Then
|
||||
m_sTmp_filepath = SqlString.Null
|
||||
Else
|
||||
m_sTmp_filepath = New SqlString(CType(dtToReturn.Rows(0)("tmp_filepath"), String))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsApplication::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Application_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Application")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Application_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsApplication::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iApplikationsnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iApplikationsnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iApplikationsnrTmp As SqlInt32 = Value
|
||||
If iApplikationsnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iApplikationsnr", "iApplikationsnr can't be NULL")
|
||||
End If
|
||||
m_iApplikationsnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sVersion]() As SqlString
|
||||
Get
|
||||
Return m_sVersion
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sVersion = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bShowlogin]() As SqlBoolean
|
||||
Get
|
||||
Return m_bShowlogin
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bShowlogin = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTmp_filepath]() As SqlString
|
||||
Get
|
||||
Dim s As String
|
||||
s = m_sTmp_filepath.ToString
|
||||
If UCase(s).IndexOf("%APPDATA%") > -1 Then
|
||||
s = s.Replace("%appdata%", System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData))
|
||||
End If
|
||||
m_sTmp_filepath = New SqlString(CType(s, String))
|
||||
Return m_sTmp_filepath
|
||||
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTmp_filepath = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
289
SW/AssessmentMgmt/DB/Generierte Objekte/clsConnectionProvider.vb
Normal file
289
SW/AssessmentMgmt/DB/Generierte Objekte/clsConnectionProvider.vb
Normal file
@@ -0,0 +1,289 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Connection Provider class for Database connection sharing
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // This class implements IDisposable.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Collections
|
||||
|
||||
Namespace DB
|
||||
' /// <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
|
||||
208
SW/AssessmentMgmt/DB/Generierte Objekte/clsDBInteractionBase.vb
Normal file
208
SW/AssessmentMgmt/DB/Generierte Objekte/clsDBInteractionBase.vb
Normal file
@@ -0,0 +1,208 @@
|
||||
' //////////////////////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Base class for Database Interaction.
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // 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 DB
|
||||
' /// <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_iRowsAffected As Integer
|
||||
Protected m_iErrorCode As SqlInt32
|
||||
Protected m_bMainConnectionIsCreatedLocal As Boolean
|
||||
Protected m_cpMainConnectionProvider As clsConnectionProvider
|
||||
Private m_sConnectionString As String
|
||||
Private m_bIsDisposed As Boolean
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
' /// <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
|
||||
Public Readonly Property iRowsAffected() As Integer
|
||||
Get
|
||||
Return m_iRowsAffected
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,390 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsDefinition_Massnahmeplan
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daGueltig_Bis, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iDefinitionNr, m_iMassnahmeplanNr, m_iDefinition_MassnahmeplanNr As SqlInt32
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Massnahmeplan_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iDefinition_MassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iDefinition_MassnahmeplanNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iDefinition_MassnahmeplanNr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iDefinition_MassnahmeplanNr").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_Definition_Massnahmeplan_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("clsDefinition_Massnahmeplan::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Massnahmeplan_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinition_MassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDefinition_MassnahmeplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Definition_Massnahmeplan_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("clsDefinition_Massnahmeplan::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Massnahmeplan_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinition_MassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDefinition_MassnahmeplanNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Definition_Massnahmeplan_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("clsDefinition_Massnahmeplan::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Massnahmeplan_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Definition_Massnahmeplan")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iDefinition_MassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDefinition_MassnahmeplanNr))
|
||||
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_Definition_Massnahmeplan_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iDefinition_MassnahmeplanNr = New SqlInt32(CType(dtToReturn.Rows(0)("Definition_MassnahmeplanNr"), Integer))
|
||||
If dtToReturn.Rows(0)("DefinitionNr") Is System.DBNull.Value Then
|
||||
m_iDefinitionNr = SqlInt32.Null
|
||||
Else
|
||||
m_iDefinitionNr = New SqlInt32(CType(dtToReturn.Rows(0)("DefinitionNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("MassnahmeplanNr") Is System.DBNull.Value Then
|
||||
m_iMassnahmeplanNr = SqlInt32.Null
|
||||
Else
|
||||
m_iMassnahmeplanNr = New SqlInt32(CType(dtToReturn.Rows(0)("MassnahmeplanNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Gueltig_Bis") Is System.DBNull.Value Then
|
||||
m_daGueltig_Bis = SqlDateTime.Null
|
||||
Else
|
||||
m_daGueltig_Bis = New SqlDateTime(CType(dtToReturn.Rows(0)("Gueltig_Bis"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsDefinition_Massnahmeplan::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Massnahmeplan_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Definition_Massnahmeplan")
|
||||
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_Definition_Massnahmeplan_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("clsDefinition_Massnahmeplan::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 [iDefinition_MassnahmeplanNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iDefinition_MassnahmeplanNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iDefinition_MassnahmeplanNrTmp As SqlInt32 = Value
|
||||
If iDefinition_MassnahmeplanNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iDefinition_MassnahmeplanNr", "iDefinition_MassnahmeplanNr can't be NULL")
|
||||
End If
|
||||
m_iDefinition_MassnahmeplanNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iDefinitionNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iDefinitionNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iDefinitionNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMassnahmeplanNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMassnahmeplanNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMassnahmeplanNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daGueltig_Bis]() As SqlDateTime
|
||||
Get
|
||||
Return m_daGueltig_Bis
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daGueltig_Bis = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,390 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsDefinition_Pruefplan
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daGueltig_Bis, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iDefinitionNr, m_iPruefplanNr, m_iDefinition_PruefplanNr As SqlInt32
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Public Overrides Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Pruefplan_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinition_PruefplanNr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iDefinition_PruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iDefinition_PruefplanNr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iDefinition_PruefplanNr").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_Definition_Pruefplan_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("clsDefinition_Pruefplan::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Pruefplan_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinition_PruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDefinition_PruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Definition_Pruefplan_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("clsDefinition_Pruefplan::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Pruefplan_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinition_PruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDefinition_PruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Definition_Pruefplan_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("clsDefinition_Pruefplan::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Pruefplan_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = New DataTable("Definition_Pruefplan")
|
||||
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iDefinition_PruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDefinition_PruefplanNr))
|
||||
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_Definition_Pruefplan_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iDefinition_PruefplanNr = New SqlInt32(CType(dtToReturn.Rows(0)("Definition_PruefplanNr"), Integer))
|
||||
If dtToReturn.Rows(0)("DefinitionNr") Is System.DBNull.Value Then
|
||||
m_iDefinitionNr = SqlInt32.Null
|
||||
Else
|
||||
m_iDefinitionNr = New SqlInt32(CType(dtToReturn.Rows(0)("DefinitionNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("PruefplanNr") Is System.DBNull.Value Then
|
||||
m_iPruefplanNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPruefplanNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefplanNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Gueltig_Bis") Is System.DBNull.Value Then
|
||||
m_daGueltig_Bis = SqlDateTime.Null
|
||||
Else
|
||||
m_daGueltig_Bis = New SqlDateTime(CType(dtToReturn.Rows(0)("Gueltig_Bis"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsDefinition_Pruefplan::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Overrides Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Definition_Pruefplan_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = New DataTable("Definition_Pruefplan")
|
||||
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_Definition_Pruefplan_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("clsDefinition_Pruefplan::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 [iDefinition_PruefplanNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iDefinition_PruefplanNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iDefinition_PruefplanNrTmp As SqlInt32 = Value
|
||||
If iDefinition_PruefplanNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iDefinition_PruefplanNr", "iDefinition_PruefplanNr can't be NULL")
|
||||
End If
|
||||
m_iDefinition_PruefplanNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iDefinitionNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iDefinitionNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iDefinitionNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPruefplanNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefplanNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPruefplanNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daGueltig_Bis]() As SqlDateTime
|
||||
Get
|
||||
Return m_daGueltig_Bis
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daGueltig_Bis = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
526
SW/AssessmentMgmt/DB/Generierte Objekte/clsFinma_Definition.vb
Normal file
526
SW/AssessmentMgmt/DB/Generierte Objekte/clsFinma_Definition.vb
Normal file
@@ -0,0 +1,526 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsFinma_Definition
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iNormaltive_Vorlage, m_iFinmaDefinitionNr, m_iMutierer, m_iKategorie, m_iParentID As SqlInt32
|
||||
Private m_sISO, m_sRef_Kontrolle, m_sKurzbeschreibung, m_sFinmaRS, m_sUnterpunkt_FINMA_RS, m_sGrundsatz_Finma, m_sErgänzungen, m_sDefinition As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Finma_Definition_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFinmaDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFinmaDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFinmaRS", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFinmaRS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sISO", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sISO))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sRef_Kontrolle", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sRef_Kontrolle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKurzbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzbeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iKategorie", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKategorie))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNormaltive_Vorlage", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNormaltive_Vorlage))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sGrundsatz_Finma", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sGrundsatz_Finma))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sUnterpunkt_FINMA_RS", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sUnterpunkt_FINMA_RS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDefinition", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDefinition))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sErgänzungen", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sErgänzungen))
|
||||
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("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Finma_Definition_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("clsFinma_Definition::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Finma_Definition_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFinmaDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFinmaDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFinmaRS", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFinmaRS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sISO", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sISO))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sRef_Kontrolle", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sRef_Kontrolle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKurzbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzbeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iKategorie", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKategorie))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNormaltive_Vorlage", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNormaltive_Vorlage))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sGrundsatz_Finma", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sGrundsatz_Finma))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sUnterpunkt_FINMA_RS", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sUnterpunkt_FINMA_RS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDefinition", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDefinition))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sErgänzungen", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sErgänzungen))
|
||||
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("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Finma_Definition_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("clsFinma_Definition::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Finma_Definition_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFinmaDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFinmaDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Finma_Definition_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("clsFinma_Definition::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Finma_Definition_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Finma_Definition")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iFinmaDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFinmaDefinitionNr))
|
||||
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_Finma_Definition_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iFinmaDefinitionNr = New SqlInt32(CType(dtToReturn.Rows(0)("FinmaDefinitionNr"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("FinmaRS") Is System.DBNull.Value Then
|
||||
m_sFinmaRS = SqlString.Null
|
||||
Else
|
||||
m_sFinmaRS = New SqlString(CType(dtToReturn.Rows(0)("FinmaRS"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ISO") Is System.DBNull.Value Then
|
||||
m_sISO = SqlString.Null
|
||||
Else
|
||||
m_sISO = New SqlString(CType(dtToReturn.Rows(0)("ISO"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Ref_Kontrolle") Is System.DBNull.Value Then
|
||||
m_sRef_Kontrolle = SqlString.Null
|
||||
Else
|
||||
m_sRef_Kontrolle = New SqlString(CType(dtToReturn.Rows(0)("Ref_Kontrolle"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Kurzbeschreibung") Is System.DBNull.Value Then
|
||||
m_sKurzbeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sKurzbeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Kurzbeschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Kategorie") Is System.DBNull.Value Then
|
||||
m_iKategorie = SqlInt32.Null
|
||||
Else
|
||||
m_iKategorie = New SqlInt32(CType(dtToReturn.Rows(0)("Kategorie"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Normaltive_Vorlage") Is System.DBNull.Value Then
|
||||
m_iNormaltive_Vorlage = SqlInt32.Null
|
||||
Else
|
||||
m_iNormaltive_Vorlage = New SqlInt32(CType(dtToReturn.Rows(0)("Normaltive_Vorlage"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Grundsatz_Finma") Is System.DBNull.Value Then
|
||||
m_sGrundsatz_Finma = SqlString.Null
|
||||
Else
|
||||
m_sGrundsatz_Finma = New SqlString(CType(dtToReturn.Rows(0)("Grundsatz_Finma"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Unterpunkt_FINMA_RS") Is System.DBNull.Value Then
|
||||
m_sUnterpunkt_FINMA_RS = SqlString.Null
|
||||
Else
|
||||
m_sUnterpunkt_FINMA_RS = New SqlString(CType(dtToReturn.Rows(0)("Unterpunkt_FINMA_RS"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Definition") Is System.DBNull.Value Then
|
||||
m_sDefinition = SqlString.Null
|
||||
Else
|
||||
m_sDefinition = New SqlString(CType(dtToReturn.Rows(0)("Definition"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Ergänzungen") Is System.DBNull.Value Then
|
||||
m_sErgänzungen = SqlString.Null
|
||||
Else
|
||||
m_sErgänzungen = New SqlString(CType(dtToReturn.Rows(0)("Ergänzungen"), 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
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFinma_Definition::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Finma_Definition_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Finma_Definition")
|
||||
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_Finma_Definition_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("clsFinma_Definition::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 [iFinmaDefinitionNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFinmaDefinitionNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFinmaDefinitionNrTmp As SqlInt32 = Value
|
||||
If iFinmaDefinitionNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFinmaDefinitionNr", "iFinmaDefinitionNr can't be NULL")
|
||||
End If
|
||||
m_iFinmaDefinitionNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFinmaRS]() As SqlString
|
||||
Get
|
||||
Return m_sFinmaRS
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFinmaRS = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sISO]() As SqlString
|
||||
Get
|
||||
Return m_sISO
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sISO = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sRef_Kontrolle]() As SqlString
|
||||
Get
|
||||
Return m_sRef_Kontrolle
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sRef_Kontrolle = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKurzbeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sKurzbeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKurzbeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iKategorie]() As SqlInt32
|
||||
Get
|
||||
Return m_iKategorie
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iKategorie = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iNormaltive_Vorlage]() As SqlInt32
|
||||
Get
|
||||
Return m_iNormaltive_Vorlage
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iNormaltive_Vorlage = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sGrundsatz_Finma]() As SqlString
|
||||
Get
|
||||
Return m_sGrundsatz_Finma
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sGrundsatz_Finma = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sUnterpunkt_FINMA_RS]() As SqlString
|
||||
Get
|
||||
Return m_sUnterpunkt_FINMA_RS
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sUnterpunkt_FINMA_RS = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDefinition]() As SqlString
|
||||
Get
|
||||
Return m_sDefinition
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDefinition = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sErgänzungen]() As SqlString
|
||||
Get
|
||||
Return m_sErgänzungen
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sErgänzungen = 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
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
510
SW/AssessmentMgmt/DB/Generierte Objekte/clsFunktionsgruppe.vb
Normal file
510
SW/AssessmentMgmt/DB/Generierte Objekte/clsFunktionsgruppe.vb
Normal file
@@ -0,0 +1,510 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'funktionsgruppe'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'funktionsgruppe'.
|
||||
''' </summary>
|
||||
Public Class clsFunktionsgruppe
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iFunktionsgruppenr As SqlInt32
|
||||
Private m_sZugehoerigkeit, m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <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>iFunktionsgruppenr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>sZugehoerigkeit. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@szugehoerigkeit", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sZugehoerigkeit))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <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>iFunktionsgruppenr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>sZugehoerigkeit. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@szugehoerigkeit", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sZugehoerigkeit))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <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>iFunktionsgruppenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <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>iFunktionsgruppenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iFunktionsgruppenr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>sZugehoerigkeit</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("funktionsgruppe")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iFunktionsgruppenr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionsgruppenr"), Integer))
|
||||
If dtToReturn.Rows(0)("bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("zugehoerigkeit") Is System.DBNull.Value Then
|
||||
m_sZugehoerigkeit = SqlString.Null
|
||||
Else
|
||||
m_sZugehoerigkeit = New SqlString(CType(dtToReturn.Rows(0)("zugehoerigkeit"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("funktionsgruppe")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iFunktionsgruppenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionsgruppenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFunktionsgruppenrTmp As SqlInt32 = Value
|
||||
If iFunktionsgruppenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFunktionsgruppenr", "iFunktionsgruppenr can't be NULL")
|
||||
End If
|
||||
m_iFunktionsgruppenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sZugehoerigkeit]() As SqlString
|
||||
Get
|
||||
Return m_sZugehoerigkeit
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sZugehoerigkeit = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,489 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'funktionsgruppe_rolle'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'funktionsgruppe_rolle'.
|
||||
''' </summary>
|
||||
Public Class clsFunktionsgruppe_rolle
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iFunktionsgruppenr, m_iFunktionsgrupperollenr, m_iMandantnr, m_iRollenr As SqlInt32
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' <LI>iFunktionsgruppenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_rolle_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionsgrupperollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgrupperollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_rolle_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe_rolle::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' <LI>iFunktionsgruppenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_rolle_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionsgrupperollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgrupperollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_rolle_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe_rolle::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_rolle_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFunktionsgrupperollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgrupperollenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_rolle_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe_rolle::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iFunktionsgrupperollenr</LI>
|
||||
''' <LI>iFunktionsgruppenr</LI>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_rolle_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("funktionsgruppe_rolle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iFunktionsgrupperollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgrupperollenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_rolle_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iFunktionsgrupperollenr = New SqlInt32(CType(dtToReturn.Rows(0)("Funktionsgrupperollenr"), Integer))
|
||||
If dtToReturn.Rows(0)("funktionsgruppenr") Is System.DBNull.Value Then
|
||||
m_iFunktionsgruppenr = SqlInt32.Null
|
||||
Else
|
||||
m_iFunktionsgruppenr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionsgruppenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("rollenr") Is System.DBNull.Value Then
|
||||
m_iRollenr = SqlInt32.Null
|
||||
Else
|
||||
m_iRollenr = New SqlInt32(CType(dtToReturn.Rows(0)("rollenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe_rolle::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_funktionsgruppe_rolle_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("funktionsgruppe_rolle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_funktionsgruppe_rolle_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsFunktionsgruppe_rolle::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iFunktionsgrupperollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionsgrupperollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFunktionsgrupperollenrTmp As SqlInt32 = Value
|
||||
If iFunktionsgrupperollenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFunktionsgrupperollenr", "iFunktionsgrupperollenr can't be NULL")
|
||||
End If
|
||||
m_iFunktionsgrupperollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFunktionsgruppenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionsgruppenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFunktionsgruppenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iRollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iRollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
407
SW/AssessmentMgmt/DB/Generierte Objekte/clsKategorie.vb
Normal file
407
SW/AssessmentMgmt/DB/Generierte Objekte/clsKategorie.vb
Normal file
@@ -0,0 +1,407 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsKategorie
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iKategorienr, m_iParentid As SqlInt32
|
||||
Private m_sBeschreibung_Lang, m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Kategorie_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iKategorienr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKategorienr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iparentid", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung_Lang", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung_Lang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Kategorie_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("clsKategorie::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Kategorie_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iKategorienr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKategorienr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iparentid", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung_Lang", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung_Lang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Kategorie_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("clsKategorie::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Kategorie_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iKategorienr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKategorienr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Kategorie_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("clsKategorie::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Kategorie_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Kategorie")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iKategorienr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKategorienr))
|
||||
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_Kategorie_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iKategorienr = New SqlInt32(CType(dtToReturn.Rows(0)("Kategorienr"), Integer))
|
||||
If dtToReturn.Rows(0)("parentid") Is System.DBNull.Value Then
|
||||
m_iParentid = SqlInt32.Null
|
||||
Else
|
||||
m_iParentid = New SqlInt32(CType(dtToReturn.Rows(0)("parentid"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("Bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung_Lang") Is System.DBNull.Value Then
|
||||
m_sBeschreibung_Lang = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung_Lang = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung_Lang"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsKategorie::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Kategorie_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Kategorie")
|
||||
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_Kategorie_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("clsKategorie::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 [iKategorienr]() As SqlInt32
|
||||
Get
|
||||
Return m_iKategorienr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iKategorienrTmp As SqlInt32 = Value
|
||||
If iKategorienrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iKategorienr", "iKategorienr can't be NULL")
|
||||
End If
|
||||
m_iKategorienr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentid]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentid
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung_Lang]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung_Lang
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung_Lang = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
491
SW/AssessmentMgmt/DB/Generierte Objekte/clsKey_tabelle.vb
Normal file
491
SW/AssessmentMgmt/DB/Generierte Objekte/clsKey_tabelle.vb
Normal file
@@ -0,0 +1,491 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'key_tabelle'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'key_tabelle'.
|
||||
''' </summary>
|
||||
Public Class clsKey_tabelle
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iKeynr, m_iKey_wert, m_iMandantnr As SqlInt32
|
||||
Private m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>iKey_wert</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ikey_wert", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKey_wert))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iKeynr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iKeynr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@ikeynr").Value, Integer))
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_key_tabelle_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsKey_tabelle::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>iKey_wert</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKeynr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ikey_wert", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKey_wert))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_key_tabelle_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsKey_tabelle::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKeynr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_key_tabelle_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsKey_tabelle::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iKeynr</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>iKey_wert</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("key_tabelle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iKeynr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_key_tabelle_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iKeynr = New SqlInt32(CType(dtToReturn.Rows(0)("keynr"), Integer))
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("beschreibung"), String))
|
||||
m_iKey_wert = New SqlInt32(CType(dtToReturn.Rows(0)("key_wert"), Integer))
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsKey_tabelle::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("key_tabelle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_key_tabelle_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsKey_tabelle::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iKeynr]() As SqlInt32
|
||||
Get
|
||||
Return m_iKeynr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iKeynrTmp As SqlInt32 = Value
|
||||
If iKeynrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iKeynr", "iKeynr can't be NULL")
|
||||
End If
|
||||
m_iKeynr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
Dim sBeschreibungTmp As SqlString = Value
|
||||
If sBeschreibungTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("sBeschreibung", "sBeschreibung can't be NULL")
|
||||
End If
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iKey_wert]() As SqlInt32
|
||||
Get
|
||||
Return m_iKey_wert
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iKey_wertTmp As SqlInt32 = Value
|
||||
If iKey_wertTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iKey_wert", "iKey_wert can't be NULL")
|
||||
End If
|
||||
m_iKey_wert = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
476
SW/AssessmentMgmt/DB/Generierte Objekte/clsMassnahme.vb
Normal file
476
SW/AssessmentMgmt/DB/Generierte Objekte/clsMassnahme.vb
Normal file
@@ -0,0 +1,476 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace db
|
||||
Public Class clsMassnahme
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daTermin, m_daMutiert_am, m_daZugewiesen, m_daErstellt_am As SqlDateTime
|
||||
Private m_iAktueller_Verantwortlicher, m_iVerantwortlichNr, m_iVerantwortungIsINr, m_iMassnahmeNr, m_iMutierer, m_iStatusNr, m_iMassnahmeplannr As SqlInt32
|
||||
Private m_sMassnahmeResultat As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahme_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeplannr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeplannr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMassnahmeResultat", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMassnahmeResultat))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortlichNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlichNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungIsINr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungIsINr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAktueller_Verantwortlicher", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAktueller_Verantwortlicher))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daZugewiesen", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daZugewiesen))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iMassnahmeNr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iMassnahmeNr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iMassnahmeNr").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_Massnahme_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("clsMassnahme::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahme_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeplannr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeplannr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMassnahmeResultat", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMassnahmeResultat))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortlichNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlichNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungIsINr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungIsINr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAktueller_Verantwortlicher", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAktueller_Verantwortlicher))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daZugewiesen", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daZugewiesen))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Massnahme_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("clsMassnahme::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahme_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Massnahme_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("clsMassnahme::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahme_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Massnahme")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iMassnahmeNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeNr))
|
||||
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_Massnahme_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMassnahmeNr = New SqlInt32(CType(dtToReturn.Rows(0)("MassnahmeNr"), Integer))
|
||||
If dtToReturn.Rows(0)("Massnahmeplannr") Is System.DBNull.Value Then
|
||||
m_iMassnahmeplannr = SqlInt32.Null
|
||||
Else
|
||||
m_iMassnahmeplannr = New SqlInt32(CType(dtToReturn.Rows(0)("Massnahmeplannr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("StatusNr") Is System.DBNull.Value Then
|
||||
m_iStatusNr = SqlInt32.Null
|
||||
Else
|
||||
m_iStatusNr = New SqlInt32(CType(dtToReturn.Rows(0)("StatusNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("MassnahmeResultat") Is System.DBNull.Value Then
|
||||
m_sMassnahmeResultat = SqlString.Null
|
||||
Else
|
||||
m_sMassnahmeResultat = New SqlString(CType(dtToReturn.Rows(0)("MassnahmeResultat"), String))
|
||||
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)("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)("VerantwortlichNr") Is System.DBNull.Value Then
|
||||
m_iVerantwortlichNr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortlichNr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortlichNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("VerantwortungIsINr") Is System.DBNull.Value Then
|
||||
m_iVerantwortungIsINr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortungIsINr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortungIsINr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktueller_Verantwortlicher") Is System.DBNull.Value Then
|
||||
m_iAktueller_Verantwortlicher = SqlInt32.Null
|
||||
Else
|
||||
m_iAktueller_Verantwortlicher = New SqlInt32(CType(dtToReturn.Rows(0)("Aktueller_Verantwortlicher"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Zugewiesen") Is System.DBNull.Value Then
|
||||
m_daZugewiesen = SqlDateTime.Null
|
||||
Else
|
||||
m_daZugewiesen = New SqlDateTime(CType(dtToReturn.Rows(0)("Zugewiesen"), 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("clsMassnahme::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahme_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Massnahme")
|
||||
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_Massnahme_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("clsMassnahme::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 [iMassnahmeNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMassnahmeNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMassnahmeNrTmp As SqlInt32 = Value
|
||||
If iMassnahmeNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMassnahmeNr", "iMassnahmeNr can't be NULL")
|
||||
End If
|
||||
m_iMassnahmeNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMassnahmeplannr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMassnahmeplannr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMassnahmeplannr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iStatusNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatusNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iStatusNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sMassnahmeResultat]() As SqlString
|
||||
Get
|
||||
Return m_sMassnahmeResultat
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sMassnahmeResultat = 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 [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 [iVerantwortlichNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortlichNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortlichNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortungIsINr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortungIsINr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortungIsINr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iAktueller_Verantwortlicher]() As SqlInt32
|
||||
Get
|
||||
Return m_iAktueller_Verantwortlicher
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAktueller_Verantwortlicher = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daZugewiesen]() As SqlDateTime
|
||||
Get
|
||||
Return m_daZugewiesen
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daZugewiesen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
577
SW/AssessmentMgmt/DB/Generierte Objekte/clsMassnahmeplan.vb
Normal file
577
SW/AssessmentMgmt/DB/Generierte Objekte/clsMassnahmeplan.vb
Normal file
@@ -0,0 +1,577 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsMassnahmeplan
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daGueltig_Bis, m_daErstmals_am, m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iVerantwortlichNr, m_iTerminierungID, m_iMutierer, m_iVerantwortungISINr, m_iPrioritaetNr, m_iPeriodizitaetNr, m_iMassnahmeplanNr, m_iZeitpunktNr As SqlInt32
|
||||
Private m_sBezeichnung, m_sMassnahmen, m_sPruefgegenstand, m_sErgebnisse, m_sHilfsmittel, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahmeplan_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPrioritaetNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPrioritaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPeriodizitaetNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPeriodizitaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iZeitpunktNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iZeitpunktNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstmals_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstmals_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sPruefgegenstand", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sPruefgegenstand))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sHilfsmittel", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sHilfsmittel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMassnahmen", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMassnahmen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sErgebnisse", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sErgebnisse))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortlichNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlichNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungISINr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungISINr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iTerminierungID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTerminierungID))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Massnahmeplan_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("clsMassnahmeplan::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahmeplan_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPrioritaetNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPrioritaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPeriodizitaetNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPeriodizitaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iZeitpunktNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iZeitpunktNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstmals_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstmals_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sPruefgegenstand", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sPruefgegenstand))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sHilfsmittel", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sHilfsmittel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMassnahmen", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMassnahmen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sErgebnisse", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sErgebnisse))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortlichNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlichNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungISINr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungISINr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iTerminierungID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTerminierungID))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Massnahmeplan_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("clsMassnahmeplan::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahmeplan_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeplanNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Massnahmeplan_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("clsMassnahmeplan::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahmeplan_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Massnahmeplan")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iMassnahmeplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeplanNr))
|
||||
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_Massnahmeplan_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMassnahmeplanNr = New SqlInt32(CType(dtToReturn.Rows(0)("MassnahmeplanNr"), 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)("PrioritaetNr") Is System.DBNull.Value Then
|
||||
m_iPrioritaetNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPrioritaetNr = New SqlInt32(CType(dtToReturn.Rows(0)("PrioritaetNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("PeriodizitaetNr") Is System.DBNull.Value Then
|
||||
m_iPeriodizitaetNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPeriodizitaetNr = New SqlInt32(CType(dtToReturn.Rows(0)("PeriodizitaetNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ZeitpunktNr") Is System.DBNull.Value Then
|
||||
m_iZeitpunktNr = SqlInt32.Null
|
||||
Else
|
||||
m_iZeitpunktNr = New SqlInt32(CType(dtToReturn.Rows(0)("ZeitpunktNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstmals_am") Is System.DBNull.Value Then
|
||||
m_daErstmals_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstmals_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstmals_am"), Date))
|
||||
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)("Pruefgegenstand") Is System.DBNull.Value Then
|
||||
m_sPruefgegenstand = SqlString.Null
|
||||
Else
|
||||
m_sPruefgegenstand = New SqlString(CType(dtToReturn.Rows(0)("Pruefgegenstand"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Hilfsmittel") Is System.DBNull.Value Then
|
||||
m_sHilfsmittel = SqlString.Null
|
||||
Else
|
||||
m_sHilfsmittel = New SqlString(CType(dtToReturn.Rows(0)("Hilfsmittel"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Massnahmen") Is System.DBNull.Value Then
|
||||
m_sMassnahmen = SqlString.Null
|
||||
Else
|
||||
m_sMassnahmen = New SqlString(CType(dtToReturn.Rows(0)("Massnahmen"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Ergebnisse") Is System.DBNull.Value Then
|
||||
m_sErgebnisse = SqlString.Null
|
||||
Else
|
||||
m_sErgebnisse = New SqlString(CType(dtToReturn.Rows(0)("Ergebnisse"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("VerantwortlichNr") Is System.DBNull.Value Then
|
||||
m_iVerantwortlichNr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortlichNr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortlichNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("VerantwortungISINr") Is System.DBNull.Value Then
|
||||
m_iVerantwortungISINr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortungISINr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortungISINr"), 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)("Gueltig_Bis") Is System.DBNull.Value Then
|
||||
m_daGueltig_Bis = SqlDateTime.Null
|
||||
Else
|
||||
m_daGueltig_Bis = New SqlDateTime(CType(dtToReturn.Rows(0)("Gueltig_Bis"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("TerminierungID") Is System.DBNull.Value Then
|
||||
m_iTerminierungID = SqlInt32.Null
|
||||
Else
|
||||
m_iTerminierungID = New SqlInt32(CType(dtToReturn.Rows(0)("TerminierungID"), 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("clsMassnahmeplan::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Massnahmeplan_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Massnahmeplan")
|
||||
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_Massnahmeplan_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("clsMassnahmeplan::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 [iMassnahmeplanNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMassnahmeplanNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMassnahmeplanNrTmp As SqlInt32 = Value
|
||||
If iMassnahmeplanNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMassnahmeplanNr", "iMassnahmeplanNr can't be NULL")
|
||||
End If
|
||||
m_iMassnahmeplanNr = 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 [iPrioritaetNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPrioritaetNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPrioritaetNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPeriodizitaetNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPeriodizitaetNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPeriodizitaetNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iZeitpunktNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iZeitpunktNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iZeitpunktNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstmals_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstmals_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstmals_am = 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 [sPruefgegenstand]() As SqlString
|
||||
Get
|
||||
Return m_sPruefgegenstand
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sPruefgegenstand = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sHilfsmittel]() As SqlString
|
||||
Get
|
||||
Return m_sHilfsmittel
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sHilfsmittel = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sMassnahmen]() As SqlString
|
||||
Get
|
||||
Return m_sMassnahmen
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sMassnahmen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sErgebnisse]() As SqlString
|
||||
Get
|
||||
Return m_sErgebnisse
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sErgebnisse = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortlichNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortlichNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortlichNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortungISINr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortungISINr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortungISINr = 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 [daGueltig_Bis]() As SqlDateTime
|
||||
Get
|
||||
Return m_daGueltig_Bis
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daGueltig_Bis = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iTerminierungID]() As SqlInt32
|
||||
Get
|
||||
Return m_iTerminierungID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iTerminierungID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
632
SW/AssessmentMgmt/DB/Generierte Objekte/clsMeldungstexte.vb
Normal file
632
SW/AssessmentMgmt/DB/Generierte Objekte/clsMeldungstexte.vb
Normal file
@@ -0,0 +1,632 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'meldungstexte'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'meldungstexte'.
|
||||
''' </summary>
|
||||
Public Class clsMeldungstexte
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iSprache, m_iMeldungstextnr As SqlInt32
|
||||
Private m_sBeschreibung, m_sInhalt As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>sInhalt. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sinhalt", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sInhalt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMeldungstexte::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>sInhalt. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sinhalt", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sInhalt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMeldungstexte::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMeldungstexte::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method using PK field 'meldungstextnr'. This method will
|
||||
''' delete one or more rows from the database, based on the Primary Key field 'meldungstextnr'.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' </UL>
|
||||
''' </remarks>
|
||||
Public Function DeleteAllWmeldungstextnrLogic() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_DeleteAllWmeldungstextnrLogic]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iMeldungstextnr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@imeldungstextnr").Value, Integer))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_DeleteAllWmeldungstextnrLogic' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMeldungstexte::DeleteAllWmeldungstextnrLogic::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method using PK field 'sprache'. This method will
|
||||
''' delete one or more rows from the database, based on the Primary Key field 'sprache'.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSprache</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' </UL>
|
||||
''' </remarks>
|
||||
Public Function DeleteAllWspracheLogic() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_DeleteAllWspracheLogic]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iSprache = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@isprache").Value, Integer))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_DeleteAllWspracheLogic' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMeldungstexte::DeleteAllWspracheLogic::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iMeldungstextnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>sInhalt</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("meldungstexte")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imeldungstextnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMeldungstextnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMeldungstextnr = New SqlInt32(CType(dtToReturn.Rows(0)("meldungstextnr"), Integer))
|
||||
m_iSprache = New SqlInt32(CType(dtToReturn.Rows(0)("sprache"), Integer))
|
||||
If dtToReturn.Rows(0)("inhalt") Is System.DBNull.Value Then
|
||||
m_sInhalt = SqlString.Null
|
||||
Else
|
||||
m_sInhalt = New SqlString(CType(dtToReturn.Rows(0)("inhalt"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMeldungstexte::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_meldungstexte_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("meldungstexte")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_meldungstexte_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMeldungstexte::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iMeldungstextnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMeldungstextnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMeldungstextnrTmp As SqlInt32 = Value
|
||||
If iMeldungstextnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMeldungstextnr", "iMeldungstextnr can't be NULL")
|
||||
End If
|
||||
m_iMeldungstextnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSprache]() As SqlInt32
|
||||
Get
|
||||
Return m_iSprache
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSpracheTmp As SqlInt32 = Value
|
||||
If iSpracheTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSprache", "iSprache can't be NULL")
|
||||
End If
|
||||
m_iSprache = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sInhalt]() As SqlString
|
||||
Get
|
||||
Return m_sInhalt
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sInhalt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bAktivTmp As SqlBoolean = Value
|
||||
If bAktivTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bAktiv", "bAktiv can't be NULL")
|
||||
End If
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
530
SW/AssessmentMgmt/DB/Generierte Objekte/clsMitarbeiter.vb
Normal file
530
SW/AssessmentMgmt/DB/Generierte Objekte/clsMitarbeiter.vb
Normal file
@@ -0,0 +1,530 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'mitarbeiter'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'mitarbeiter'.
|
||||
''' </summary>
|
||||
Public Class clsMitarbeiter
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMandantnr, m_iMutierer, m_iMitarbeiternr As SqlInt32
|
||||
Private m_sEmail, m_sVorname, m_sTgnummer, m_sName As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' <LI>sVorname. May be SqlString.Null</LI>
|
||||
''' <LI>sName. May be SqlString.Null</LI>
|
||||
''' <LI>sTgnummer. May be SqlString.Null</LI>
|
||||
''' <LI>sEmail. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@svorname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stgnummer", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@semail", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEmail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' <LI>sVorname. May be SqlString.Null</LI>
|
||||
''' <LI>sName. May be SqlString.Null</LI>
|
||||
''' <LI>sTgnummer. May be SqlString.Null</LI>
|
||||
''' <LI>sEmail. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@svorname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stgnummer", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@semail", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEmail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' <LI>sVorname</LI>
|
||||
''' <LI>sName</LI>
|
||||
''' <LI>sTgnummer</LI>
|
||||
''' <LI>sEmail</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMitarbeiternr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiternr"), Integer))
|
||||
If dtToReturn.Rows(0)("vorname") Is System.DBNull.Value Then
|
||||
m_sVorname = SqlString.Null
|
||||
Else
|
||||
m_sVorname = New SqlString(CType(dtToReturn.Rows(0)("vorname"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("name") Is System.DBNull.Value Then
|
||||
m_sName = SqlString.Null
|
||||
Else
|
||||
m_sName = New SqlString(CType(dtToReturn.Rows(0)("name"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tgnummer") Is System.DBNull.Value Then
|
||||
m_sTgnummer = SqlString.Null
|
||||
Else
|
||||
m_sTgnummer = New SqlString(CType(dtToReturn.Rows(0)("tgnummer"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("email") Is System.DBNull.Value Then
|
||||
m_sEmail = SqlString.Null
|
||||
Else
|
||||
m_sEmail = New SqlString(CType(dtToReturn.Rows(0)("email"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iMitarbeiternr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMitarbeiternr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMitarbeiternrTmp As SqlInt32 = Value
|
||||
If iMitarbeiternrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMitarbeiternr", "iMitarbeiternr can't be NULL")
|
||||
End If
|
||||
m_iMitarbeiternr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sVorname]() As SqlString
|
||||
Get
|
||||
Return m_sVorname
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sVorname = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sName]() As SqlString
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTgnummer]() As SqlString
|
||||
Get
|
||||
Return m_sTgnummer
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTgnummer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sEmail]() As SqlString
|
||||
Get
|
||||
Return m_sEmail
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sEmail = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,489 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'mitarbeiter_funktionsgruppe'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'mitarbeiter_funktionsgruppe'.
|
||||
''' </summary>
|
||||
Public Class clsMitarbeiter_funktionsgruppe
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iMitarbeiternr, m_iFunktionsgruppenr, m_iMitarbeiter_funktionsgruppenr As SqlInt32
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' <LI>iMitarbeiternr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFunktionsgruppenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_funktionsgruppe_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiter_funktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiter_funktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_funktionsgruppe_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter_funktionsgruppe::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' <LI>iMitarbeiternr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFunktionsgruppenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_funktionsgruppe_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiter_funktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiter_funktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_funktionsgruppe_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter_funktionsgruppe::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_funktionsgruppe_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiter_funktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiter_funktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_funktionsgruppe_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter_funktionsgruppe::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iMitarbeiter_funktionsgruppenr</LI>
|
||||
''' <LI>iMitarbeiternr</LI>
|
||||
''' <LI>iFunktionsgruppenr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_funktionsgruppe_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter_funktionsgruppe")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiter_funktionsgruppenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiter_funktionsgruppenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_funktionsgruppe_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMitarbeiter_funktionsgruppenr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiter_funktionsgruppenr"), Integer))
|
||||
If dtToReturn.Rows(0)("mitarbeiternr") Is System.DBNull.Value Then
|
||||
m_iMitarbeiternr = SqlInt32.Null
|
||||
Else
|
||||
m_iMitarbeiternr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiternr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("funktionsgruppenr") Is System.DBNull.Value Then
|
||||
m_iFunktionsgruppenr = SqlInt32.Null
|
||||
Else
|
||||
m_iFunktionsgruppenr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionsgruppenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter_funktionsgruppe::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_funktionsgruppe_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter_funktionsgruppe")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_funktionsgruppe_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter_funktionsgruppe::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iMitarbeiter_funktionsgruppenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMitarbeiter_funktionsgruppenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMitarbeiter_funktionsgruppenrTmp As SqlInt32 = Value
|
||||
If iMitarbeiter_funktionsgruppenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMitarbeiter_funktionsgruppenr", "iMitarbeiter_funktionsgruppenr can't be NULL")
|
||||
End If
|
||||
m_iMitarbeiter_funktionsgruppenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMitarbeiternr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMitarbeiternr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMitarbeiternr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFunktionsgruppenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionsgruppenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFunktionsgruppenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
373
SW/AssessmentMgmt/DB/Generierte Objekte/clsPeriodizitaet.vb
Normal file
373
SW/AssessmentMgmt/DB/Generierte Objekte/clsPeriodizitaet.vb
Normal file
@@ -0,0 +1,373 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPeriodizitaet
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iPeriodizitaetNr As SqlInt32
|
||||
Private m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Periodizitaet_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPeriodizitaetNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPeriodizitaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Periodizitaet_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("clsPeriodizitaet::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Periodizitaet_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPeriodizitaetNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPeriodizitaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Periodizitaet_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("clsPeriodizitaet::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Periodizitaet_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPeriodizitaetNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPeriodizitaetNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Periodizitaet_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("clsPeriodizitaet::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Periodizitaet_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Periodizitaet")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPeriodizitaetNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPeriodizitaetNr))
|
||||
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_Periodizitaet_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPeriodizitaetNr = New SqlInt32(CType(dtToReturn.Rows(0)("PeriodizitaetNr"), Integer))
|
||||
If dtToReturn.Rows(0)("Bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("Bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsPeriodizitaet::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Periodizitaet_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Periodizitaet")
|
||||
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_Periodizitaet_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("clsPeriodizitaet::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 [iPeriodizitaetNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPeriodizitaetNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPeriodizitaetNrTmp As SqlInt32 = Value
|
||||
If iPeriodizitaetNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPeriodizitaetNr", "iPeriodizitaetNr can't be NULL")
|
||||
End If
|
||||
m_iPeriodizitaetNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,390 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPruefSchrittHistory
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daEintragdatum, m_daErstellt_am As SqlDateTime
|
||||
Private m_iPruefSchrittHistoryNr, m_iPruefschrittNr, m_iMutierer As SqlInt32
|
||||
Private m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittHistory_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefSchrittHistoryNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefSchrittHistoryNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daEintragdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daEintragdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittHistory_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("clsPruefSchrittHistory::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittHistory_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefSchrittHistoryNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefSchrittHistoryNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daEintragdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daEintragdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittHistory_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("clsPruefSchrittHistory::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittHistory_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefSchrittHistoryNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefSchrittHistoryNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittHistory_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("clsPruefSchrittHistory::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittHistory_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefSchrittHistory")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefSchrittHistoryNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefSchrittHistoryNr))
|
||||
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_PruefSchrittHistory_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPruefSchrittHistoryNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefSchrittHistoryNr"), Integer))
|
||||
If dtToReturn.Rows(0)("PruefschrittNr") Is System.DBNull.Value Then
|
||||
m_iPruefschrittNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPruefschrittNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefschrittNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Eintragdatum") Is System.DBNull.Value Then
|
||||
m_daEintragdatum = SqlDateTime.Null
|
||||
Else
|
||||
m_daEintragdatum = New SqlDateTime(CType(dtToReturn.Rows(0)("Eintragdatum"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsPruefSchrittHistory::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittHistory_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefSchrittHistory")
|
||||
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_PruefSchrittHistory_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("clsPruefSchrittHistory::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 [iPruefSchrittHistoryNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefSchrittHistoryNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPruefSchrittHistoryNrTmp As SqlInt32 = Value
|
||||
If iPruefSchrittHistoryNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPruefSchrittHistoryNr", "iPruefSchrittHistoryNr can't be NULL")
|
||||
End If
|
||||
m_iPruefSchrittHistoryNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPruefschrittNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPruefschrittNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daEintragdatum]() As SqlDateTime
|
||||
Get
|
||||
Return m_daEintragdatum
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daEintragdatum = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,458 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPruefSchrittMassnahme
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daTermin, m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iVerantwortungNr, m_iPruefschrittmassnahmeNr, m_iPruefschrittfindingnr, m_iMassnahmeStatusNr As SqlInt32
|
||||
Private m_sBeschreibung, m_sMassnahmeResultat, m_sKurzbeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittMassnahme_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittmassnahmeNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittmassnahmeNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittfindingnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittfindingnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKurzbeschreibung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzbeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMassnahmeResultat", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMassnahmeResultat))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittMassnahme_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("clsPruefSchrittMassnahme::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittMassnahme_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittmassnahmeNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittmassnahmeNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittfindingnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittfindingnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKurzbeschreibung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzbeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMassnahmeResultat", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMassnahmeResultat))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMassnahmeStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMassnahmeStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittMassnahme_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("clsPruefSchrittMassnahme::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittMassnahme_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittmassnahmeNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittmassnahmeNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittMassnahme_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("clsPruefSchrittMassnahme::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittMassnahme_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefSchrittMassnahme")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefschrittmassnahmeNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittmassnahmeNr))
|
||||
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_PruefSchrittMassnahme_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPruefschrittmassnahmeNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefschrittmassnahmeNr"), Integer))
|
||||
If dtToReturn.Rows(0)("Pruefschrittfindingnr") Is System.DBNull.Value Then
|
||||
m_iPruefschrittfindingnr = SqlInt32.Null
|
||||
Else
|
||||
m_iPruefschrittfindingnr = New SqlInt32(CType(dtToReturn.Rows(0)("Pruefschrittfindingnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Kurzbeschreibung") Is System.DBNull.Value Then
|
||||
m_sKurzbeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sKurzbeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Kurzbeschreibung"), 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)("MassnahmeResultat") Is System.DBNull.Value Then
|
||||
m_sMassnahmeResultat = SqlString.Null
|
||||
Else
|
||||
m_sMassnahmeResultat = New SqlString(CType(dtToReturn.Rows(0)("MassnahmeResultat"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("MassnahmeStatusNr") Is System.DBNull.Value Then
|
||||
m_iMassnahmeStatusNr = SqlInt32.Null
|
||||
Else
|
||||
m_iMassnahmeStatusNr = New SqlInt32(CType(dtToReturn.Rows(0)("MassnahmeStatusNr"), Integer))
|
||||
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)("VerantwortungNr") Is System.DBNull.Value Then
|
||||
m_iVerantwortungNr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortungNr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortungNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsPruefSchrittMassnahme::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittMassnahme_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefSchrittMassnahme")
|
||||
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_PruefSchrittMassnahme_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("clsPruefSchrittMassnahme::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 [iPruefschrittmassnahmeNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittmassnahmeNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPruefschrittmassnahmeNrTmp As SqlInt32 = Value
|
||||
If iPruefschrittmassnahmeNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPruefschrittmassnahmeNr", "iPruefschrittmassnahmeNr can't be NULL")
|
||||
End If
|
||||
m_iPruefschrittmassnahmeNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPruefschrittfindingnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittfindingnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPruefschrittfindingnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKurzbeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sKurzbeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKurzbeschreibung = 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 [sMassnahmeResultat]() As SqlString
|
||||
Get
|
||||
Return m_sMassnahmeResultat
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sMassnahmeResultat = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMassnahmeStatusNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMassnahmeStatusNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMassnahmeStatusNr = 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 [iVerantwortungNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortungNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortungNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,492 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPruefSchrittResultat
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iFindings_mittel, m_iAnzahl_Pruefungen, m_iFindings_hoch, m_iFinding_kein, m_iFindings_niedrig, m_iMutierer, m_iPruefschrittNr, m_iPruefschrittResultatStatusNr, m_iPruefSchrittResultatNr As SqlInt32
|
||||
Private m_sKurzbeschreibung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittResultat_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefSchrittResultatNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefSchrittResultatNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittResultatStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittResultatStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKurzbeschreibung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzbeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAnzahl_Pruefungen", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAnzahl_Pruefungen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFindings_niedrig", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFindings_niedrig))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFindings_mittel", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFindings_mittel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFindings_hoch", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFindings_hoch))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFinding_kein", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFinding_kein))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittResultat_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("clsPruefSchrittResultat::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittResultat_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefSchrittResultatNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefSchrittResultatNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittResultatStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittResultatStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKurzbeschreibung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzbeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAnzahl_Pruefungen", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAnzahl_Pruefungen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFindings_niedrig", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFindings_niedrig))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFindings_mittel", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFindings_mittel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFindings_hoch", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFindings_hoch))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFinding_kein", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFinding_kein))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittResultat_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("clsPruefSchrittResultat::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittResultat_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefSchrittResultatNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefSchrittResultatNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittResultat_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("clsPruefSchrittResultat::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittResultat_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefSchrittResultat")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefSchrittResultatNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefSchrittResultatNr))
|
||||
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_PruefSchrittResultat_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPruefSchrittResultatNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefSchrittResultatNr"), Integer))
|
||||
If dtToReturn.Rows(0)("PruefschrittNr") Is System.DBNull.Value Then
|
||||
m_iPruefschrittNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPruefschrittNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefschrittNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("PruefschrittResultatStatusNr") Is System.DBNull.Value Then
|
||||
m_iPruefschrittResultatStatusNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPruefschrittResultatStatusNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefschrittResultatStatusNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Kurzbeschreibung") Is System.DBNull.Value Then
|
||||
m_sKurzbeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sKurzbeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Kurzbeschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Anzahl_Pruefungen") Is System.DBNull.Value Then
|
||||
m_iAnzahl_Pruefungen = SqlInt32.Null
|
||||
Else
|
||||
m_iAnzahl_Pruefungen = New SqlInt32(CType(dtToReturn.Rows(0)("Anzahl_Pruefungen"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Findings_niedrig") Is System.DBNull.Value Then
|
||||
m_iFindings_niedrig = SqlInt32.Null
|
||||
Else
|
||||
m_iFindings_niedrig = New SqlInt32(CType(dtToReturn.Rows(0)("Findings_niedrig"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Findings_mittel") Is System.DBNull.Value Then
|
||||
m_iFindings_mittel = SqlInt32.Null
|
||||
Else
|
||||
m_iFindings_mittel = New SqlInt32(CType(dtToReturn.Rows(0)("Findings_mittel"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Findings_hoch") Is System.DBNull.Value Then
|
||||
m_iFindings_hoch = SqlInt32.Null
|
||||
Else
|
||||
m_iFindings_hoch = New SqlInt32(CType(dtToReturn.Rows(0)("Findings_hoch"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Finding_kein") Is System.DBNull.Value Then
|
||||
m_iFinding_kein = SqlInt32.Null
|
||||
Else
|
||||
m_iFinding_kein = New SqlInt32(CType(dtToReturn.Rows(0)("Finding_kein"), 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("clsPruefSchrittResultat::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittResultat_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefSchrittResultat")
|
||||
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_PruefSchrittResultat_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("clsPruefSchrittResultat::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 [iPruefSchrittResultatNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefSchrittResultatNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPruefSchrittResultatNrTmp As SqlInt32 = Value
|
||||
If iPruefSchrittResultatNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPruefSchrittResultatNr", "iPruefSchrittResultatNr can't be NULL")
|
||||
End If
|
||||
m_iPruefSchrittResultatNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPruefschrittNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPruefschrittNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPruefschrittResultatStatusNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittResultatStatusNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPruefschrittResultatStatusNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKurzbeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sKurzbeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKurzbeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iAnzahl_Pruefungen]() As SqlInt32
|
||||
Get
|
||||
Return m_iAnzahl_Pruefungen
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAnzahl_Pruefungen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFindings_niedrig]() As SqlInt32
|
||||
Get
|
||||
Return m_iFindings_niedrig
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFindings_niedrig = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFindings_mittel]() As SqlInt32
|
||||
Get
|
||||
Return m_iFindings_mittel
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFindings_mittel = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFindings_hoch]() As SqlInt32
|
||||
Get
|
||||
Return m_iFindings_hoch
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFindings_hoch = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFinding_kein]() As SqlInt32
|
||||
Get
|
||||
Return m_iFinding_kein
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFinding_kein = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
373
SW/AssessmentMgmt/DB/Generierte Objekte/clsPruefSchrittStatus.vb
Normal file
373
SW/AssessmentMgmt/DB/Generierte Objekte/clsPruefSchrittStatus.vb
Normal file
@@ -0,0 +1,373 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPruefSchrittStatus
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iPruefschrittStatusNr As SqlInt32
|
||||
Private m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittStatus_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittStatus_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("clsPruefSchrittStatus::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittStatus_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittStatus_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("clsPruefSchrittStatus::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittStatus_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittStatusNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefSchrittStatus_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("clsPruefSchrittStatus::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittStatus_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefSchrittStatus")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefschrittStatusNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittStatusNr))
|
||||
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_PruefSchrittStatus_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPruefschrittStatusNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefschrittStatusNr"), Integer))
|
||||
If dtToReturn.Rows(0)("Bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("Bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsPruefSchrittStatus::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefSchrittStatus_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefSchrittStatus")
|
||||
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_PruefSchrittStatus_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("clsPruefSchrittStatus::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 [iPruefschrittStatusNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittStatusNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPruefschrittStatusNrTmp As SqlInt32 = Value
|
||||
If iPruefschrittStatusNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPruefschrittStatusNr", "iPruefschrittStatusNr can't be NULL")
|
||||
End If
|
||||
m_iPruefschrittStatusNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
662
SW/AssessmentMgmt/DB/Generierte Objekte/clsPruefplan.vb
Normal file
662
SW/AssessmentMgmt/DB/Generierte Objekte/clsPruefplan.vb
Normal file
@@ -0,0 +1,662 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace db
|
||||
Public Class clsPruefplan
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bSelbstkontrolle, m_bKein_Mailversand, m_bAktiv, m_bDurchfuehrung_ISI As SqlBoolean
|
||||
Private m_daMutiert_am, m_daGueltig_Bis, m_daErstmals_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iVerantwortungPlanNr, m_iMutierer, m_iAssessmentType, m_iPruefplanNr, m_iTerminierungID, m_iPrioritaetNr, m_iPeriodizitaetNr, m_iZeitpunktNr, m_iVerantwortungISINr, m_iVerantwortlichNr As SqlInt32
|
||||
Private m_sBezeichnung, m_sBeschreibung, m_sMassnahmen, m_sErgebnisse, m_sPruefgegenstand, m_sHilfsmittel As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefplan_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPrioritaetNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPrioritaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPeriodizitaetNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPeriodizitaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iZeitpunktNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iZeitpunktNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstmals_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstmals_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sPruefgegenstand", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sPruefgegenstand))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sHilfsmittel", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sHilfsmittel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMassnahmen", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMassnahmen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sErgebnisse", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sErgebnisse))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortlichNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlichNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungISINr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungISINr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iTerminierungID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTerminierungID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungPlanNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungPlanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bKein_Mailversand", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bKein_Mailversand))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bSelbstkontrolle", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bSelbstkontrolle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAssessmentType", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAssessmentType))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bDurchfuehrung_ISI", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bDurchfuehrung_ISI))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Pruefplan_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("clsPruefplan::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefplan_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPrioritaetNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPrioritaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPeriodizitaetNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPeriodizitaetNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iZeitpunktNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iZeitpunktNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstmals_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstmals_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sPruefgegenstand", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sPruefgegenstand))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sHilfsmittel", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sHilfsmittel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMassnahmen", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMassnahmen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sErgebnisse", SqlDbType.VarChar, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sErgebnisse))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortlichNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlichNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungISINr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungISINr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iTerminierungID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTerminierungID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungPlanNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungPlanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bKein_Mailversand", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bKein_Mailversand))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bSelbstkontrolle", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bSelbstkontrolle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAssessmentType", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAssessmentType))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bDurchfuehrung_ISI", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bDurchfuehrung_ISI))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Pruefplan_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("clsPruefplan::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefplan_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Pruefplan_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("clsPruefplan::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefplan_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Pruefplan")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefplanNr))
|
||||
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_Pruefplan_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPruefplanNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefplanNr"), 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)("PrioritaetNr") Is System.DBNull.Value Then
|
||||
m_iPrioritaetNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPrioritaetNr = New SqlInt32(CType(dtToReturn.Rows(0)("PrioritaetNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("PeriodizitaetNr") Is System.DBNull.Value Then
|
||||
m_iPeriodizitaetNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPeriodizitaetNr = New SqlInt32(CType(dtToReturn.Rows(0)("PeriodizitaetNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ZeitpunktNr") Is System.DBNull.Value Then
|
||||
m_iZeitpunktNr = SqlInt32.Null
|
||||
Else
|
||||
m_iZeitpunktNr = New SqlInt32(CType(dtToReturn.Rows(0)("ZeitpunktNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstmals_am") Is System.DBNull.Value Then
|
||||
m_daErstmals_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstmals_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstmals_am"), Date))
|
||||
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)("Pruefgegenstand") Is System.DBNull.Value Then
|
||||
m_sPruefgegenstand = SqlString.Null
|
||||
Else
|
||||
m_sPruefgegenstand = New SqlString(CType(dtToReturn.Rows(0)("Pruefgegenstand"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Hilfsmittel") Is System.DBNull.Value Then
|
||||
m_sHilfsmittel = SqlString.Null
|
||||
Else
|
||||
m_sHilfsmittel = New SqlString(CType(dtToReturn.Rows(0)("Hilfsmittel"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Massnahmen") Is System.DBNull.Value Then
|
||||
m_sMassnahmen = SqlString.Null
|
||||
Else
|
||||
m_sMassnahmen = New SqlString(CType(dtToReturn.Rows(0)("Massnahmen"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Ergebnisse") Is System.DBNull.Value Then
|
||||
m_sErgebnisse = SqlString.Null
|
||||
Else
|
||||
m_sErgebnisse = New SqlString(CType(dtToReturn.Rows(0)("Ergebnisse"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("VerantwortlichNr") Is System.DBNull.Value Then
|
||||
m_iVerantwortlichNr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortlichNr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortlichNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("VerantwortungISINr") Is System.DBNull.Value Then
|
||||
m_iVerantwortungISINr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortungISINr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortungISINr"), 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)("Gueltig_Bis") Is System.DBNull.Value Then
|
||||
m_daGueltig_Bis = SqlDateTime.Null
|
||||
Else
|
||||
m_daGueltig_Bis = New SqlDateTime(CType(dtToReturn.Rows(0)("Gueltig_Bis"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("TerminierungID") Is System.DBNull.Value Then
|
||||
m_iTerminierungID = SqlInt32.Null
|
||||
Else
|
||||
m_iTerminierungID = New SqlInt32(CType(dtToReturn.Rows(0)("TerminierungID"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("VerantwortungPlanNr") Is System.DBNull.Value Then
|
||||
m_iVerantwortungPlanNr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortungPlanNr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortungPlanNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Kein_Mailversand") Is System.DBNull.Value Then
|
||||
m_bKein_Mailversand = SqlBoolean.Null
|
||||
Else
|
||||
m_bKein_Mailversand = New SqlBoolean(CType(dtToReturn.Rows(0)("Kein_Mailversand"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Selbstkontrolle") Is System.DBNull.Value Then
|
||||
m_bSelbstkontrolle = SqlBoolean.Null
|
||||
Else
|
||||
m_bSelbstkontrolle = New SqlBoolean(CType(dtToReturn.Rows(0)("Selbstkontrolle"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("AssessmentType") Is System.DBNull.Value Then
|
||||
m_iAssessmentType = SqlInt32.Null
|
||||
Else
|
||||
m_iAssessmentType = New SqlInt32(CType(dtToReturn.Rows(0)("AssessmentType"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Durchfuehrung_ISI") Is System.DBNull.Value Then
|
||||
m_bDurchfuehrung_ISI = SqlBoolean.Null
|
||||
Else
|
||||
m_bDurchfuehrung_ISI = New SqlBoolean(CType(dtToReturn.Rows(0)("Durchfuehrung_ISI"), 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("clsPruefplan::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefplan_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Pruefplan")
|
||||
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_Pruefplan_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("clsPruefplan::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 [iPruefplanNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefplanNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPruefplanNrTmp As SqlInt32 = Value
|
||||
If iPruefplanNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPruefplanNr", "iPruefplanNr can't be NULL")
|
||||
End If
|
||||
m_iPruefplanNr = 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 [iPrioritaetNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPrioritaetNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPrioritaetNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPeriodizitaetNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPeriodizitaetNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPeriodizitaetNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iZeitpunktNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iZeitpunktNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iZeitpunktNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstmals_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstmals_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstmals_am = 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 [sPruefgegenstand]() As SqlString
|
||||
Get
|
||||
Return m_sPruefgegenstand
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sPruefgegenstand = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sHilfsmittel]() As SqlString
|
||||
Get
|
||||
Return m_sHilfsmittel
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sHilfsmittel = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sMassnahmen]() As SqlString
|
||||
Get
|
||||
Return m_sMassnahmen
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sMassnahmen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sErgebnisse]() As SqlString
|
||||
Get
|
||||
Return m_sErgebnisse
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sErgebnisse = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortlichNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortlichNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortlichNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortungISINr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortungISINr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortungISINr = 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 [daGueltig_Bis]() As SqlDateTime
|
||||
Get
|
||||
Return m_daGueltig_Bis
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daGueltig_Bis = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iTerminierungID]() As SqlInt32
|
||||
Get
|
||||
Return m_iTerminierungID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iTerminierungID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortungPlanNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortungPlanNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortungPlanNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bKein_Mailversand]() As SqlBoolean
|
||||
Get
|
||||
Return m_bKein_Mailversand
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bKein_Mailversand = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bSelbstkontrolle]() As SqlBoolean
|
||||
Get
|
||||
Return m_bSelbstkontrolle
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bSelbstkontrolle = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iAssessmentType]() As SqlInt32
|
||||
Get
|
||||
Return m_iAssessmentType
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAssessmentType = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bDurchfuehrung_ISI]() As SqlBoolean
|
||||
Get
|
||||
Return m_bDurchfuehrung_ISI
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bDurchfuehrung_ISI = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
492
SW/AssessmentMgmt/DB/Generierte Objekte/clsPruefschritt.vb
Normal file
492
SW/AssessmentMgmt/DB/Generierte Objekte/clsPruefschritt.vb
Normal file
@@ -0,0 +1,492 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace db
|
||||
Public Class clsPruefschritt
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv, m_bDurchfuehrung_ISI As SqlBoolean
|
||||
Private m_daTermin, m_daErstellt_am, m_daZugewiesen, m_daMutiert_am As SqlDateTime
|
||||
Private m_iPruefplanNr, m_iMutierer, m_iPruefschrittNr, m_iAssessmenttyp, m_iAktueller_Verantwortlicher, m_iVeramtwortungISINr, m_iStatusnr, m_iVerantwortlichNr As SqlInt32
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschritt_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iStatusnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatusnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortlichNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlichNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAktueller_Verantwortlicher", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAktueller_Verantwortlicher))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVeramtwortungISINr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVeramtwortungISINr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daZugewiesen", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daZugewiesen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAssessmenttyp", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAssessmenttyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bDurchfuehrung_ISI", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bDurchfuehrung_ISI))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefschrittNr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iPruefschrittNr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iPruefschrittNr").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_Pruefschritt_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("clsPruefschritt::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschritt_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefplanNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefplanNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iStatusnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatusnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortlichNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlichNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAktueller_Verantwortlicher", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAktueller_Verantwortlicher))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVeramtwortungISINr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVeramtwortungISINr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daZugewiesen", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daZugewiesen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAssessmenttyp", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAssessmenttyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bDurchfuehrung_ISI", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bDurchfuehrung_ISI))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Pruefschritt_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("clsPruefschritt::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschritt_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Pruefschritt_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("clsPruefschritt::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschritt_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Pruefschritt")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefschrittNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittNr))
|
||||
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_Pruefschritt_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPruefschrittNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefschrittNr"), Integer))
|
||||
If dtToReturn.Rows(0)("PruefplanNr") Is System.DBNull.Value Then
|
||||
m_iPruefplanNr = SqlInt32.Null
|
||||
Else
|
||||
m_iPruefplanNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefplanNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Statusnr") Is System.DBNull.Value Then
|
||||
m_iStatusnr = SqlInt32.Null
|
||||
Else
|
||||
m_iStatusnr = New SqlInt32(CType(dtToReturn.Rows(0)("Statusnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("VerantwortlichNr") Is System.DBNull.Value Then
|
||||
m_iVerantwortlichNr = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortlichNr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortlichNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktueller_Verantwortlicher") Is System.DBNull.Value Then
|
||||
m_iAktueller_Verantwortlicher = SqlInt32.Null
|
||||
Else
|
||||
m_iAktueller_Verantwortlicher = New SqlInt32(CType(dtToReturn.Rows(0)("Aktueller_Verantwortlicher"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("VeramtwortungISINr") Is System.DBNull.Value Then
|
||||
m_iVeramtwortungISINr = SqlInt32.Null
|
||||
Else
|
||||
m_iVeramtwortungISINr = New SqlInt32(CType(dtToReturn.Rows(0)("VeramtwortungISINr"), Integer))
|
||||
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)("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)("Zugewiesen") Is System.DBNull.Value Then
|
||||
m_daZugewiesen = SqlDateTime.Null
|
||||
Else
|
||||
m_daZugewiesen = New SqlDateTime(CType(dtToReturn.Rows(0)("Zugewiesen"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Assessmenttyp") Is System.DBNull.Value Then
|
||||
m_iAssessmenttyp = SqlInt32.Null
|
||||
Else
|
||||
m_iAssessmenttyp = New SqlInt32(CType(dtToReturn.Rows(0)("Assessmenttyp"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Durchfuehrung_ISI") Is System.DBNull.Value Then
|
||||
m_bDurchfuehrung_ISI = SqlBoolean.Null
|
||||
Else
|
||||
m_bDurchfuehrung_ISI = New SqlBoolean(CType(dtToReturn.Rows(0)("Durchfuehrung_ISI"), 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("clsPruefschritt::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschritt_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Pruefschritt")
|
||||
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_Pruefschritt_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("clsPruefschritt::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 [iPruefschrittNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPruefschrittNrTmp As SqlInt32 = Value
|
||||
If iPruefschrittNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPruefschrittNr", "iPruefschrittNr can't be NULL")
|
||||
End If
|
||||
m_iPruefschrittNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPruefplanNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefplanNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPruefplanNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iStatusnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatusnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iStatusnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortlichNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortlichNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortlichNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iAktueller_Verantwortlicher]() As SqlInt32
|
||||
Get
|
||||
Return m_iAktueller_Verantwortlicher
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAktueller_Verantwortlicher = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVeramtwortungISINr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVeramtwortungISINr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVeramtwortungISINr = 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 [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 [daZugewiesen]() As SqlDateTime
|
||||
Get
|
||||
Return m_daZugewiesen
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daZugewiesen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iAssessmenttyp]() As SqlInt32
|
||||
Get
|
||||
Return m_iAssessmenttyp
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAssessmenttyp = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bDurchfuehrung_ISI]() As SqlBoolean
|
||||
Get
|
||||
Return m_bDurchfuehrung_ISI
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bDurchfuehrung_ISI = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,441 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPruefschrittFinding
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iWichtigkeitnr, m_iAuswirkungnr, m_iKritikalitaetnr, m_iPruefschrittresultatnr, m_iPruefschrittfindingNr As SqlInt32
|
||||
Private m_sBeschreibung, m_sBezeichnung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefschrittFinding_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittfindingNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittfindingNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittresultatnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittresultatnr))
|
||||
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, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iWichtigkeitnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWichtigkeitnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iKritikalitaetnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKritikalitaetnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAuswirkungnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAuswirkungnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefschrittFinding_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("clsPruefschrittFinding::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefschrittFinding_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittfindingNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittfindingNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittresultatnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittresultatnr))
|
||||
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, 2048, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iWichtigkeitnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWichtigkeitnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iKritikalitaetnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKritikalitaetnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iAuswirkungnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAuswirkungnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefschrittFinding_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("clsPruefschrittFinding::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefschrittFinding_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittfindingNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittfindingNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_PruefschrittFinding_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("clsPruefschrittFinding::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefschrittFinding_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefschrittFinding")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefschrittfindingNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittfindingNr))
|
||||
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_PruefschrittFinding_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPruefschrittfindingNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefschrittfindingNr"), Integer))
|
||||
If dtToReturn.Rows(0)("Pruefschrittresultatnr") Is System.DBNull.Value Then
|
||||
m_iPruefschrittresultatnr = SqlInt32.Null
|
||||
Else
|
||||
m_iPruefschrittresultatnr = New SqlInt32(CType(dtToReturn.Rows(0)("Pruefschrittresultatnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("Bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("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)("Wichtigkeitnr") Is System.DBNull.Value Then
|
||||
m_iWichtigkeitnr = SqlInt32.Null
|
||||
Else
|
||||
m_iWichtigkeitnr = New SqlInt32(CType(dtToReturn.Rows(0)("Wichtigkeitnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Kritikalitaetnr") Is System.DBNull.Value Then
|
||||
m_iKritikalitaetnr = SqlInt32.Null
|
||||
Else
|
||||
m_iKritikalitaetnr = New SqlInt32(CType(dtToReturn.Rows(0)("Kritikalitaetnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Auswirkungnr") Is System.DBNull.Value Then
|
||||
m_iAuswirkungnr = SqlInt32.Null
|
||||
Else
|
||||
m_iAuswirkungnr = New SqlInt32(CType(dtToReturn.Rows(0)("Auswirkungnr"), 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("clsPruefschrittFinding::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_PruefschrittFinding_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("PruefschrittFinding")
|
||||
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_PruefschrittFinding_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("clsPruefschrittFinding::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 [iPruefschrittfindingNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittfindingNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPruefschrittfindingNrTmp As SqlInt32 = Value
|
||||
If iPruefschrittfindingNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPruefschrittfindingNr", "iPruefschrittfindingNr can't be NULL")
|
||||
End If
|
||||
m_iPruefschrittfindingNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPruefschrittresultatnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittresultatnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPruefschrittresultatnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iWichtigkeitnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iWichtigkeitnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iWichtigkeitnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iKritikalitaetnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iKritikalitaetnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iKritikalitaetnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iAuswirkungnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iAuswirkungnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAuswirkungnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
373
SW/AssessmentMgmt/DB/Generierte Objekte/clsPruefschrittnotiz.vb
Normal file
373
SW/AssessmentMgmt/DB/Generierte Objekte/clsPruefschrittnotiz.vb
Normal file
@@ -0,0 +1,373 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsPruefschrittnotiz
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iPruefschrittnr, m_iPruefschrittnotizNr As SqlInt32
|
||||
Private m_sNotiz As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschrittnotiz_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittnotizNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittnotizNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNotiz", SqlDbType.VarChar, 4098, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNotiz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Pruefschrittnotiz_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("clsPruefschrittnotiz::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschrittnotiz_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittnotizNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittnotizNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNotiz", SqlDbType.VarChar, 4098, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNotiz))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Pruefschrittnotiz_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("clsPruefschrittnotiz::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschrittnotiz_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iPruefschrittnotizNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittnotizNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Pruefschrittnotiz_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("clsPruefschrittnotiz::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschrittnotiz_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Pruefschrittnotiz")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iPruefschrittnotizNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPruefschrittnotizNr))
|
||||
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_Pruefschrittnotiz_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iPruefschrittnotizNr = New SqlInt32(CType(dtToReturn.Rows(0)("PruefschrittnotizNr"), Integer))
|
||||
If dtToReturn.Rows(0)("Pruefschrittnr") Is System.DBNull.Value Then
|
||||
m_iPruefschrittnr = SqlInt32.Null
|
||||
Else
|
||||
m_iPruefschrittnr = New SqlInt32(CType(dtToReturn.Rows(0)("Pruefschrittnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Notiz") Is System.DBNull.Value Then
|
||||
m_sNotiz = SqlString.Null
|
||||
Else
|
||||
m_sNotiz = New SqlString(CType(dtToReturn.Rows(0)("Notiz"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsPruefschrittnotiz::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Pruefschrittnotiz_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Pruefschrittnotiz")
|
||||
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_Pruefschrittnotiz_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("clsPruefschrittnotiz::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 [iPruefschrittnotizNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittnotizNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPruefschrittnotizNrTmp As SqlInt32 = Value
|
||||
If iPruefschrittnotizNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPruefschrittnotizNr", "iPruefschrittnotizNr can't be NULL")
|
||||
End If
|
||||
m_iPruefschrittnotizNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPruefschrittnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPruefschrittnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPruefschrittnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNotiz]() As SqlString
|
||||
Get
|
||||
Return m_sNotiz
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNotiz = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
510
SW/AssessmentMgmt/DB/Generierte Objekte/clsRolle.vb
Normal file
510
SW/AssessmentMgmt/DB/Generierte Objekte/clsRolle.vb
Normal file
@@ -0,0 +1,510 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'rolle'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'rolle'.
|
||||
''' </summary>
|
||||
Public Class clsRolle
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bSysadminrolle, m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iRollenr, m_iMandantnr As SqlInt32
|
||||
Private m_sBeschreibung, m_sBezeichnung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bSysadminrolle. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bsysadminrolle", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bSysadminrolle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>bSysadminrolle. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bsysadminrolle", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bSysadminrolle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>bSysadminrolle</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("rolle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iRollenr = New SqlInt32(CType(dtToReturn.Rows(0)("rollenr"), Integer))
|
||||
If dtToReturn.Rows(0)("bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("sysadminrolle") Is System.DBNull.Value Then
|
||||
m_bSysadminrolle = SqlBoolean.Null
|
||||
Else
|
||||
m_bSysadminrolle = New SqlBoolean(CType(dtToReturn.Rows(0)("sysadminrolle"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("rolle")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iRollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iRollenrTmp As SqlInt32 = Value
|
||||
If iRollenrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iRollenr", "iRollenr can't be NULL")
|
||||
End If
|
||||
m_iRollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bSysadminrolle]() As SqlBoolean
|
||||
Get
|
||||
Return m_bSysadminrolle
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bSysadminrolle = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,529 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Rolle_SecurityObject'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'Rolle_SecurityObject'.
|
||||
''' </summary>
|
||||
Public Class clsRolle_SecurityObject
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bReadonly, m_bAktiv, m_bInvisible As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iMandantnr, m_iRollenr, m_iSecurityobjectnr, m_iRolle_securityobjectnr As SqlInt32
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSecurityobjectnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bReadonly. May be SqlBoolean.Null</LI>
|
||||
''' <LI>bInvisible. May be SqlBoolean.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Rolle_SecurityObject_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_securityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_securityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isecurityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSecurityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@breadonly", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bReadonly))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@binvisible", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bInvisible))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Rolle_SecurityObject_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_SecurityObject::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSecurityobjectnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>bReadonly. May be SqlBoolean.Null</LI>
|
||||
''' <LI>bInvisible. May be SqlBoolean.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Rolle_SecurityObject_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_securityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_securityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isecurityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSecurityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@breadonly", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bReadonly))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@binvisible", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bInvisible))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Rolle_SecurityObject_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_SecurityObject::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Rolle_SecurityObject_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_securityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_securityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Rolle_SecurityObject_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_SecurityObject::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iRolle_securityobjectnr</LI>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>iSecurityobjectnr</LI>
|
||||
''' <LI>bReadonly</LI>
|
||||
''' <LI>bInvisible</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Rolle_SecurityObject_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Rolle_SecurityObject")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@irolle_securityobjectnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_securityobjectnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Rolle_SecurityObject_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iRolle_securityobjectnr = New SqlInt32(CType(dtToReturn.Rows(0)("rolle_securityobjectnr"), Integer))
|
||||
If dtToReturn.Rows(0)("rollenr") Is System.DBNull.Value Then
|
||||
m_iRollenr = SqlInt32.Null
|
||||
Else
|
||||
m_iRollenr = New SqlInt32(CType(dtToReturn.Rows(0)("rollenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("securityobjectnr") Is System.DBNull.Value Then
|
||||
m_iSecurityobjectnr = SqlInt32.Null
|
||||
Else
|
||||
m_iSecurityobjectnr = New SqlInt32(CType(dtToReturn.Rows(0)("securityobjectnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("readonly") Is System.DBNull.Value Then
|
||||
m_bReadonly = SqlBoolean.Null
|
||||
Else
|
||||
m_bReadonly = New SqlBoolean(CType(dtToReturn.Rows(0)("readonly"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("invisible") Is System.DBNull.Value Then
|
||||
m_bInvisible = SqlBoolean.Null
|
||||
Else
|
||||
m_bInvisible = New SqlBoolean(CType(dtToReturn.Rows(0)("invisible"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_SecurityObject::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Rolle_SecurityObject_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Rolle_SecurityObject")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Rolle_SecurityObject_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_SecurityObject::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iRolle_securityobjectnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRolle_securityobjectnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iRolle_securityobjectnrTmp As SqlInt32 = Value
|
||||
If iRolle_securityobjectnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iRolle_securityobjectnr", "iRolle_securityobjectnr can't be NULL")
|
||||
End If
|
||||
m_iRolle_securityobjectnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iRollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iRollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSecurityobjectnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSecurityobjectnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSecurityobjectnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bReadonly]() As SqlBoolean
|
||||
Get
|
||||
Return m_bReadonly
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bReadonly = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bInvisible]() As SqlBoolean
|
||||
Get
|
||||
Return m_bInvisible
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bInvisible = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,489 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'rolle_sysadminfunktion'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'rolle_sysadminfunktion'.
|
||||
''' </summary>
|
||||
Public Class clsRolle_sysadminfunktion
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iRollenr, m_iMandant, m_iSysadminfnktnr, m_iRolle_sysadminfnktnr, m_iMutierer As SqlInt32
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSysadminfnktnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandant. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_sysadminfunktion_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_sysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_sysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandant", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandant))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_sysadminfunktion_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_sysadminfunktion::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSysadminfnktnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iRollenr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandant. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_sysadminfunktion_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_sysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_sysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irollenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iRollenr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandant", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandant))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_sysadminfunktion_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_sysadminfunktion::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_sysadminfunktion_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@irolle_sysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_sysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_sysadminfunktion_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_sysadminfunktion::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iRolle_sysadminfnktnr</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' <LI>iRollenr</LI>
|
||||
''' <LI>iMandant</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_sysadminfunktion_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("rolle_sysadminfunktion")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@irolle_sysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iRolle_sysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_sysadminfunktion_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iRolle_sysadminfnktnr = New SqlInt32(CType(dtToReturn.Rows(0)("rolle_sysadminfnktnr"), Integer))
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("sysadminfnktnr") Is System.DBNull.Value Then
|
||||
m_iSysadminfnktnr = SqlInt32.Null
|
||||
Else
|
||||
m_iSysadminfnktnr = New SqlInt32(CType(dtToReturn.Rows(0)("sysadminfnktnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("rollenr") Is System.DBNull.Value Then
|
||||
m_iRollenr = SqlInt32.Null
|
||||
Else
|
||||
m_iRollenr = New SqlInt32(CType(dtToReturn.Rows(0)("rollenr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandant") Is System.DBNull.Value Then
|
||||
m_iMandant = SqlInt32.Null
|
||||
Else
|
||||
m_iMandant = New SqlInt32(CType(dtToReturn.Rows(0)("mandant"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_sysadminfunktion::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_rolle_sysadminfunktion_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("rolle_sysadminfunktion")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_rolle_sysadminfunktion_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsRolle_sysadminfunktion::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iRolle_sysadminfnktnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRolle_sysadminfnktnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iRolle_sysadminfnktnrTmp As SqlInt32 = Value
|
||||
If iRolle_sysadminfnktnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iRolle_sysadminfnktnr", "iRolle_sysadminfnktnr can't be NULL")
|
||||
End If
|
||||
m_iRolle_sysadminfnktnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSysadminfnktnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSysadminfnktnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSysadminfnktnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iRollenr]() As SqlInt32
|
||||
Get
|
||||
Return m_iRollenr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iRollenr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandant]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandant
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandant = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
570
SW/AssessmentMgmt/DB/Generierte Objekte/clsSecurityObject.vb
Normal file
570
SW/AssessmentMgmt/DB/Generierte Objekte/clsSecurityObject.vb
Normal file
@@ -0,0 +1,570 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'SecurityObject'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 19:36:38
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'SecurityObject'.
|
||||
''' </summary>
|
||||
Public Class clsSecurityObject
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iLevel, m_iMutierer, m_iMandantnr, m_iSecurityObjectNr As SqlInt32
|
||||
Private m_sSecurityForm, m_sSecurityObjectDescriotion, m_sSecurityObjectItem, m_sSecurityObject, m_sSecurityObjectType As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' <LI>sSecurityForm. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectType. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObject. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectItem. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectDescriotion. May be SqlString.Null</LI>
|
||||
''' <LI>iLevel. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_SecurityObject_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSecurityObjectNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSecurityObjectNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityForm", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityForm))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectType", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectType))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObject", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObject))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectItem", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectItem))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectDescriotion", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectDescriotion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iLevel", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iLevel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_SecurityObject_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSecurityObject::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' <LI>sSecurityForm. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectType. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObject. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectItem. May be SqlString.Null</LI>
|
||||
''' <LI>sSecurityObjectDescriotion. May be SqlString.Null</LI>
|
||||
''' <LI>iLevel. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_SecurityObject_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSecurityObjectNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSecurityObjectNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityForm", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityForm))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectType", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectType))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObject", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObject))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectItem", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectItem))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSecurityObjectDescriotion", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSecurityObjectDescriotion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iLevel", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iLevel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_SecurityObject_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSecurityObject::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_SecurityObject_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSecurityObjectNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSecurityObjectNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_SecurityObject_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSecurityObject::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iSecurityObjectNr</LI>
|
||||
''' <LI>sSecurityForm</LI>
|
||||
''' <LI>sSecurityObjectType</LI>
|
||||
''' <LI>sSecurityObject</LI>
|
||||
''' <LI>sSecurityObjectItem</LI>
|
||||
''' <LI>sSecurityObjectDescriotion</LI>
|
||||
''' <LI>iLevel</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_SecurityObject_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("SecurityObject")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iSecurityObjectNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSecurityObjectNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_SecurityObject_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iSecurityObjectNr = New SqlInt32(CType(dtToReturn.Rows(0)("SecurityObjectNr"), Integer))
|
||||
If dtToReturn.Rows(0)("SecurityForm") Is System.DBNull.Value Then
|
||||
m_sSecurityForm = SqlString.Null
|
||||
Else
|
||||
m_sSecurityForm = New SqlString(CType(dtToReturn.Rows(0)("SecurityForm"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SecurityObjectType") Is System.DBNull.Value Then
|
||||
m_sSecurityObjectType = SqlString.Null
|
||||
Else
|
||||
m_sSecurityObjectType = New SqlString(CType(dtToReturn.Rows(0)("SecurityObjectType"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SecurityObject") Is System.DBNull.Value Then
|
||||
m_sSecurityObject = SqlString.Null
|
||||
Else
|
||||
m_sSecurityObject = New SqlString(CType(dtToReturn.Rows(0)("SecurityObject"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SecurityObjectItem") Is System.DBNull.Value Then
|
||||
m_sSecurityObjectItem = SqlString.Null
|
||||
Else
|
||||
m_sSecurityObjectItem = New SqlString(CType(dtToReturn.Rows(0)("SecurityObjectItem"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SecurityObjectDescriotion") Is System.DBNull.Value Then
|
||||
m_sSecurityObjectDescriotion = SqlString.Null
|
||||
Else
|
||||
m_sSecurityObjectDescriotion = New SqlString(CType(dtToReturn.Rows(0)("SecurityObjectDescriotion"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Level") Is System.DBNull.Value Then
|
||||
m_iLevel = SqlInt32.Null
|
||||
Else
|
||||
m_iLevel = New SqlInt32(CType(dtToReturn.Rows(0)("Level"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("Mandantnr"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSecurityObject::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_SecurityObject_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("SecurityObject")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_SecurityObject_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSecurityObject::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iSecurityObjectNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSecurityObjectNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSecurityObjectNrTmp As SqlInt32 = Value
|
||||
If iSecurityObjectNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSecurityObjectNr", "iSecurityObjectNr can't be NULL")
|
||||
End If
|
||||
m_iSecurityObjectNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityForm]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityForm
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityForm = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityObjectType]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityObjectType
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityObjectType = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityObject]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityObject
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityObject = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityObjectItem]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityObjectItem
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityObjectItem = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSecurityObjectDescriotion]() As SqlString
|
||||
Get
|
||||
Return m_sSecurityObjectDescriotion
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSecurityObjectDescriotion = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iLevel]() As SqlInt32
|
||||
Get
|
||||
Return m_iLevel
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iLevel = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
630
SW/AssessmentMgmt/DB/Generierte Objekte/clsSpalten.vb
Normal file
630
SW/AssessmentMgmt/DB/Generierte Objekte/clsSpalten.vb
Normal file
@@ -0,0 +1,630 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'spalten'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 13:15:45
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace db
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'spalten'.
|
||||
''' </summary>
|
||||
Public Class clsSpalten
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bReadonly, m_bAlsHacken, m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMandantnr, m_iMutierer, m_iReihenfolge, m_iEintragnr, m_iBreite As SqlInt32
|
||||
Private m_sTabelle, m_sNumberFormat, m_sTiptext, m_sSpalte, m_sTabellenspalte As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' <LI>sTabelle. May be SqlString.Null</LI>
|
||||
''' <LI>sTabellenspalte. May be SqlString.Null</LI>
|
||||
''' <LI>sSpalte. May be SqlString.Null</LI>
|
||||
''' <LI>bReadonly</LI>
|
||||
''' <LI>bAlsHacken</LI>
|
||||
''' <LI>iBreite. May be SqlInt32.Null</LI>
|
||||
''' <LI>iReihenfolge. May be SqlInt32.Null</LI>
|
||||
''' <LI>sTiptext. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>sNumberFormat. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_spalten_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ieintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stabelle", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTabelle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stabellenspalte", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTabellenspalte))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sspalte", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSpalte))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bReadonly", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bReadonly))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@balsHacken", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAlsHacken))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iBreite", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBreite))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReihenfolge", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iReihenfolge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stiptext", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTiptext))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNumberFormat", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNumberFormat))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_spalten_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSpalten::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' <LI>sTabelle. May be SqlString.Null</LI>
|
||||
''' <LI>sTabellenspalte. May be SqlString.Null</LI>
|
||||
''' <LI>sSpalte. May be SqlString.Null</LI>
|
||||
''' <LI>bReadonly</LI>
|
||||
''' <LI>bAlsHacken</LI>
|
||||
''' <LI>iBreite. May be SqlInt32.Null</LI>
|
||||
''' <LI>iReihenfolge. May be SqlInt32.Null</LI>
|
||||
''' <LI>sTiptext. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>sNumberFormat. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_spalten_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ieintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stabelle", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTabelle))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stabellenspalte", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTabellenspalte))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sspalte", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSpalte))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bReadonly", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bReadonly))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@balsHacken", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAlsHacken))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iBreite", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBreite))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iReihenfolge", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iReihenfolge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stiptext", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTiptext))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNumberFormat", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNumberFormat))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_spalten_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSpalten::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_spalten_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ieintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_spalten_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSpalten::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iEintragnr</LI>
|
||||
''' <LI>sTabelle</LI>
|
||||
''' <LI>sTabellenspalte</LI>
|
||||
''' <LI>sSpalte</LI>
|
||||
''' <LI>bReadonly</LI>
|
||||
''' <LI>bAlsHacken</LI>
|
||||
''' <LI>iBreite</LI>
|
||||
''' <LI>iReihenfolge</LI>
|
||||
''' <LI>sTiptext</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>sNumberFormat</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_spalten_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("spalten")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ieintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_spalten_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iEintragnr = New SqlInt32(CType(dtToReturn.Rows(0)("eintragnr"), Integer))
|
||||
If dtToReturn.Rows(0)("tabelle") Is System.DBNull.Value Then
|
||||
m_sTabelle = SqlString.Null
|
||||
Else
|
||||
m_sTabelle = New SqlString(CType(dtToReturn.Rows(0)("tabelle"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tabellenspalte") Is System.DBNull.Value Then
|
||||
m_sTabellenspalte = SqlString.Null
|
||||
Else
|
||||
m_sTabellenspalte = New SqlString(CType(dtToReturn.Rows(0)("tabellenspalte"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("spalte") Is System.DBNull.Value Then
|
||||
m_sSpalte = SqlString.Null
|
||||
Else
|
||||
m_sSpalte = New SqlString(CType(dtToReturn.Rows(0)("spalte"), String))
|
||||
End If
|
||||
m_bReadonly = New SqlBoolean(CType(dtToReturn.Rows(0)("Readonly"), Boolean))
|
||||
m_bAlsHacken = New SqlBoolean(CType(dtToReturn.Rows(0)("alsHacken"), Boolean))
|
||||
If dtToReturn.Rows(0)("Breite") Is System.DBNull.Value Then
|
||||
m_iBreite = SqlInt32.Null
|
||||
Else
|
||||
m_iBreite = New SqlInt32(CType(dtToReturn.Rows(0)("Breite"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Reihenfolge") Is System.DBNull.Value Then
|
||||
m_iReihenfolge = SqlInt32.Null
|
||||
Else
|
||||
m_iReihenfolge = New SqlInt32(CType(dtToReturn.Rows(0)("Reihenfolge"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tiptext") Is System.DBNull.Value Then
|
||||
m_sTiptext = SqlString.Null
|
||||
Else
|
||||
m_sTiptext = New SqlString(CType(dtToReturn.Rows(0)("tiptext"), String))
|
||||
End If
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NumberFormat") Is System.DBNull.Value Then
|
||||
m_sNumberFormat = SqlString.Null
|
||||
Else
|
||||
m_sNumberFormat = New SqlString(CType(dtToReturn.Rows(0)("NumberFormat"), String))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSpalten::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_spalten_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("spalten")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_spalten_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSpalten::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iEintragnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iEintragnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iEintragnrTmp As SqlInt32 = Value
|
||||
If iEintragnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iEintragnr", "iEintragnr can't be NULL")
|
||||
End If
|
||||
m_iEintragnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTabelle]() As SqlString
|
||||
Get
|
||||
Return m_sTabelle
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTabelle = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTabellenspalte]() As SqlString
|
||||
Get
|
||||
Return m_sTabellenspalte
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTabellenspalte = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSpalte]() As SqlString
|
||||
Get
|
||||
Return m_sSpalte
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSpalte = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bReadonly]() As SqlBoolean
|
||||
Get
|
||||
Return m_bReadonly
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bReadonlyTmp As SqlBoolean = Value
|
||||
If bReadonlyTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bReadonly", "bReadonly can't be NULL")
|
||||
End If
|
||||
m_bReadonly = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAlsHacken]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAlsHacken
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bAlsHackenTmp As SqlBoolean = Value
|
||||
If bAlsHackenTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bAlsHacken", "bAlsHacken can't be NULL")
|
||||
End If
|
||||
m_bAlsHacken = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBreite]() As SqlInt32
|
||||
Get
|
||||
Return m_iBreite
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iBreite = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iReihenfolge]() As SqlInt32
|
||||
Get
|
||||
Return m_iReihenfolge
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iReihenfolge = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTiptext]() As SqlString
|
||||
Get
|
||||
Return m_sTiptext
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTiptext = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bAktivTmp As SqlBoolean = Value
|
||||
If bAktivTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bAktiv", "bAktiv can't be NULL")
|
||||
End If
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNumberFormat]() As SqlString
|
||||
Get
|
||||
Return m_sNumberFormat
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNumberFormat = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
710
SW/AssessmentMgmt/DB/Generierte Objekte/clsSysadminfunktion.vb
Normal file
710
SW/AssessmentMgmt/DB/Generierte Objekte/clsSysadminfunktion.vb
Normal file
@@ -0,0 +1,710 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'sysadminfunktion'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 18:17:09
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'sysadminfunktion'.
|
||||
''' </summary>
|
||||
Public Class clsSysadminfunktion
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iFheight, m_iFwidth, m_iMandantnr, m_iMutierer, m_iSprache, m_iSort, m_iImageIndex, m_iSysadminfnktnr, m_iParentID, m_iFtop, m_iFleft, m_iImageIndexOpen As SqlInt32
|
||||
Private m_sKeyFields, m_sDomaintable, m_sBeschreibung, m_sBezeichnung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>iParentID. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSort. May be SqlInt32.Null</LI>
|
||||
''' <LI>iImageIndex. May be SqlInt32.Null</LI>
|
||||
''' <LI>iImageIndexOpen. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFtop. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFleft. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFwidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFheight. May be SqlInt32.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sDomaintable. May be SqlString.Null</LI>
|
||||
''' <LI>sKeyFields. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_sysadminfunktion_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSort", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSort))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImageIndex", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImageIndex))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImageIndexOpen", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImageIndexOpen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iftop", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFtop))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifleft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFleft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifwidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFwidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifheight", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFheight))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDomaintable", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDomaintable))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKeyFields", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKeyFields))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_sysadminfunktion_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSysadminfunktion::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>iParentID. May be SqlInt32.Null</LI>
|
||||
''' <LI>iSort. May be SqlInt32.Null</LI>
|
||||
''' <LI>iImageIndex. May be SqlInt32.Null</LI>
|
||||
''' <LI>iImageIndexOpen. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFtop. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFleft. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFwidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFheight. May be SqlInt32.Null</LI>
|
||||
''' <LI>sBeschreibung. May be SqlString.Null</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>sDomaintable. May be SqlString.Null</LI>
|
||||
''' <LI>sKeyFields. May be SqlString.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_sysadminfunktion_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSort", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSort))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImageIndex", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImageIndex))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImageIndexOpen", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImageIndexOpen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iftop", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFtop))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifleft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFleft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifwidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFwidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifheight", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFheight))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDomaintable", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDomaintable))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKeyFields", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKeyFields))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_sysadminfunktion_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSysadminfunktion::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_sysadminfunktion_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_sysadminfunktion_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSysadminfunktion::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iSysadminfnktnr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>iParentID</LI>
|
||||
''' <LI>iSort</LI>
|
||||
''' <LI>iImageIndex</LI>
|
||||
''' <LI>iImageIndexOpen</LI>
|
||||
''' <LI>iFtop</LI>
|
||||
''' <LI>iFleft</LI>
|
||||
''' <LI>iFwidth</LI>
|
||||
''' <LI>iFheight</LI>
|
||||
''' <LI>sBeschreibung</LI>
|
||||
''' <LI>iMandantnr</LI>
|
||||
''' <LI>iSprache</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>sDomaintable</LI>
|
||||
''' <LI>sKeyFields</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_sysadminfunktion_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("sysadminfunktion")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@isysadminfnktnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSysadminfnktnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_sysadminfunktion_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iSysadminfnktnr = New SqlInt32(CType(dtToReturn.Rows(0)("sysadminfnktnr"), Integer))
|
||||
If dtToReturn.Rows(0)("bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Sort") Is System.DBNull.Value Then
|
||||
m_iSort = SqlInt32.Null
|
||||
Else
|
||||
m_iSort = New SqlInt32(CType(dtToReturn.Rows(0)("Sort"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ImageIndex") Is System.DBNull.Value Then
|
||||
m_iImageIndex = SqlInt32.Null
|
||||
Else
|
||||
m_iImageIndex = New SqlInt32(CType(dtToReturn.Rows(0)("ImageIndex"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ImageIndexOpen") Is System.DBNull.Value Then
|
||||
m_iImageIndexOpen = SqlInt32.Null
|
||||
Else
|
||||
m_iImageIndexOpen = New SqlInt32(CType(dtToReturn.Rows(0)("ImageIndexOpen"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ftop") Is System.DBNull.Value Then
|
||||
m_iFtop = SqlInt32.Null
|
||||
Else
|
||||
m_iFtop = New SqlInt32(CType(dtToReturn.Rows(0)("ftop"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fleft") Is System.DBNull.Value Then
|
||||
m_iFleft = SqlInt32.Null
|
||||
Else
|
||||
m_iFleft = New SqlInt32(CType(dtToReturn.Rows(0)("fleft"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fwidth") Is System.DBNull.Value Then
|
||||
m_iFwidth = SqlInt32.Null
|
||||
Else
|
||||
m_iFwidth = New SqlInt32(CType(dtToReturn.Rows(0)("fwidth"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fheight") Is System.DBNull.Value Then
|
||||
m_iFheight = SqlInt32.Null
|
||||
Else
|
||||
m_iFheight = New SqlInt32(CType(dtToReturn.Rows(0)("fheight"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("beschreibung"), String))
|
||||
End If
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
m_iSprache = New SqlInt32(CType(dtToReturn.Rows(0)("sprache"), Integer))
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Domaintable") Is System.DBNull.Value Then
|
||||
m_sDomaintable = SqlString.Null
|
||||
Else
|
||||
m_sDomaintable = New SqlString(CType(dtToReturn.Rows(0)("Domaintable"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("KeyFields") Is System.DBNull.Value Then
|
||||
m_sKeyFields = SqlString.Null
|
||||
Else
|
||||
m_sKeyFields = New SqlString(CType(dtToReturn.Rows(0)("KeyFields"), String))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSysadminfunktion::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_sysadminfunktion_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("sysadminfunktion")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_sysadminfunktion_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsSysadminfunktion::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iSysadminfnktnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSysadminfnktnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSysadminfnktnrTmp As SqlInt32 = Value
|
||||
If iSysadminfnktnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSysadminfnktnr", "iSysadminfnktnr can't be NULL")
|
||||
End If
|
||||
m_iSysadminfnktnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSort]() As SqlInt32
|
||||
Get
|
||||
Return m_iSort
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSort = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iImageIndex]() As SqlInt32
|
||||
Get
|
||||
Return m_iImageIndex
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iImageIndex = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iImageIndexOpen]() As SqlInt32
|
||||
Get
|
||||
Return m_iImageIndexOpen
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iImageIndexOpen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFtop]() As SqlInt32
|
||||
Get
|
||||
Return m_iFtop
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFtop = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFleft]() As SqlInt32
|
||||
Get
|
||||
Return m_iFleft
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFleft = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFwidth]() As SqlInt32
|
||||
Get
|
||||
Return m_iFwidth
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFwidth = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFheight]() As SqlInt32
|
||||
Get
|
||||
Return m_iFheight
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFheight = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMandantnrTmp As SqlInt32 = Value
|
||||
If iMandantnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMandantnr", "iMandantnr can't be NULL")
|
||||
End If
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSprache]() As SqlInt32
|
||||
Get
|
||||
Return m_iSprache
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSpracheTmp As SqlInt32 = Value
|
||||
If iSpracheTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSprache", "iSprache can't be NULL")
|
||||
End If
|
||||
m_iSprache = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDomaintable]() As SqlString
|
||||
Get
|
||||
Return m_sDomaintable
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDomaintable = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKeyFields]() As SqlString
|
||||
Get
|
||||
Return m_sKeyFields
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKeyFields = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
373
SW/AssessmentMgmt/DB/Generierte Objekte/clsTerminierung.vb
Normal file
373
SW/AssessmentMgmt/DB/Generierte Objekte/clsTerminierung.vb
Normal file
@@ -0,0 +1,373 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsTerminierung
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iID As SqlInt32
|
||||
Private m_sBezeichnung, m_sBeschreibung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Terminierung_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("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Terminierung_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("clsTerminierung::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Terminierung_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("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Terminierung_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("clsTerminierung::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Terminierung_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("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Terminierung_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("clsTerminierung::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Terminierung_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Terminierung")
|
||||
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("@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_Terminierung_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)("Bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("Bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsTerminierung::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Terminierung_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Terminierung")
|
||||
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_Terminierung_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("clsTerminierung::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 [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
490
SW/AssessmentMgmt/DB/Generierte Objekte/clsToolTip.vb
Normal file
490
SW/AssessmentMgmt/DB/Generierte Objekte/clsToolTip.vb
Normal file
@@ -0,0 +1,490 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'ToolTip'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 14:02:28
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'ToolTip'.
|
||||
''' </summary>
|
||||
Public Class clsToolTip
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iToolTipNr As SqlInt32
|
||||
Private m_sToolTip, m_sControlName, m_sFormularName As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' <LI>sFormularName. May be SqlString.Null</LI>
|
||||
''' <LI>sControlName. May be SqlString.Null</LI>
|
||||
''' <LI>sToolTip. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFormularName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFormularName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sControlName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sControlName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sToolTip", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sToolTip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' <LI>sFormularName. May be SqlString.Null</LI>
|
||||
''' <LI>sControlName. May be SqlString.Null</LI>
|
||||
''' <LI>sToolTip. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFormularName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFormularName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sControlName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sControlName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sToolTip", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sToolTip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' <LI>sFormularName</LI>
|
||||
''' <LI>sControlName</LI>
|
||||
''' <LI>sToolTip</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("ToolTip")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iToolTipNr = New SqlInt32(CType(dtToReturn.Rows(0)("ToolTipNr"), Integer))
|
||||
If dtToReturn.Rows(0)("FormularName") Is System.DBNull.Value Then
|
||||
m_sFormularName = SqlString.Null
|
||||
Else
|
||||
m_sFormularName = New SqlString(CType(dtToReturn.Rows(0)("FormularName"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ControlName") Is System.DBNull.Value Then
|
||||
m_sControlName = SqlString.Null
|
||||
Else
|
||||
m_sControlName = New SqlString(CType(dtToReturn.Rows(0)("ControlName"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ToolTip") Is System.DBNull.Value Then
|
||||
m_sToolTip = SqlString.Null
|
||||
Else
|
||||
m_sToolTip = New SqlString(CType(dtToReturn.Rows(0)("ToolTip"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("ToolTip")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iToolTipNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iToolTipNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iToolTipNrTmp As SqlInt32 = Value
|
||||
If iToolTipNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iToolTipNr", "iToolTipNr can't be NULL")
|
||||
End If
|
||||
m_iToolTipNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFormularName]() As SqlString
|
||||
Get
|
||||
Return m_sFormularName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFormularName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sControlName]() As SqlString
|
||||
Get
|
||||
Return m_sControlName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sControlName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sToolTip]() As SqlString
|
||||
Get
|
||||
Return m_sToolTip
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sToolTip = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
390
SW/AssessmentMgmt/DB/Generierte Objekte/clsVerantwortung.vb
Normal file
390
SW/AssessmentMgmt/DB/Generierte Objekte/clsVerantwortung.vb
Normal file
@@ -0,0 +1,390 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsVerantwortung
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iVerantwortungNr As SqlInt32
|
||||
Private m_sEMail, m_sVorname, m_sName As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verantwortung_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sVorname", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sEMail", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEMail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Verantwortung_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("clsVerantwortung::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verantwortung_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sVorname", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sEMail", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEMail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Verantwortung_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("clsVerantwortung::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verantwortung_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerantwortungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Verantwortung_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("clsVerantwortung::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verantwortung_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Verantwortung")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iVerantwortungNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortungNr))
|
||||
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_Verantwortung_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iVerantwortungNr = New SqlInt32(CType(dtToReturn.Rows(0)("VerantwortungNr"), Integer))
|
||||
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)("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)("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)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsVerantwortung::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Verantwortung_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Verantwortung")
|
||||
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_Verantwortung_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("clsVerantwortung::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 [iVerantwortungNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortungNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iVerantwortungNrTmp As SqlInt32 = Value
|
||||
If iVerantwortungNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iVerantwortungNr", "iVerantwortungNr can't be NULL")
|
||||
End If
|
||||
m_iVerantwortungNr = 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 [sVorname]() As SqlString
|
||||
Get
|
||||
Return m_sVorname
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sVorname = 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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
475
SW/AssessmentMgmt/DB/Generierte Objekte/clsVorgabe.vb
Normal file
475
SW/AssessmentMgmt/DB/Generierte Objekte/clsVorgabe.vb
Normal file
@@ -0,0 +1,475 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsVorgabe
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am, m_daGueltig_Bis As SqlDateTime
|
||||
Private m_iVorgabeID, m_iMutierer, m_iParentID As SqlInt32
|
||||
Private m_sBezeichnung, m_sDefinition, m_sBeschreibung, m_sKapitel, m_sErgaenzungen, m_sKapitelNr As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Vorgabe_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVorgabeID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKapitelNr", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKapitelNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKapitel", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKapitel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDefinition", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDefinition))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sErgaenzungen", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sErgaenzungen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Vorgabe_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("clsVorgabe::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Vorgabe_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVorgabeID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iParentID", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iParentID))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKapitelNr", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKapitelNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sKapitel", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKapitel))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDefinition", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDefinition))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sErgaenzungen", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sErgaenzungen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_Bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_Bis))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Vorgabe_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("clsVorgabe::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Vorgabe_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVorgabeID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeID))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Vorgabe_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("clsVorgabe::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Vorgabe_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Vorgabe")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iVorgabeID", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeID))
|
||||
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_Vorgabe_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iVorgabeID = New SqlInt32(CType(dtToReturn.Rows(0)("VorgabeID"), Integer))
|
||||
If dtToReturn.Rows(0)("ParentID") Is System.DBNull.Value Then
|
||||
m_iParentID = SqlInt32.Null
|
||||
Else
|
||||
m_iParentID = New SqlInt32(CType(dtToReturn.Rows(0)("ParentID"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("Bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Beschreibung") Is System.DBNull.Value Then
|
||||
m_sBeschreibung = SqlString.Null
|
||||
Else
|
||||
m_sBeschreibung = New SqlString(CType(dtToReturn.Rows(0)("Beschreibung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("KapitelNr") Is System.DBNull.Value Then
|
||||
m_sKapitelNr = SqlString.Null
|
||||
Else
|
||||
m_sKapitelNr = New SqlString(CType(dtToReturn.Rows(0)("KapitelNr"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Kapitel") Is System.DBNull.Value Then
|
||||
m_sKapitel = SqlString.Null
|
||||
Else
|
||||
m_sKapitel = New SqlString(CType(dtToReturn.Rows(0)("Kapitel"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Definition") Is System.DBNull.Value Then
|
||||
m_sDefinition = SqlString.Null
|
||||
Else
|
||||
m_sDefinition = New SqlString(CType(dtToReturn.Rows(0)("Definition"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Ergaenzungen") Is System.DBNull.Value Then
|
||||
m_sErgaenzungen = SqlString.Null
|
||||
Else
|
||||
m_sErgaenzungen = New SqlString(CType(dtToReturn.Rows(0)("Ergaenzungen"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Gueltig_Bis") Is System.DBNull.Value Then
|
||||
m_daGueltig_Bis = SqlDateTime.Null
|
||||
Else
|
||||
m_daGueltig_Bis = New SqlDateTime(CType(dtToReturn.Rows(0)("Gueltig_Bis"), 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("clsVorgabe::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Vorgabe_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Vorgabe")
|
||||
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_Vorgabe_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("clsVorgabe::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 [iVorgabeID]() As SqlInt32
|
||||
Get
|
||||
Return m_iVorgabeID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iVorgabeIDTmp As SqlInt32 = Value
|
||||
If iVorgabeIDTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iVorgabeID", "iVorgabeID can't be NULL")
|
||||
End If
|
||||
m_iVorgabeID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iParentID]() As SqlInt32
|
||||
Get
|
||||
Return m_iParentID
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iParentID = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBeschreibung]() As SqlString
|
||||
Get
|
||||
Return m_sBeschreibung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBeschreibung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKapitelNr]() As SqlString
|
||||
Get
|
||||
Return m_sKapitelNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKapitelNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKapitel]() As SqlString
|
||||
Get
|
||||
Return m_sKapitel
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKapitel = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDefinition]() As SqlString
|
||||
Get
|
||||
Return m_sDefinition
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDefinition = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sErgaenzungen]() As SqlString
|
||||
Get
|
||||
Return m_sErgaenzungen
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sErgaenzungen = 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 [daGueltig_Bis]() As SqlDateTime
|
||||
Get
|
||||
Return m_daGueltig_Bis
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daGueltig_Bis = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
424
SW/AssessmentMgmt/DB/Generierte Objekte/clsVorgabeDefinition.vb
Normal file
424
SW/AssessmentMgmt/DB/Generierte Objekte/clsVorgabeDefinition.vb
Normal file
@@ -0,0 +1,424 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
Public Class clsVorgabeDefinition
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daGueltig_bis, m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iVorgabeDefinitionNr, m_iVorgabeNr As SqlInt32
|
||||
Private m_sBemerkungen, m_sBezeichnung, m_sDefinition As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_VorgabeDefinition_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVorgabeDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVorgabeNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDefinition", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDefinition))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBemerkungen", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBemerkungen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_VorgabeDefinition_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("clsVorgabeDefinition::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_VorgabeDefinition_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVorgabeDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVorgabeNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDefinition", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDefinition))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBemerkungen", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBemerkungen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daGueltig_bis", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daGueltig_bis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_VorgabeDefinition_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("clsVorgabeDefinition::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_VorgabeDefinition_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVorgabeDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeDefinitionNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_VorgabeDefinition_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("clsVorgabeDefinition::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_VorgabeDefinition_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("VorgabeDefinition")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iVorgabeDefinitionNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iVorgabeDefinitionNr))
|
||||
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_VorgabeDefinition_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iVorgabeDefinitionNr = New SqlInt32(CType(dtToReturn.Rows(0)("VorgabeDefinitionNr"), Integer))
|
||||
If dtToReturn.Rows(0)("VorgabeNr") Is System.DBNull.Value Then
|
||||
m_iVorgabeNr = SqlInt32.Null
|
||||
Else
|
||||
m_iVorgabeNr = New SqlInt32(CType(dtToReturn.Rows(0)("VorgabeNr"), 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)("Definition") Is System.DBNull.Value Then
|
||||
m_sDefinition = SqlString.Null
|
||||
Else
|
||||
m_sDefinition = New SqlString(CType(dtToReturn.Rows(0)("Definition"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Bemerkungen") Is System.DBNull.Value Then
|
||||
m_sBemerkungen = SqlString.Null
|
||||
Else
|
||||
m_sBemerkungen = New SqlString(CType(dtToReturn.Rows(0)("Bemerkungen"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Gueltig_bis") Is System.DBNull.Value Then
|
||||
m_daGueltig_bis = SqlDateTime.Null
|
||||
Else
|
||||
m_daGueltig_bis = New SqlDateTime(CType(dtToReturn.Rows(0)("Gueltig_bis"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsVorgabeDefinition::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_VorgabeDefinition_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("VorgabeDefinition")
|
||||
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_VorgabeDefinition_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("clsVorgabeDefinition::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 [iVorgabeDefinitionNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVorgabeDefinitionNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iVorgabeDefinitionNrTmp As SqlInt32 = Value
|
||||
If iVorgabeDefinitionNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iVorgabeDefinitionNr", "iVorgabeDefinitionNr can't be NULL")
|
||||
End If
|
||||
m_iVorgabeDefinitionNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVorgabeNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iVorgabeNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVorgabeNr = 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 [sDefinition]() As SqlString
|
||||
Get
|
||||
Return m_sDefinition
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDefinition = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBemerkungen]() As SqlString
|
||||
Get
|
||||
Return m_sBemerkungen
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBemerkungen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daGueltig_bis]() As SqlDateTime
|
||||
Get
|
||||
Return m_daGueltig_bis
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daGueltig_bis = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
130
SW/AssessmentMgmt/DB/MyDBObjects/MyMitarbeiter.vb
Normal file
130
SW/AssessmentMgmt/DB/MyDBObjects/MyMitarbeiter.vb
Normal file
@@ -0,0 +1,130 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Security.Principal
|
||||
|
||||
Namespace DB
|
||||
|
||||
Public Class MyMitarbeiter
|
||||
Inherits DB.clsMitarbeiter
|
||||
''' <summary>
|
||||
''' Alle Mitarbeiter inkl. vollständigem Name (Fullname) auslesen
|
||||
''' </summary>
|
||||
''' <returns>Datatable</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function SelectAllwithFullname() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[my_mitarbeiter_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = New DataTable("mitarbeiter")
|
||||
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Mitarbeiter mittels TGNummer auslesen
|
||||
''' </summary>
|
||||
''' <returns>Datatable</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function SelectWithTGNummer() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[my_mitarbeiter_SelectWithTGNummer]"
|
||||
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("@stgnummer", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Me.Get_Username))
|
||||
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_SelectAllWithTGNummer' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::SelectWithTGNummer::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>
|
||||
''' Security-Deklaration zum Auslesen der UserID vom Windows-User
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Dim ouser As New WindowsPrincipal(WindowsIdentity.GetCurrent)
|
||||
''' <summary>
|
||||
''' Windows-User auslesen
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
''' <remarks></remarks>
|
||||
Private Function Get_Username() As String
|
||||
With ouser.Identity.Name
|
||||
Return (.Substring(.IndexOf("\") + 1))
|
||||
End With
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
61
SW/AssessmentMgmt/DB/MyDBObjects/clsMyKey_Tabelle.vb
Normal file
61
SW/AssessmentMgmt/DB/MyDBObjects/clsMyKey_Tabelle.vb
Normal file
@@ -0,0 +1,61 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
Namespace DB
|
||||
Public Class clsMyKey_Tabelle
|
||||
Inherits db.clsKey_tabelle
|
||||
|
||||
Public Function get_dbkey(ByVal Tablename As String) As Long
|
||||
Dim m_dbkey As Long
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[sp_get_dbkey]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@Tablename", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, Tablename))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dbkey", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_dbkey))
|
||||
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.
|
||||
Try
|
||||
scmCmdToExecute.Connection.Open()
|
||||
Catch ex As Exception
|
||||
Finally
|
||||
End Try
|
||||
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_dbkey = scmCmdToExecute.Parameters.Item("@dbkey").Value
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
scmCmdToExecute.Connection.Close()
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'sp_get_dbkey' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return m_dbkey
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsKey_tabelle::get_dbkey::Error occured." + ex.Message, ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
59
SW/AssessmentMgmt/DB/MyDBObjects/db_connection.vb
Normal file
59
SW/AssessmentMgmt/DB/MyDBObjects/db_connection.vb
Normal file
@@ -0,0 +1,59 @@
|
||||
Imports System.IO
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Dynamische Datenbank-Verbindung aufbauen. Verwendet wird standardmässig Vertragsverwaltung.cfg.
|
||||
''' Sollen Datenbank-Verbindungen zur Auswahl angezeigt werden, werden sämntliche Datenbank-Verbindungsdateien
|
||||
''' mit dem Namen "Vertragsverwaltung....cfg" berücksichtigt
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Public Class DB_Connection
|
||||
|
||||
''' <summary>
|
||||
''' Liest sämtlcihe CFG-Dateien mit dem Namen "Vertragsverwaltung...". Sind meherere Dateien vorhanden,
|
||||
''' wird ein Auswahldialog zur Datenbank-Selektion angezeigt.
|
||||
''' Standardmässig wird Vertragsverwaltung.cfg als CFG-Datei benutzt.
|
||||
'''
|
||||
''' Die CFG-Datei ist verschlüsselt und wird über die Crypto-Funktionen entschlüsselt.
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Shared Sub New()
|
||||
Dim fc As Integer = 0
|
||||
If Globals.ConnectionFileName.Length = 0 Then
|
||||
Dim Dir As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
|
||||
Try
|
||||
Dim f As New frmDatenbankauswahl()
|
||||
Dim ChildFile As FileInfo
|
||||
For Each ChildFile In Dir.GetFiles()
|
||||
If UCase(Left(ChildFile.Name, 14)) = "ASSESSMENTMGMT" And UCase(ChildFile.Extension) = ".CFG" Then
|
||||
f.ListBox1.Items.Add(ChildFile.Name)
|
||||
fc = fc + 1
|
||||
End If
|
||||
Next
|
||||
If fc > 1 Then
|
||||
f.ListBox1.SelectedIndex = 0
|
||||
f.ListBox1.Select()
|
||||
f.ShowDialog()
|
||||
Globals.ConnectionFileName = f.ListBox1.SelectedItem
|
||||
f.Dispose()
|
||||
End If
|
||||
Catch except As Exception
|
||||
fc = 0
|
||||
Exit Sub
|
||||
End Try
|
||||
End If
|
||||
If fc < 2 Then Globals.ConnectionFileName = "Assessmentmgmt.cfg"
|
||||
Dim ofile As System.IO.File
|
||||
Dim oread As System.IO.StreamReader
|
||||
oread = ofile.OpenText(Application.StartupPath + "\" + Globals.ConnectionFileName)
|
||||
sConnectionString = oread.ReadLine
|
||||
sConnectionString = Crypto.DecryptText(sConnectionString, "HutterundMueller")
|
||||
sConnectionString = Left(sConnectionString, Len(sConnectionString) - 1)
|
||||
Globals.sConnectionString = sConnectionString
|
||||
Globals.conn.sConnectionString = sConnectionString
|
||||
oread.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
138
SW/AssessmentMgmt/DB/MyDBObjects/frmDatenbankauswahl.resx
Normal file
138
SW/AssessmentMgmt/DB/MyDBObjects/frmDatenbankauswahl.resx
Normal file
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAICAEAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
|
||||
AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAzd3d3MzMzAAAAAAAAAAAAM3d3dzMzMwAAAAAAAAAAM3eIiIi7MzMzAAAAAAAA
|
||||
ADN3iIiIuzMzMwAAAAAAAAB3u4iIiLu7MzMAAAAAAAAAd7uIiIi7uzMzAAAAAAAAAHe7iIiIu7szMwAA
|
||||
AAAAAAB3u4iIiLu7MzMAAAAAAAAAd7uIiIi7uzMzAAAAAAAAAHe7iIiIu7szMwAAAAAAAAB3u4iIiLu7
|
||||
MzMAAAAAAAAAd7uIiIi7uzMzAAAAAAAAAHe7iIiIu7szMwAAAAAAAAB3u4iIiLu7MzMAAAAAAAAAd7uI
|
||||
iIi7uzMzAAAAAAAAAHe7iIiIu7szMwAAAAAAAAB3u4iIiLu7MzMAAAAAAAAAd7uIiIi7uzMzAAAAAAAA
|
||||
AHe7iIiIiIi7dwAAAAAAAAB3u4iIiIiIu3cAAAAAAAAAiIj//////4h3AAAAAAAAAIiI//////+IdwAA
|
||||
AAAAAAAzd3d3d3d3dzMAAAAAAAAAM3d3d3d3d3czAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////AAA//wA
|
||||
AP/8AAD//AAA//wAAP/8AAD//AAA//wAAP/8AAD//AAA//wAAP/8AAD//AAA//wAAP/8AAD//AAA//wA
|
||||
AP/8AAD//AAA//wAAP/8AAD//AAA//wAAP/8AAD//////////////////////w==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
95
SW/AssessmentMgmt/DB/MyDBObjects/frmDatenbankauswahl.vb
Normal file
95
SW/AssessmentMgmt/DB/MyDBObjects/frmDatenbankauswahl.vb
Normal file
@@ -0,0 +1,95 @@
|
||||
''' <summary>
|
||||
''' Form für die Datenbankauswahl
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Public Class frmDatenbankauswahl
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
#Region " Vom Windows Form Designer generierter Code "
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
|
||||
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen
|
||||
|
||||
End Sub
|
||||
|
||||
' Die Form überschreibt den Löschvorgang der Basisklasse, um Komponenten zu bereinigen.
|
||||
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing Then
|
||||
If Not (components Is Nothing) Then
|
||||
components.Dispose()
|
||||
End If
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
' Für Windows Form-Designer erforderlich
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'HINWEIS: Die folgende Prozedur ist für den Windows Form-Designer erforderlich
|
||||
'Sie kann mit dem Windows Form-Designer modifiziert werden.
|
||||
'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
|
||||
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
|
||||
Friend WithEvents Button1 As System.Windows.Forms.Button
|
||||
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmDatenbankauswahl))
|
||||
Me.ListBox1 = New System.Windows.Forms.ListBox
|
||||
Me.Button1 = New System.Windows.Forms.Button
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'ListBox1
|
||||
'
|
||||
Me.ListBox1.Location = New System.Drawing.Point(16, 16)
|
||||
Me.ListBox1.Name = "ListBox1"
|
||||
Me.ListBox1.Size = New System.Drawing.Size(232, 95)
|
||||
Me.ListBox1.TabIndex = 0
|
||||
'
|
||||
'Button1
|
||||
'
|
||||
Me.Button1.DialogResult = System.Windows.Forms.DialogResult.OK
|
||||
Me.Button1.Location = New System.Drawing.Point(88, 128)
|
||||
Me.Button1.Name = "Button1"
|
||||
Me.Button1.Size = New System.Drawing.Size(75, 23)
|
||||
Me.Button1.TabIndex = 1
|
||||
Me.Button1.Text = "&OK"
|
||||
'
|
||||
'frmDatenbankauswahl
|
||||
'
|
||||
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
||||
Me.ClientSize = New System.Drawing.Size(258, 165)
|
||||
Me.Controls.Add(Me.Button1)
|
||||
Me.Controls.Add(Me.ListBox1)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.Name = "frmDatenbankauswahl"
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
||||
Me.Text = "Vertragsverwaltung: Datebbankauswahl"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub frmDatenbankauswahl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub ListBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown
|
||||
If e.KeyCode = Keys.Enter Then Me.Close()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user