You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
177 lines
5.6 KiB
177 lines
5.6 KiB
Imports System
|
|
Imports System.Data
|
|
Imports System.Data.SqlTypes
|
|
Imports System.Data.SqlClient
|
|
|
|
Namespace TKB.VV.DB
|
|
Public Class cls_____test
|
|
Inherits clsDBInteractionBase
|
|
|
|
#Region " Class Member Declarations "
|
|
|
|
Private m_daStatus_Changedate As SqlDateTime
|
|
Private m_iStatus As SqlInt32
|
|
Private m_sTicketid, m_sTgnummer, m_sStatus_neu 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______test_Insert]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
|
|
' // Use base class' connection object
|
|
scmCmdToExecute.Connection = m_scoMainConnection
|
|
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sticketid", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTicketid))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@daStatus_Changedate", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daStatus_Changedate))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@sstatus_neu", SqlDbType.VarChar, 255, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sStatus_neu))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@stgnummer", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@iStatus", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
|
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
|
|
|
If m_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______test_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("cls_____test::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 SelectAll() As DataTable
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.[pr______test_SelectAll]"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
Dim dtToReturn As DataTable = new DataTable("_____test")
|
|
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______test_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("cls_____test::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 [sTicketid]() As SqlString
|
|
Get
|
|
Return m_sTicketid
|
|
End Get
|
|
Set(ByVal Value As SqlString)
|
|
m_sTicketid = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [daStatus_Changedate]() As SqlDateTime
|
|
Get
|
|
Return m_daStatus_Changedate
|
|
End Get
|
|
Set(ByVal Value As SqlDateTime)
|
|
m_daStatus_Changedate = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Public Property [sStatus_neu]() As SqlString
|
|
Get
|
|
Return m_sStatus_neu
|
|
End Get
|
|
Set(ByVal Value As SqlString)
|
|
Dim sStatus_neuTmp As SqlString = Value
|
|
If sStatus_neuTmp.IsNull Then
|
|
Throw New ArgumentOutOfRangeException("sStatus_neu", "sStatus_neu can't be NULL")
|
|
End If
|
|
m_sStatus_neu = 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 [iStatus]() As SqlInt32
|
|
Get
|
|
Return m_iStatus
|
|
End Get
|
|
Set(ByVal Value As SqlInt32)
|
|
m_iStatus = Value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
End Class
|
|
End Namespace
|