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.

321 lines
9.9 KiB

Imports System
Imports System.Data
Imports System.Data.SqlTypes
Imports System.Data.SqlClient
Namespace TKB.VV.DB
Public Class cls__#tmpfhr1
Inherits clsDBInteractionBase
#Region " Class Member Declarations "
Private m_fTotal, m_fEngagement_Effektiv, m_fRFC_200, m_fRTB, m_fCTB, m_fRFC_300, m_fPAufwand, m_fSoll As SqlDouble
Private m_iOESort, m_iSort, m_iSortierung As SqlInt32
Private m_dcAnteil_CTB, m_dcProd, m_dcAnteil_Rtb As SqlDecimal
Private m_sName, m_sOE, m_sTGNummer, m_sVorname 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___#tmpfhr1_Insert]"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
' // Use base class' connection object
scmCmdToExecute.Connection = m_scoMainConnection
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@sOE", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sOE))
scmCmdToExecute.Parameters.Add(New SqlParameter("@iOESort", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iOESort))
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, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSortierung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSortierung))
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTGNummer", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTGNummer))
scmCmdToExecute.Parameters.Add(New SqlParameter("@iSort", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSort))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fEngagement_Effektiv", SqlDbType.Float, 8, ParameterDirection.Input, False, 38, 0, "", DataRowVersion.Proposed, m_fEngagement_Effektiv))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fPAufwand", SqlDbType.Float, 8, ParameterDirection.Input, True, 38, 0, "", DataRowVersion.Proposed, m_fPAufwand))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fRFC_300", SqlDbType.Float, 8, ParameterDirection.Input, True, 38, 0, "", DataRowVersion.Proposed, m_fRFC_300))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fCTB", SqlDbType.Float, 8, ParameterDirection.Input, True, 38, 0, "", DataRowVersion.Proposed, m_fCTB))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fRTB", SqlDbType.Float, 8, ParameterDirection.Input, True, 38, 0, "", DataRowVersion.Proposed, m_fRTB))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fRFC_200", SqlDbType.Float, 8, ParameterDirection.Input, True, 38, 0, "", DataRowVersion.Proposed, m_fRFC_200))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fTotal", SqlDbType.Float, 8, ParameterDirection.Input, True, 38, 0, "", DataRowVersion.Proposed, m_fTotal))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fSoll", SqlDbType.Float, 8, ParameterDirection.Input, True, 38, 0, "", DataRowVersion.Proposed, m_fSoll))
scmCmdToExecute.Parameters.Add(New SqlParameter("@dcProd", SqlDbType.Decimal, 9, ParameterDirection.Input, True, 18, 2, "", DataRowVersion.Proposed, m_dcProd))
scmCmdToExecute.Parameters.Add(New SqlParameter("@dcAnteil_CTB", SqlDbType.Decimal, 9, ParameterDirection.Input, True, 18, 2, "", DataRowVersion.Proposed, m_dcAnteil_CTB))
scmCmdToExecute.Parameters.Add(New SqlParameter("@dcAnteil_Rtb", SqlDbType.Decimal, 9, ParameterDirection.Input, True, 18, 2, "", DataRowVersion.Proposed, m_dcAnteil_Rtb))
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
If m_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___#tmpfhr1_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__#tmpfhr1::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___#tmpfhr1_SelectAll]"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
Dim dtToReturn As DataTable = new DataTable("__#tmpfhr1")
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___#tmpfhr1_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__#tmpfhr1::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 [sOE]() As SqlString
Get
Return m_sOE
End Get
Set(ByVal Value As SqlString)
m_sOE = Value
End Set
End Property
Public Property [iOESort]() As SqlInt32
Get
Return m_iOESort
End Get
Set(ByVal Value As SqlInt32)
m_iOESort = 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 [iSortierung]() As SqlInt32
Get
Return m_iSortierung
End Get
Set(ByVal Value As SqlInt32)
m_iSortierung = 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 [iSort]() As SqlInt32
Get
Return m_iSort
End Get
Set(ByVal Value As SqlInt32)
m_iSort = Value
End Set
End Property
Public Property [fEngagement_Effektiv]() As SqlDouble
Get
Return m_fEngagement_Effektiv
End Get
Set(ByVal Value As SqlDouble)
Dim fEngagement_EffektivTmp As SqlDouble = Value
If fEngagement_EffektivTmp.IsNull Then
Throw New ArgumentOutOfRangeException("fEngagement_Effektiv", "fEngagement_Effektiv can't be NULL")
End If
m_fEngagement_Effektiv = Value
End Set
End Property
Public Property [fPAufwand]() As SqlDouble
Get
Return m_fPAufwand
End Get
Set(ByVal Value As SqlDouble)
m_fPAufwand = Value
End Set
End Property
Public Property [fRFC_300]() As SqlDouble
Get
Return m_fRFC_300
End Get
Set(ByVal Value As SqlDouble)
m_fRFC_300 = Value
End Set
End Property
Public Property [fCTB]() As SqlDouble
Get
Return m_fCTB
End Get
Set(ByVal Value As SqlDouble)
m_fCTB = Value
End Set
End Property
Public Property [fRTB]() As SqlDouble
Get
Return m_fRTB
End Get
Set(ByVal Value As SqlDouble)
m_fRTB = Value
End Set
End Property
Public Property [fRFC_200]() As SqlDouble
Get
Return m_fRFC_200
End Get
Set(ByVal Value As SqlDouble)
m_fRFC_200 = Value
End Set
End Property
Public Property [fTotal]() As SqlDouble
Get
Return m_fTotal
End Get
Set(ByVal Value As SqlDouble)
m_fTotal = Value
End Set
End Property
Public Property [fSoll]() As SqlDouble
Get
Return m_fSoll
End Get
Set(ByVal Value As SqlDouble)
m_fSoll = Value
End Set
End Property
Public Property [dcProd]() As SqlDecimal
Get
Return m_dcProd
End Get
Set(ByVal Value As SqlDecimal)
m_dcProd = Value
End Set
End Property
Public Property [dcAnteil_CTB]() As SqlDecimal
Get
Return m_dcAnteil_CTB
End Get
Set(ByVal Value As SqlDecimal)
m_dcAnteil_CTB = Value
End Set
End Property
Public Property [dcAnteil_Rtb]() As SqlDecimal
Get
Return m_dcAnteil_Rtb
End Get
Set(ByVal Value As SqlDecimal)
m_dcAnteil_Rtb = Value
End Set
End Property
#End Region
End Class
End Namespace