Initial
This commit is contained in:
3
edkb08/Datenbank/Avaloq.vb
Normal file
3
edkb08/Datenbank/Avaloq.vb
Normal file
@@ -0,0 +1,3 @@
|
||||
Module Avaloq
|
||||
|
||||
End Module
|
||||
417
edkb08/Datenbank/Journale/clsImport_Daten.vb
Normal file
417
edkb08/Datenbank/Journale/clsImport_Daten.vb
Normal file
@@ -0,0 +1,417 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Import_Daten'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Freitag, 15. April 2005, 13:41:18
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'Import_Daten'.
|
||||
' /// </summary>
|
||||
Public Class clsImport_Daten
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_blobDaten As SqlBinary
|
||||
Private m_iImport_Jobnr, m_iImport_Data_Nr As SqlInt32
|
||||
Private m_sDatenformat 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>iImport_Data_Nr</LI>
|
||||
' /// <LI>iImport_Jobnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sDatenformat. May be SqlString.Null</LI>
|
||||
' /// <LI>blobDaten. May be SqlBinary.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_inport_Import_Daten_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_Data_Nr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_Data_Nr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_Jobnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImport_Jobnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdatenformat", SqlDbType.VarChar, 3, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDatenformat))
|
||||
Dim iLength As Integer = 0
|
||||
If Not m_blobDaten.IsNull Then
|
||||
iLength = m_blobDaten.Length
|
||||
End If
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@blobdaten", SqlDbType.Image, iLength, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_blobDaten))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Daten_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("clsImport_Daten::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>iImport_Data_Nr</LI>
|
||||
' /// <LI>iImport_Jobnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sDatenformat. May be SqlString.Null</LI>
|
||||
' /// <LI>blobDaten. May be SqlBinary.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_inport_Import_Daten_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_Data_Nr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_Data_Nr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_Jobnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImport_Jobnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdatenformat", SqlDbType.VarChar, 3, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDatenformat))
|
||||
Dim iLength As Integer = 0
|
||||
If Not m_blobDaten.IsNull Then
|
||||
iLength = m_blobDaten.Length
|
||||
End If
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@blobdaten", SqlDbType.Image, iLength, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_blobDaten))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Daten_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("clsImport_Daten::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>iImport_Data_Nr</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_inport_Import_Daten_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_Data_Nr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_Data_Nr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Daten_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("clsImport_Daten::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>iImport_Data_Nr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iImport_Data_Nr</LI>
|
||||
' /// <LI>iImport_Jobnr</LI>
|
||||
' /// <LI>sDatenformat</LI>
|
||||
' /// <LI>blobDaten</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_inport_Import_Daten_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Import_Daten")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iImport_Data_Nr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_Data_Nr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Daten_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iImport_Data_Nr = New SqlInt32(CType(dtToReturn.Rows(0)("Import_Data_Nr"), Integer))
|
||||
If dtToReturn.Rows(0)("Import_Jobnr") Is System.DBNull.Value Then
|
||||
m_iImport_Jobnr = SqlInt32.Null
|
||||
Else
|
||||
m_iImport_Jobnr = New SqlInt32(CType(dtToReturn.Rows(0)("Import_Jobnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("datenformat") Is System.DBNull.Value Then
|
||||
m_sDatenformat = SqlString.Null
|
||||
Else
|
||||
m_sDatenformat = New SqlString(CType(dtToReturn.Rows(0)("datenformat"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("daten") Is System.DBNull.Value Then
|
||||
m_blobDaten = SqlBinary.Null
|
||||
Else
|
||||
m_blobDaten = New SqlBinary(CType(dtToReturn.Rows(0)("daten"), Byte()))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsImport_Daten::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_inport_Import_Daten_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Import_Daten")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Daten_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("clsImport_Daten::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 [iImport_Data_Nr]() As SqlInt32
|
||||
Get
|
||||
Return m_iImport_Data_Nr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iImport_Data_NrTmp As SqlInt32 = Value
|
||||
If iImport_Data_NrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iImport_Data_Nr", "iImport_Data_Nr can't be NULL")
|
||||
End If
|
||||
m_iImport_Data_Nr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iImport_Jobnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iImport_Jobnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iImport_Jobnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDatenformat]() As SqlString
|
||||
Get
|
||||
Return m_sDatenformat
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDatenformat = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [blobDaten]() As SqlBinary
|
||||
Get
|
||||
Return m_blobDaten
|
||||
End Get
|
||||
Set(ByVal Value As SqlBinary)
|
||||
m_blobDaten = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
590
edkb08/Datenbank/Journale/clsImport_Eintrag.vb
Normal file
590
edkb08/Datenbank/Journale/clsImport_Eintrag.vb
Normal file
@@ -0,0 +1,590 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Import_Eintrag'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Donnerstag, 14. April 2005, 21:41:01
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'Import_Eintrag'.
|
||||
' /// </summary>
|
||||
Public Class clsImport_Eintrag
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_daTS As SqlDateTime
|
||||
Private m_iImport_Eintragnr, m_iImport_JobNr As SqlInt32
|
||||
Private m_sEDOKA_Dokumentid, m_sStatustext, m_sEDOKA_Dokumenttyp, m_sIndexdaten, m_sApplikationsnr, m_sPartnernr, m_sRecordNo, m_sDateityp, m_sStatus, m_sDateiname 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>iImport_JobNr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>daTS. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>sRecordNo. May be SqlString.Null</LI>
|
||||
' /// <LI>sPartnernr. May be SqlString.Null</LI>
|
||||
' /// <LI>sDateityp. May be SqlString.Null</LI>
|
||||
' /// <LI>sDateiname. May be SqlString.Null</LI>
|
||||
' /// <LI>sStatus. May be SqlString.Null</LI>
|
||||
' /// <LI>sStatustext. May be SqlString.Null</LI>
|
||||
' /// <LI>sEDOKA_Dokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>sEDOKA_Dokumenttyp. May be SqlString.Null</LI>
|
||||
' /// <LI>sApplikationsnr. May be SqlString.Null</LI>
|
||||
' /// <LI>sIndexdaten. May be SqlString.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iImport_Eintragnr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_inport_Import_Eintrag_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_JobNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImport_JobNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTS", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daTS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sRecordNo", SqlDbType.VarChar, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sRecordNo))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sPartnernr", SqlDbType.VarChar, 9, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sPartnernr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDateityp", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDateityp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDateiname", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDateiname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sStatus", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sStatustext", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sStatustext))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sEDOKA_Dokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEDOKA_Dokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sEDOKA_Dokumenttyp", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEDOKA_Dokumenttyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sApplikationsnr", SqlDbType.VarChar, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sApplikationsnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sIndexdaten", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sIndexdaten))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iImport_Eintragnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iImport_Eintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iImport_Eintragnr = scmCmdToExecute.Parameters.Item("@iImport_Eintragnr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Eintrag_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("clsImport_Eintrag::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>iImport_Eintragnr</LI>
|
||||
' /// <LI>iImport_JobNr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>daTS. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>sRecordNo. May be SqlString.Null</LI>
|
||||
' /// <LI>sPartnernr. May be SqlString.Null</LI>
|
||||
' /// <LI>sDateityp. May be SqlString.Null</LI>
|
||||
' /// <LI>sDateiname. May be SqlString.Null</LI>
|
||||
' /// <LI>sStatus. May be SqlString.Null</LI>
|
||||
' /// <LI>sStatustext. May be SqlString.Null</LI>
|
||||
' /// <LI>sEDOKA_Dokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>sEDOKA_Dokumenttyp. May be SqlString.Null</LI>
|
||||
' /// <LI>sApplikationsnr. May be SqlString.Null</LI>
|
||||
' /// <LI>sIndexdaten. 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_inport_Import_Eintrag_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_Eintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_Eintragnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_JobNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iImport_JobNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daTS", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daTS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sRecordNo", SqlDbType.VarChar, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sRecordNo))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sPartnernr", SqlDbType.VarChar, 9, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sPartnernr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDateityp", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDateityp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDateiname", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDateiname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sStatus", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sStatustext", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sStatustext))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sEDOKA_Dokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEDOKA_Dokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sEDOKA_Dokumenttyp", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEDOKA_Dokumenttyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sApplikationsnr", SqlDbType.VarChar, 4, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sApplikationsnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sIndexdaten", SqlDbType.VarChar, 4096, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sIndexdaten))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Eintrag_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("clsImport_Eintrag::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>iImport_Eintragnr</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_inport_Import_Eintrag_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_Eintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_Eintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Eintrag_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("clsImport_Eintrag::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>iImport_Eintragnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iImport_Eintragnr</LI>
|
||||
' /// <LI>iImport_JobNr</LI>
|
||||
' /// <LI>daTS</LI>
|
||||
' /// <LI>sRecordNo</LI>
|
||||
' /// <LI>sPartnernr</LI>
|
||||
' /// <LI>sDateityp</LI>
|
||||
' /// <LI>sDateiname</LI>
|
||||
' /// <LI>sStatus</LI>
|
||||
' /// <LI>sStatustext</LI>
|
||||
' /// <LI>sEDOKA_Dokumentid</LI>
|
||||
' /// <LI>sEDOKA_Dokumenttyp</LI>
|
||||
' /// <LI>sApplikationsnr</LI>
|
||||
' /// <LI>sIndexdaten</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_inport_Import_Eintrag_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Import_Eintrag")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iImport_Eintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_Eintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Eintrag_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iImport_Eintragnr = New SqlInt32(CType(dtToReturn.Rows(0)("Import_Eintragnr"), Integer))
|
||||
If dtToReturn.Rows(0)("Import_JobNr") Is System.DBNull.Value Then
|
||||
m_iImport_JobNr = SqlInt32.Null
|
||||
Else
|
||||
m_iImport_JobNr = New SqlInt32(CType(dtToReturn.Rows(0)("Import_JobNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("TS") Is System.DBNull.Value Then
|
||||
m_daTS = SqlDateTime.Null
|
||||
Else
|
||||
m_daTS = New SqlDateTime(CType(dtToReturn.Rows(0)("TS"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("RecordNo") Is System.DBNull.Value Then
|
||||
m_sRecordNo = SqlString.Null
|
||||
Else
|
||||
m_sRecordNo = New SqlString(CType(dtToReturn.Rows(0)("RecordNo"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Partnernr") Is System.DBNull.Value Then
|
||||
m_sPartnernr = SqlString.Null
|
||||
Else
|
||||
m_sPartnernr = New SqlString(CType(dtToReturn.Rows(0)("Partnernr"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Dateityp") Is System.DBNull.Value Then
|
||||
m_sDateityp = SqlString.Null
|
||||
Else
|
||||
m_sDateityp = New SqlString(CType(dtToReturn.Rows(0)("Dateityp"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Dateiname") Is System.DBNull.Value Then
|
||||
m_sDateiname = SqlString.Null
|
||||
Else
|
||||
m_sDateiname = New SqlString(CType(dtToReturn.Rows(0)("Dateiname"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Status") Is System.DBNull.Value Then
|
||||
m_sStatus = SqlString.Null
|
||||
Else
|
||||
m_sStatus = New SqlString(CType(dtToReturn.Rows(0)("Status"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Statustext") Is System.DBNull.Value Then
|
||||
m_sStatustext = SqlString.Null
|
||||
Else
|
||||
m_sStatustext = New SqlString(CType(dtToReturn.Rows(0)("Statustext"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("EDOKA_Dokumentid") Is System.DBNull.Value Then
|
||||
m_sEDOKA_Dokumentid = SqlString.Null
|
||||
Else
|
||||
m_sEDOKA_Dokumentid = New SqlString(CType(dtToReturn.Rows(0)("EDOKA_Dokumentid"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("EDOKA_Dokumenttyp") Is System.DBNull.Value Then
|
||||
m_sEDOKA_Dokumenttyp = SqlString.Null
|
||||
Else
|
||||
m_sEDOKA_Dokumenttyp = New SqlString(CType(dtToReturn.Rows(0)("EDOKA_Dokumenttyp"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Applikationsnr") Is System.DBNull.Value Then
|
||||
m_sApplikationsnr = SqlString.Null
|
||||
Else
|
||||
m_sApplikationsnr = New SqlString(CType(dtToReturn.Rows(0)("Applikationsnr"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Indexdaten") Is System.DBNull.Value Then
|
||||
m_sIndexdaten = SqlString.Null
|
||||
Else
|
||||
m_sIndexdaten = New SqlString(CType(dtToReturn.Rows(0)("Indexdaten"), 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("clsImport_Eintrag::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_inport_Import_Eintrag_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Import_Eintrag")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_inport_Import_Eintrag_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("clsImport_Eintrag::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 [iImport_Eintragnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iImport_Eintragnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iImport_EintragnrTmp As SqlInt32 = Value
|
||||
If iImport_EintragnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iImport_Eintragnr", "iImport_Eintragnr can't be NULL")
|
||||
End If
|
||||
m_iImport_Eintragnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iImport_JobNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iImport_JobNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iImport_JobNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daTS]() As SqlDateTime
|
||||
Get
|
||||
Return m_daTS
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daTS = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sRecordNo]() As SqlString
|
||||
Get
|
||||
Return m_sRecordNo
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sRecordNo = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sPartnernr]() As SqlString
|
||||
Get
|
||||
Return m_sPartnernr
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sPartnernr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDateityp]() As SqlString
|
||||
Get
|
||||
Return m_sDateityp
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDateityp = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDateiname]() As SqlString
|
||||
Get
|
||||
Return m_sDateiname
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDateiname = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sStatus]() As SqlString
|
||||
Get
|
||||
Return m_sStatus
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sStatus = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sStatustext]() As SqlString
|
||||
Get
|
||||
Return m_sStatustext
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sStatustext = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sEDOKA_Dokumentid]() As SqlString
|
||||
Get
|
||||
Return m_sEDOKA_Dokumentid
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sEDOKA_Dokumentid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sEDOKA_Dokumenttyp]() As SqlString
|
||||
Get
|
||||
Return m_sEDOKA_Dokumenttyp
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sEDOKA_Dokumenttyp = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sApplikationsnr]() As SqlString
|
||||
Get
|
||||
Return m_sApplikationsnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sApplikationsnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sIndexdaten]() As SqlString
|
||||
Get
|
||||
Return m_sIndexdaten
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sIndexdaten = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
469
edkb08/Datenbank/Journale/clsImport_Job.vb
Normal file
469
edkb08/Datenbank/Journale/clsImport_Job.vb
Normal file
@@ -0,0 +1,469 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'Import_Job'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Dienstag, 5. April 2005, 22:50:00
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'Import_Job'.
|
||||
' /// </summary>
|
||||
Public Class clsImport_Job
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_daEnde_TS, m_daStart_TS, m_daJournal_Datum As SqlDateTime
|
||||
Private m_iJournal_Ausgeliefert, m_iApplikationNr, m_iImport_JobNr, m_iFeherhaft 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>daStart_TS. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>daEnde_TS. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>iFeherhaft. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iApplikationNr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iJournal_Ausgeliefert. May be SqlInt32.Null</LI>
|
||||
' /// <LI>daJournal_Datum. May be SqlDateTime.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iImport_JobNr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Import_Job_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daStart_TS", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daStart_TS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daEnde_TS", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daEnde_TS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFeherhaft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFeherhaft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iApplikationNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iApplikationNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iJournal_Ausgeliefert", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iJournal_Ausgeliefert))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daJournal_Datum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daJournal_Datum))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iImport_JobNr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iImport_JobNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iImport_JobNr = scmCmdToExecute.Parameters.Item("@iImport_JobNr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Import_Job_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("clsImport_Job::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>iImport_JobNr</LI>
|
||||
' /// <LI>daStart_TS. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>daEnde_TS. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>iFeherhaft. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iApplikationNr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iJournal_Ausgeliefert. May be SqlInt32.Null</LI>
|
||||
' /// <LI>daJournal_Datum. May be SqlDateTime.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_Import_Job_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_JobNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_JobNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daStart_TS", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daStart_TS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daEnde_TS", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daEnde_TS))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iFeherhaft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFeherhaft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iApplikationNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iApplikationNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iJournal_Ausgeliefert", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iJournal_Ausgeliefert))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daJournal_Datum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daJournal_Datum))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Import_Job_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("clsImport_Job::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>iImport_JobNr</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_Import_Job_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iImport_JobNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_JobNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Import_Job_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("clsImport_Job::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>iImport_JobNr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iImport_JobNr</LI>
|
||||
' /// <LI>daStart_TS</LI>
|
||||
' /// <LI>daEnde_TS</LI>
|
||||
' /// <LI>iFeherhaft</LI>
|
||||
' /// <LI>iApplikationNr</LI>
|
||||
' /// <LI>iJournal_Ausgeliefert</LI>
|
||||
' /// <LI>daJournal_Datum</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_Import_Job_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Import_Job")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iImport_JobNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iImport_JobNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Import_Job_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iImport_JobNr = New SqlInt32(CType(dtToReturn.Rows(0)("Import_JobNr"), Integer))
|
||||
If dtToReturn.Rows(0)("Start_TS") Is System.DBNull.Value Then
|
||||
m_daStart_TS = SqlDateTime.Null
|
||||
Else
|
||||
m_daStart_TS = New SqlDateTime(CType(dtToReturn.Rows(0)("Start_TS"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Ende_TS") Is System.DBNull.Value Then
|
||||
m_daEnde_TS = SqlDateTime.Null
|
||||
Else
|
||||
m_daEnde_TS = New SqlDateTime(CType(dtToReturn.Rows(0)("Ende_TS"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Feherhaft") Is System.DBNull.Value Then
|
||||
m_iFeherhaft = SqlInt32.Null
|
||||
Else
|
||||
m_iFeherhaft = New SqlInt32(CType(dtToReturn.Rows(0)("Feherhaft"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ApplikationNr") Is System.DBNull.Value Then
|
||||
m_iApplikationNr = SqlInt32.Null
|
||||
Else
|
||||
m_iApplikationNr = New SqlInt32(CType(dtToReturn.Rows(0)("ApplikationNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Journal_Ausgeliefert") Is System.DBNull.Value Then
|
||||
m_iJournal_Ausgeliefert = SqlInt32.Null
|
||||
Else
|
||||
m_iJournal_Ausgeliefert = New SqlInt32(CType(dtToReturn.Rows(0)("Journal_Ausgeliefert"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Journal_Datum") Is System.DBNull.Value Then
|
||||
m_daJournal_Datum = SqlDateTime.Null
|
||||
Else
|
||||
m_daJournal_Datum = New SqlDateTime(CType(dtToReturn.Rows(0)("Journal_Datum"), 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("clsImport_Job::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_Import_Job_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("Import_Job")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_Import_Job_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("clsImport_Job::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 [iImport_JobNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iImport_JobNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iImport_JobNrTmp As SqlInt32 = Value
|
||||
If iImport_JobNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iImport_JobNr", "iImport_JobNr can't be NULL")
|
||||
End If
|
||||
m_iImport_JobNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daStart_TS]() As SqlDateTime
|
||||
Get
|
||||
Return m_daStart_TS
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daStart_TS = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daEnde_TS]() As SqlDateTime
|
||||
Get
|
||||
Return m_daEnde_TS
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daEnde_TS = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFeherhaft]() As SqlInt32
|
||||
Get
|
||||
Return m_iFeherhaft
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFeherhaft = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iApplikationNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iApplikationNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iApplikationNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iJournal_Ausgeliefert]() As SqlInt32
|
||||
Get
|
||||
Return m_iJournal_Ausgeliefert
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iJournal_Ausgeliefert = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daJournal_Datum]() As SqlDateTime
|
||||
Get
|
||||
Return m_daJournal_Datum
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daJournal_Datum = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
BIN
edkb08/Datenbank/Journale/vssver.scc
Normal file
BIN
edkb08/Datenbank/Journale/vssver.scc
Normal file
Binary file not shown.
390
edkb08/Datenbank/clsAvaloq.vb
Normal file
390
edkb08/Datenbank/clsAvaloq.vb
Normal file
@@ -0,0 +1,390 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.OracleClient
|
||||
|
||||
Namespace Avaloq
|
||||
|
||||
Public Class SST
|
||||
Const queryString As String = "k.tkb$out_dsp_in#.edoka_in"
|
||||
Const queryStringGetValues As String = "k.tkb$out_dsp_in#.edoka_get_values"
|
||||
Const queryStringOpenSession As String = "k.session#.open_session"
|
||||
Const queryStringCloseSession As String = "k.session#.close_session"
|
||||
Const avqOracleUser As String = "TKB$I_EDOKA"
|
||||
Const avqSecUserId As Integer = 34
|
||||
Const avqBuId As Integer = 1
|
||||
|
||||
Const edkFaDokTyp As String = "1688"
|
||||
|
||||
'Const edkDokBezeichnungKey As String = "edk_bez"
|
||||
'Const edkDokBezeichnungDflt As String = "Antworttalon"
|
||||
Dim connStrg As String
|
||||
|
||||
|
||||
Private _hasErrors As Boolean
|
||||
|
||||
Private _dlvEDK As Boolean
|
||||
Private _dlvAVQ As Boolean
|
||||
|
||||
Private _edkDokNr As String
|
||||
Private _edkDokTypOvr As Boolean
|
||||
Private _edkDokBezeichnung As String
|
||||
Private _qrcode As String
|
||||
Private _bpnr As String
|
||||
|
||||
|
||||
|
||||
Public Sub New()
|
||||
oread = System.IO.File.OpenText(DivFnkt.ApplicationPath + "avaloqconn.cfg")
|
||||
connStrg = oread.ReadLine
|
||||
oread.Close()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public ReadOnly Property hasErrors() As Boolean
|
||||
Get
|
||||
Return _hasErrors
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DeliverToEDK As Boolean
|
||||
Get
|
||||
Return _dlvEDK
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DeliverToAVQ As Boolean
|
||||
Get
|
||||
Return _dlvAVQ
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property BPNr As String
|
||||
Get
|
||||
Return _bpnr
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property edkDokNr As String
|
||||
Get
|
||||
Return _edkDokNr
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property edkDokTypOvr As Boolean
|
||||
Get
|
||||
Return _edkDokTypOvr
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property edkDokBezeichnung As String
|
||||
Get
|
||||
Return _edkDokBezeichnung
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Private Sub InitItem()
|
||||
_hasErrors = False
|
||||
_dlvEDK = True
|
||||
_dlvAVQ = True
|
||||
_bpnr = Nothing
|
||||
_edkDokNr = Nothing
|
||||
_edkDokTypOvr = False
|
||||
_edkDokBezeichnung = Nothing
|
||||
_qrcode = Nothing
|
||||
End Sub
|
||||
|
||||
Public Sub Prepare(ByVal BPNr As String, ByVal XmlDokTypNr As String, ByVal Instructions As String, ByVal dlvEDK As String, ByVal dlvAVQ As String)
|
||||
PrintOut("AVQ Prepare Start")
|
||||
InitItem()
|
||||
|
||||
If Instructions.IndexOf("dms_id:;bp_nr:;attr1:") > -1 Then
|
||||
Instructions = Instructions.Replace("dms_id:;bp_nr:;attr1:", "")
|
||||
End If
|
||||
_qrcode = Instructions
|
||||
|
||||
If Len(XmlDokTypNr) > 0 Then
|
||||
If XmlDokTypNr <> edkFaDokTyp Then
|
||||
'DokTyp ist ein Edoka-Doktyp
|
||||
_edkDokNr = XmlDokTypNr
|
||||
_edkDokTypOvr = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If dlvEDK = "0" Then
|
||||
_dlvEDK = False
|
||||
End If
|
||||
|
||||
If dlvAVQ = "0" Then
|
||||
_dlvAVQ = False
|
||||
End If
|
||||
|
||||
If Len(_qrcode) > 0 Then
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If _dlvAVQ = True Or _dlvEDK = True Then
|
||||
|
||||
GetAvqData(BPNr, Instructions)
|
||||
|
||||
If Len(BPNr) > 0 And BPNr <> _bpnr Then
|
||||
|
||||
'Wahrscheinlich falsch manuell indexiert
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'If Len(_qrcode) > 0 Then
|
||||
' _hasQrCode = True
|
||||
'
|
||||
''EDOKA-Dokument-Bezeichnung auslesen
|
||||
'Try
|
||||
'For Each pairs As String In _qrcode.Split(";"c)
|
||||
'Dim values As String() = pairs.Split(":"c)
|
||||
'If values(0) = edkDokBezeichnungKey Then
|
||||
' _edkDokBezeichnung = values(1)
|
||||
' End If
|
||||
' Next
|
||||
' Catch ex As Exception
|
||||
' _hasErrors = True
|
||||
' _edkDokBezeichnung = edkDokBezeichnungDflt
|
||||
' End Try
|
||||
' Else
|
||||
' _hasErrors = True
|
||||
' _edkDokBezeichnung = edkDokBezeichnungDflt
|
||||
' End If
|
||||
PrintOut("AVQ Prepare Ende")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub GetAvqData(ByVal BPNr As String, ByVal Instructions As String)
|
||||
PrintOut("GetAVQData Start")
|
||||
Dim dataReader As OracleDataReader
|
||||
Dim connectionSession As New OracleConnection
|
||||
|
||||
connectionSession.ConnectionString = connStrg
|
||||
'OracleConnection.ClearAllPools()
|
||||
Dim command As OracleCommand = connectionSession.CreateCommand()
|
||||
|
||||
command.Parameters.Clear()
|
||||
|
||||
command.CommandText = queryStringOpenSession
|
||||
command.CommandType = CommandType.StoredProcedure
|
||||
command.Parameters.Add(New OracleParameter("i_sec_user_id", OracleType.Int32)).Value = avqSecUserId
|
||||
command.Parameters.Add(New OracleParameter("i_oracle_user", OracleType.VarChar)).Value = avqOracleUser
|
||||
command.Parameters.Add(New OracleParameter("i_bu_id", OracleType.Int32)).Value = avqBuId
|
||||
Try
|
||||
connectionSession.Open()
|
||||
command.ExecuteReader()
|
||||
'dataReader.Read()
|
||||
'dataReader.Close()
|
||||
'dataReader.Dispose()
|
||||
Catch ex As Exception
|
||||
PrintOut("Get_AVQ_Data (1):" + ex.Message)
|
||||
If connectionSession.State = ConnectionState.Closed Then
|
||||
connectionSession.Open()
|
||||
command.ExecuteReader()
|
||||
End If
|
||||
End Try
|
||||
|
||||
|
||||
command.Parameters.Clear()
|
||||
|
||||
command.CommandText = queryStringGetValues
|
||||
command.CommandType = CommandType.StoredProcedure
|
||||
command.Parameters.Add(New OracleParameter("i_bp_nr", OracleType.VarChar)).Value = BPNr
|
||||
command.Parameters.Add(New OracleParameter("i_instructions", OracleType.VarChar)).Value = Instructions
|
||||
command.Parameters.Add(New OracleParameter("o_bp_nr", OracleType.Char, 4000)).Direction = ParameterDirection.Output
|
||||
command.Parameters.Add(New OracleParameter("o_edk_dok_nr", OracleType.Char, 4000)).Direction = ParameterDirection.Output
|
||||
command.Parameters.Add(New OracleParameter("o_edk_dok_bez", OracleType.Char, 4000)).Direction = ParameterDirection.Output
|
||||
command.Parameters.Add(New OracleParameter("o_ret_val", OracleType.Char, 4000)).Direction = ParameterDirection.Output
|
||||
|
||||
Try
|
||||
If connectionSession.State = ConnectionState.Open Then
|
||||
'nothing
|
||||
Else
|
||||
connectionSession.Open()
|
||||
End If
|
||||
|
||||
|
||||
dataReader = command.ExecuteReader()
|
||||
dataReader.Read()
|
||||
|
||||
Dim rbpnr As String = Trim(command.Parameters.Item(2).Value)
|
||||
Dim rdoktypnr As String = Trim(command.Parameters.Item(3).Value)
|
||||
Dim rdokbez As String = Trim(command.Parameters.Item(4).Value)
|
||||
Dim ret As String = Trim(command.Parameters.Item(5).Value)
|
||||
|
||||
If ret = "OK" Then
|
||||
_hasErrors = False
|
||||
Else
|
||||
_hasErrors = True
|
||||
End If
|
||||
|
||||
_bpnr = rbpnr
|
||||
_edkDokBezeichnung = rdokbez 'Edoka-Dokumentbezeichnung für allfälligen Override UND für den Standard-Fall
|
||||
|
||||
If _edkDokTypOvr = False Then
|
||||
'Falls Doktyp-Override aus Scanning kommt, ist Definition in Avaloq-Table-Editor irrelevant
|
||||
If Len(rdoktypnr) > 0 And rdoktypnr <> edkFaDokTyp Then
|
||||
_edkDokNr = rdoktypnr
|
||||
_edkDokTypOvr = True
|
||||
End If
|
||||
End If
|
||||
|
||||
dataReader.Close()
|
||||
dataReader.Dispose()
|
||||
connectionSession.Close()
|
||||
connectionSession.Dispose()
|
||||
'ACHTUNG
|
||||
connectionSession = Nothing
|
||||
dataReader = Nothing
|
||||
command = Nothing
|
||||
|
||||
'ACHTUNG
|
||||
|
||||
Catch ex As Exception
|
||||
PrintOut("Get_AVQ_Data (2):" + ex.Message)
|
||||
|
||||
Console.WriteLine(ex.Message)
|
||||
If connectionSession.State = ConnectionState.Open Then
|
||||
command.Parameters.Clear()
|
||||
command.CommandText = "k.session#.close_session"
|
||||
command.CommandType = CommandType.StoredProcedure
|
||||
Try
|
||||
dataReader = command.ExecuteReader()
|
||||
dataReader.Read()
|
||||
dataReader.Close()
|
||||
dataReader.Dispose()
|
||||
Catch ex1 As Exception
|
||||
|
||||
End Try
|
||||
|
||||
command.Dispose()
|
||||
connectionSession.Close()
|
||||
connectionSession.Dispose()
|
||||
Console.WriteLine(connectionSession.State)
|
||||
End If
|
||||
End Try
|
||||
PrintOut("GetAVQData Ende")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Sub SendData()
|
||||
PrintOut("AVQ Sendata Start")
|
||||
|
||||
If Len(_bpnr) = 0 Or Len(_qrcode) = 0 Then
|
||||
_hasErrors = True
|
||||
Return
|
||||
End If
|
||||
|
||||
|
||||
_hasErrors = True 'wird bei erfolgreicher Übermittlung auf false gesetellt
|
||||
|
||||
Dim dataReader As OracleDataReader
|
||||
Dim connectionSession As New OracleConnection
|
||||
|
||||
connectionSession.ConnectionString = connStrg
|
||||
'OracleConnection.ClearAllPools()
|
||||
Dim command As OracleCommand = connectionSession.CreateCommand()
|
||||
|
||||
command.Parameters.Clear()
|
||||
|
||||
command.CommandText = queryStringOpenSession
|
||||
command.CommandType = CommandType.StoredProcedure
|
||||
command.Parameters.Add(New OracleParameter("i_sec_user_id", OracleType.Int32)).Value = avqSecUserId
|
||||
command.Parameters.Add(New OracleParameter("i_oracle_user", OracleType.VarChar)).Value = avqOracleUser
|
||||
command.Parameters.Add(New OracleParameter("i_bu_id", OracleType.Int32)).Value = avqBuId
|
||||
Try
|
||||
connectionSession.Open()
|
||||
'connectionSession.Open()
|
||||
'connectionSession.open
|
||||
'dataReader =
|
||||
command.ExecuteReader()
|
||||
'dataReader.Read()
|
||||
'dataReader.Close()
|
||||
'dataReader.Dispose()
|
||||
Catch ex As Exception
|
||||
PrintOut("AVQ Send_Data (1):" + ex.Message)
|
||||
|
||||
If connectionSession.State = ConnectionState.Closed Then
|
||||
connectionSession.Open()
|
||||
command.ExecuteReader()
|
||||
End If
|
||||
End Try
|
||||
|
||||
|
||||
command.Parameters.Clear()
|
||||
|
||||
command.CommandText = queryString
|
||||
command.CommandType = CommandType.StoredProcedure
|
||||
command.Parameters.Add(New OracleParameter("i_bp_nr", OracleType.VarChar)).Value = _bpnr
|
||||
command.Parameters.Add(New OracleParameter("i_instructions", OracleType.VarChar)).Value = _qrcode
|
||||
command.Parameters.Add(New OracleParameter("o_ret_val", OracleType.VarChar, 20)).Direction = ParameterDirection.Output
|
||||
|
||||
Try
|
||||
If connectionSession.State = ConnectionState.Open Then
|
||||
'nothing
|
||||
Else
|
||||
connectionSession.Open()
|
||||
End If
|
||||
|
||||
|
||||
dataReader = command.ExecuteReader()
|
||||
dataReader.Read()
|
||||
|
||||
Dim result As String = command.Parameters.Item(2).Value
|
||||
If result = "OK" Then
|
||||
_hasErrors = False
|
||||
Else
|
||||
_hasErrors = True
|
||||
End If
|
||||
|
||||
dataReader.Close()
|
||||
dataReader.Dispose()
|
||||
connectionSession.Close()
|
||||
connectionSession.Dispose()
|
||||
'ACHTUNG
|
||||
connectionSession = Nothing
|
||||
dataReader = Nothing
|
||||
command = Nothing
|
||||
|
||||
'ACHTUNG
|
||||
|
||||
Catch ex As Exception
|
||||
PrintOut("AVQ Send_Data (2):" + ex.Message)
|
||||
|
||||
Console.WriteLine(ex.Message)
|
||||
If connectionSession.State = ConnectionState.Open Then
|
||||
command.Parameters.Clear()
|
||||
command.CommandText = "k.session#.close_session"
|
||||
command.CommandType = CommandType.StoredProcedure
|
||||
Try
|
||||
dataReader = command.ExecuteReader()
|
||||
dataReader.Read()
|
||||
dataReader.Close()
|
||||
dataReader.Dispose()
|
||||
Catch ex1 As Exception
|
||||
|
||||
End Try
|
||||
|
||||
command.Dispose()
|
||||
connectionSession.Close()
|
||||
connectionSession.Dispose()
|
||||
Console.WriteLine(connectionSession.State)
|
||||
End If
|
||||
End Try
|
||||
PrintOut("AVQ Sendata Ende")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
289
edkb08/Datenbank/clsConnectionProvider.vb
Normal file
289
edkb08/Datenbank/clsConnectionProvider.vb
Normal file
@@ -0,0 +1,289 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Connection Provider class for Database connection sharing
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 00:06:25
|
||||
' // This class implements IDisposable.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Collections
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: provides a SqlConnection object which can be shared among data-access tier objects
|
||||
' /// to provide a way to do ADO.NET transaction coding without the hassling with SqlConnection objects
|
||||
' /// on a high level.
|
||||
' /// </summary>
|
||||
Public Class clsConnectionProvider
|
||||
Implements IDisposable
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_scoDBConnection As SqlConnection
|
||||
Private m_bIsTransactionPending, m_bIsDisposed As Boolean
|
||||
Private m_stCurrentTransaction As SqlTransaction
|
||||
Private m_alSavePoints As ArrayList
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Sub New()
|
||||
' // Init the class
|
||||
InitClass()
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the IDispose' method Dispose.
|
||||
' /// </summary>
|
||||
Overloads Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the Dispose functionality.
|
||||
' /// </summary>
|
||||
Overridable Overloads Protected Sub Dispose(ByVal bIsDisposing As Boolean)
|
||||
' // Check to see if Dispose has already been called.
|
||||
If Not m_bIsDisposed Then
|
||||
If bIsDisposing Then
|
||||
' // Dispose managed resources.
|
||||
If Not (m_stCurrentTransaction Is Nothing) Then
|
||||
m_stCurrentTransaction.Dispose()
|
||||
m_stCurrentTransaction = Nothing
|
||||
End If
|
||||
If Not (m_scoDBConnection Is Nothing) Then
|
||||
' // closing the connection will abort (rollback) any pending transactions
|
||||
m_scoDBConnection.Close()
|
||||
m_scoDBConnection.Dispose()
|
||||
m_scoDBConnection = Nothing
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
m_bIsDisposed = True
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Initializes class members.
|
||||
' /// </summary>
|
||||
Private Sub InitClass()
|
||||
' // Create all the objects and initialize other members.
|
||||
m_scoDBConnection = new SqlConnection()
|
||||
m_bIsDisposed = False
|
||||
m_stCurrentTransaction = Nothing
|
||||
m_bIsTransactionPending = False
|
||||
m_alSavePoints = new ArrayList()
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Opens the connection object.
|
||||
' /// </summary>
|
||||
' /// <returns>True, if succeeded, otherwise an Exception exception is thrown.</returns>
|
||||
Public Function OpenConnection() As Boolean
|
||||
Try
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) > 0 Then
|
||||
' // It's already open.
|
||||
Throw New Exception("OpenConnection::Connection is already open.")
|
||||
End If
|
||||
m_scoDBConnection.Open()
|
||||
m_bIsTransactionPending = False
|
||||
m_alSavePoints.Clear()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Starts a new ADO.NET transaction using the open connection object of this class.
|
||||
' /// </summary>
|
||||
' /// <param name="sTransactionName">Name of the transaction to start</param>
|
||||
' /// <returns>True, if transaction is started correctly, otherwise an Exception exception is thrown</returns>
|
||||
Public Function BeginTransaction(sTransactionName As String) As Boolean
|
||||
Try
|
||||
If m_bIsTransactionPending Then
|
||||
' // no nested transactions allowed.
|
||||
Throw New Exception("BeginTransaction::Already transaction pending. Nesting not allowed")
|
||||
End If
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // no open connection
|
||||
Throw New Exception("BeginTransaction::Connection is not open.")
|
||||
End If
|
||||
' // begin the transaction and store the transaction object.
|
||||
m_stCurrentTransaction = m_scoDBConnection.BeginTransaction(IsolationLevel.ReadCommitted, sTransactionName)
|
||||
m_bIsTransactionPending = True
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Commits a pending transaction on the open connection object of this class.
|
||||
' /// </summary>
|
||||
' /// <returns>True, if commit was succesful, or an Exception exception is thrown</returns>
|
||||
Public Function CommitTransaction() As Boolean
|
||||
Try
|
||||
If Not m_bIsTransactionPending Then
|
||||
' // no transaction pending
|
||||
Throw New Exception("CommitTransaction::No transaction pending.")
|
||||
End If
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // no open connection
|
||||
Throw New Exception("CommitTransaction::Connection is not open.")
|
||||
End if
|
||||
' // commit the transaction
|
||||
m_stCurrentTransaction.Commit()
|
||||
m_bIsTransactionPending = False
|
||||
m_stCurrentTransaction.Dispose()
|
||||
m_stCurrentTransaction = Nothing
|
||||
m_alSavePoints.Clear()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Rolls back a pending transaction on the open connection object of this class,
|
||||
' /// or rolls back to the savepoint with the given name. Savepoints are created with SaveTransaction().
|
||||
' /// </summary>
|
||||
' /// <param name="sTransactionToRollback">Name of transaction to roll back. Can be name of savepoint</param>
|
||||
' /// <returns>True, if rollback was succesful, or an Exception exception is thrown</returns>
|
||||
Public Function RollbackTransaction(sTransactionToRollback As String) As Boolean
|
||||
Try
|
||||
If Not m_bIsTransactionPending Then
|
||||
' // no transaction pending
|
||||
Throw New Exception("RollbackTransaction::No transaction pending.")
|
||||
End If
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // no open connection
|
||||
Throw New Exception("RollbackTransaction::Connection is not open.")
|
||||
End If
|
||||
' // rollback the transaction
|
||||
m_stCurrentTransaction.Rollback(sTransactionToRollback)
|
||||
' // if this wasn't a savepoint, we've rolled back the complete transaction, so we
|
||||
' // can clean it up.
|
||||
If Not m_alSavePoints.Contains(sTransactionToRollback) Then
|
||||
' // it's not a savepoint
|
||||
m_bIsTransactionPending = False
|
||||
m_stCurrentTransaction.Dispose()
|
||||
m_stCurrentTransaction = Nothing
|
||||
m_alSavePoints.Clear()
|
||||
End If
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Saves a pending transaction on the open connection object of this class to a 'savepoint'
|
||||
' /// with the given name.
|
||||
' /// When a rollback is issued, the caller can rollback to this savepoint or roll back the complete transaction.
|
||||
' /// </summary>
|
||||
' /// <param name="sSavePointName">Name of the savepoint to store the current transaction under.</param>
|
||||
' /// <returns>True, if save was succesful, or an Exception exception is thrown</returns>
|
||||
Public Function SaveTransaction(sSavePointName As String) As Boolean
|
||||
Try
|
||||
If Not m_bIsTransactionPending Then
|
||||
' // no transaction pending
|
||||
Throw New Exception("SaveTransaction::No transaction pending.")
|
||||
End If
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // no open connection
|
||||
Throw New Exception("SaveTransaction::Connection is not open.")
|
||||
End If
|
||||
' // save the transaction
|
||||
m_stCurrentTransaction.Save(sSavePointName)
|
||||
' // Store the savepoint in the list.
|
||||
m_alSavePoints.Add(sSavePointName)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Closes the open connection. Depending on bCommitPendingTransactions, a pending
|
||||
' /// transaction is commited, or aborted.
|
||||
' /// </summary>
|
||||
' /// <param name="bCommitPendingTransaction">Flag for what to do when a transaction is still pending. True
|
||||
' /// will commit the current transaction, False will abort (rollback) the complete current transaction.</param>
|
||||
' /// <returns>True, if close was succesful, False if connection was already closed, or an Exception exception is thrown when
|
||||
' /// an error occurs</returns>
|
||||
Public Function CloseConnection(bCommitPendingTransaction As Boolean) As Boolean
|
||||
Try
|
||||
If (m_scoDBConnection.State And ConnectionState.Open) = 0 Then
|
||||
' // No open connection
|
||||
Return False
|
||||
End If
|
||||
If m_bIsTransactionPending Then
|
||||
If bCommitPendingTransaction Then
|
||||
' // Commit the pending transaction
|
||||
m_stCurrentTransaction.Commit()
|
||||
Else
|
||||
' // Rollback the pending transaction
|
||||
m_stCurrentTransaction.Rollback()
|
||||
End If
|
||||
m_bIsTransactionPending = False
|
||||
m_stCurrentTransaction.Dispose()
|
||||
m_stCurrentTransaction = Nothing
|
||||
m_alSavePoints.Clear()
|
||||
End If
|
||||
' // close the connection
|
||||
m_scoDBConnection.Close()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // bubble exception
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public ReadOnly Property stCurrentTransaction() As SqlTransaction
|
||||
Get
|
||||
Return m_stCurrentTransaction
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property bIsTransactionPending() As Boolean
|
||||
Get
|
||||
Return m_bIsTransactionPending
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property scoDBConnection() As SqlConnection
|
||||
Get
|
||||
Return m_scoDBConnection
|
||||
End Get
|
||||
End Property
|
||||
Public WriteOnly Property sConnectionString() As String
|
||||
Set (ByVal Value As String)
|
||||
m_scoDBConnection.ConnectionString = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
202
edkb08/Datenbank/clsDBInteractionBase.vb
Normal file
202
edkb08/Datenbank/clsDBInteractionBase.vb
Normal file
@@ -0,0 +1,202 @@
|
||||
' //////////////////////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Base class for Database Interaction.
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 18. Mai 2003, 00:06:25
|
||||
' // Because this class implements IDisposable, derived classes shouldn't do so.
|
||||
' //////////////////////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Configuration
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Error Enums used by this LLBL library.
|
||||
' /// </summary>
|
||||
Public Enum LLBLError
|
||||
AllOk
|
||||
' // Add more here (check the comma's!)
|
||||
End Enum
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: General interface of the API generated. Contains only common methods of all classes.
|
||||
' /// </summary>
|
||||
Public Interface ICommonDBAccess
|
||||
Function Insert() As Boolean
|
||||
Function Update() As Boolean
|
||||
Function Delete() As Boolean
|
||||
Function SelectOne() As DataTable
|
||||
Function SelectAll() As DataTable
|
||||
End Interface
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Abstract base class for Database Interaction classes.
|
||||
' /// </summary>
|
||||
Public MustInherit Class clsDBInteractionBase
|
||||
Implements IDisposable
|
||||
Implements ICommonDBAccess
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Protected m_scoMainConnection As SqlConnection
|
||||
Protected m_iErrorCode As SqlInt32
|
||||
Protected m_bMainConnectionIsCreatedLocal As Boolean
|
||||
Protected m_cpMainConnectionProvider As clsConnectionProvider
|
||||
Private m_sConnectionString As String
|
||||
Private m_bIsDisposed As Boolean
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Class constructor.
|
||||
' /// </summary>
|
||||
Public Sub New()
|
||||
' // Initialize the class' members.
|
||||
InitClass()
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Initializes class members.
|
||||
' /// </summary>
|
||||
Private Sub InitClass()
|
||||
' // create all the objects and initialize other members.
|
||||
m_scoMainConnection = new SqlConnection()
|
||||
m_bMainConnectionIsCreatedLocal = True
|
||||
m_cpMainConnectionProvider = Nothing
|
||||
m_iErrorCode = New SqlInt32(LLBLError.AllOk)
|
||||
m_bIsDisposed = False
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the IDispose' method Dispose.
|
||||
' /// </summary>
|
||||
Overloads Public Sub Dispose() Implements IDisposable.Dispose
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the Dispose functionality.
|
||||
' /// </summary>
|
||||
Overridable Overloads Protected Sub Dispose(ByVal bIsDisposing As Boolean)
|
||||
' // Check to see if Dispose has already been called.
|
||||
If Not m_bIsDisposed Then
|
||||
If bIsDisposing Then
|
||||
' // Dispose managed resources.
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Object is created in this class, so destroy it here.
|
||||
m_scoMainConnection.Close()
|
||||
m_scoMainConnection.Dispose()
|
||||
m_bMainConnectionIsCreatedLocal = True
|
||||
End If
|
||||
m_cpMainConnectionProvider = Nothing
|
||||
m_scoMainConnection = Nothing
|
||||
End If
|
||||
End If
|
||||
m_bIsDisposed = True
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Insert() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Insert() As Boolean Implements ICommonDBAccess.Insert
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Delete() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Delete() As Boolean Implements ICommonDBAccess.Delete
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.Update() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function Update() As Boolean Implements ICommonDBAccess.Update
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.SelectOne() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function SelectOne() As DataTable Implements ICommonDBAccess.SelectOne
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Implements the ICommonDBAccess.SelectAll() method.
|
||||
' /// </summary>
|
||||
Public Overridable Function SelectAll() As DataTable Implements ICommonDBAccess.SelectAll
|
||||
' // No implementation, throw exception
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public WriteOnly Property cpMainConnectionProvider() As clsConnectionProvider
|
||||
Set(ByVal Value As clsConnectionProvider)
|
||||
If Value Is Nothing Then
|
||||
' // Invalid value
|
||||
Throw New ArgumentNullException("cpMainConnectionProvider", "Nothing passed as value to this property which is not allowed.")
|
||||
End If
|
||||
|
||||
' // A connection provider object is passed to this class.
|
||||
' // Retrieve the SqlConnection object, if present and create a
|
||||
' // reference to it. If there is already a MainConnection object
|
||||
' // referenced by the membervar, destroy that one or simply
|
||||
' // remove the reference, based on the flag.
|
||||
If Not (m_scoMainConnection Is Nothing) Then
|
||||
' // First get rid of current connection object. Caller is responsible
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Is local created object, close it and dispose it.
|
||||
m_scoMainConnection.Close()
|
||||
m_scoMainConnection.Dispose()
|
||||
End If
|
||||
' // Remove reference.
|
||||
m_scoMainConnection = Nothing
|
||||
End If
|
||||
m_cpMainConnectionProvider = CType(Value, clsConnectionProvider)
|
||||
m_scoMainConnection = m_cpMainConnectionProvider.scoDBConnection
|
||||
m_bMainConnectionIsCreatedLocal = False
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property iErrorCode() As SqlInt32
|
||||
Get
|
||||
Return m_iErrorCode
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public Property sConnectionString() As String
|
||||
Get
|
||||
Return m_sConnectionString
|
||||
End Get
|
||||
Set (ByVal Value As String)
|
||||
m_sConnectionString = Value
|
||||
m_scoMainConnection.ConnectionString = m_sConnectionString
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
1890
edkb08/Datenbank/clsDokument.vb
Normal file
1890
edkb08/Datenbank/clsDokument.vb
Normal file
File diff suppressed because it is too large
Load Diff
591
edkb08/Datenbank/clsDokument_status.vb
Normal file
591
edkb08/Datenbank/clsDokument_status.vb
Normal file
@@ -0,0 +1,591 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'dokument_status'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Montag, 9. Juni 2003, 08:18: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 edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'dokument_status'.
|
||||
' /// </summary>
|
||||
Public Class clsDokument_status
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bDokument_bearbeitung_moeglich, m_bFolgestatus_durch_anderen_verantwortlichen, m_bDokument_ausgangsarchivierung, m_bAktiv, m_bDokument_bearbeitung_abgeschlossen As SqlBoolean
|
||||
Private m_daErstellt_am As SqlDateTime
|
||||
Private m_iDokument_statusnr, m_iMutierer, m_iStatus_bezeichnungnr, m_iErledigung_ab As SqlInt32
|
||||
Private m_sReihenfolge, m_sBezeichnung, m_sDokumenitid 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>sDokumenitid. May be SqlString.Null</LI>
|
||||
' /// <LI>iStatus_bezeichnungnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
' /// <LI>sReihenfolge. May be SqlString.Null</LI>
|
||||
' /// <LI>bFolgestatus_durch_anderen_verantwortlichen. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bDokument_bearbeitung_moeglich. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>iErledigung_ab. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bDokument_ausgangsarchivierung. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bDokument_bearbeitung_abgeschlossen. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>daErstellt_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>iDokument_statusnr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokument_status_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumenitid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumenitid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus_bezeichnungnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus_bezeichnungnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sreihenfolge", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sReihenfolge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bfolgestatus_durch_anderen_verantwortlichen", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bFolgestatus_durch_anderen_verantwortlichen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bdokument_bearbeitung_moeglich", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_moeglich))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ierledigung_ab", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iErledigung_ab))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bdokument_ausgangsarchivierung", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bDokument_ausgangsarchivierung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bdokument_bearbeitung_abgeschlossen", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_abgeschlossen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokument_statusnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iDokument_statusnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iDokument_statusnr = scmCmdToExecute.Parameters.Item("@idokument_statusnr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokument_status_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("clsDokument_status::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>iDokument_statusnr</LI>
|
||||
' /// <LI>sDokumenitid. May be SqlString.Null</LI>
|
||||
' /// <LI>iStatus_bezeichnungnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
' /// <LI>sReihenfolge. May be SqlString.Null</LI>
|
||||
' /// <LI>bFolgestatus_durch_anderen_verantwortlichen. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bDokument_bearbeitung_moeglich. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>iErledigung_ab. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bDokument_ausgangsarchivierung. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bDokument_bearbeitung_abgeschlossen. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>daErstellt_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_dokument_status_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@idokument_statusnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDokument_statusnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumenitid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumenitid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus_bezeichnungnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus_bezeichnungnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sreihenfolge", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sReihenfolge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bfolgestatus_durch_anderen_verantwortlichen", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bFolgestatus_durch_anderen_verantwortlichen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bdokument_bearbeitung_moeglich", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_moeglich))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ierledigung_ab", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iErledigung_ab))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bdokument_ausgangsarchivierung", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bDokument_ausgangsarchivierung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bdokument_bearbeitung_abgeschlossen", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_abgeschlossen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokument_status_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("clsDokument_status::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>iDokument_statusnr</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_dokument_status_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@idokument_statusnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDokument_statusnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokument_status_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("clsDokument_status::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>iDokument_statusnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iDokument_statusnr</LI>
|
||||
' /// <LI>sDokumenitid</LI>
|
||||
' /// <LI>iStatus_bezeichnungnr</LI>
|
||||
' /// <LI>sBezeichnung</LI>
|
||||
' /// <LI>sReihenfolge</LI>
|
||||
' /// <LI>bFolgestatus_durch_anderen_verantwortlichen</LI>
|
||||
' /// <LI>bDokument_bearbeitung_moeglich</LI>
|
||||
' /// <LI>iErledigung_ab</LI>
|
||||
' /// <LI>bDokument_ausgangsarchivierung</LI>
|
||||
' /// <LI>bDokument_bearbeitung_abgeschlossen</LI>
|
||||
' /// <LI>bAktiv</LI>
|
||||
' /// <LI>daErstellt_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_dokument_status_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("dokument_status")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokument_statusnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iDokument_statusnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokument_status_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iDokument_statusnr = New SqlInt32(CType(dtToReturn.Rows(0)("dokument_statusnr"), Integer))
|
||||
If dtToReturn.Rows(0)("dokumenitid") Is System.DBNull.Value Then
|
||||
m_sDokumenitid = SqlString.Null
|
||||
Else
|
||||
m_sDokumenitid = New SqlString(CType(dtToReturn.Rows(0)("dokumenitid"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("status_bezeichnungnr") Is System.DBNull.Value Then
|
||||
m_iStatus_bezeichnungnr = SqlInt32.Null
|
||||
Else
|
||||
m_iStatus_bezeichnungnr = New SqlInt32(CType(dtToReturn.Rows(0)("status_bezeichnungnr"), 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)("reihenfolge") Is System.DBNull.Value Then
|
||||
m_sReihenfolge = SqlString.Null
|
||||
Else
|
||||
m_sReihenfolge = New SqlString(CType(dtToReturn.Rows(0)("reihenfolge"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("folgestatus_durch_anderen_verantwortlichen") Is System.DBNull.Value Then
|
||||
m_bFolgestatus_durch_anderen_verantwortlichen = SqlBoolean.Null
|
||||
Else
|
||||
m_bFolgestatus_durch_anderen_verantwortlichen = New SqlBoolean(CType(dtToReturn.Rows(0)("folgestatus_durch_anderen_verantwortlichen"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dokument_bearbeitung_moeglich") Is System.DBNull.Value Then
|
||||
m_bDokument_bearbeitung_moeglich = SqlBoolean.Null
|
||||
Else
|
||||
m_bDokument_bearbeitung_moeglich = New SqlBoolean(CType(dtToReturn.Rows(0)("dokument_bearbeitung_moeglich"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erledigung_ab") Is System.DBNull.Value Then
|
||||
m_iErledigung_ab = SqlInt32.Null
|
||||
Else
|
||||
m_iErledigung_ab = New SqlInt32(CType(dtToReturn.Rows(0)("erledigung_ab"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dokument_ausgangsarchivierung") Is System.DBNull.Value Then
|
||||
m_bDokument_ausgangsarchivierung = SqlBoolean.Null
|
||||
Else
|
||||
m_bDokument_ausgangsarchivierung = New SqlBoolean(CType(dtToReturn.Rows(0)("dokument_ausgangsarchivierung"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dokument_bearbeitung_abgeschlossen") Is System.DBNull.Value Then
|
||||
m_bDokument_bearbeitung_abgeschlossen = SqlBoolean.Null
|
||||
Else
|
||||
m_bDokument_bearbeitung_abgeschlossen = New SqlBoolean(CType(dtToReturn.Rows(0)("dokument_bearbeitung_abgeschlossen"), 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)("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("clsDokument_status::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_dokument_status_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("dokument_status")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokument_status_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("clsDokument_status::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 [iDokument_statusnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iDokument_statusnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iDokument_statusnrTmp As SqlInt32 = Value
|
||||
If iDokument_statusnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iDokument_statusnr", "iDokument_statusnr can't be NULL")
|
||||
End If
|
||||
m_iDokument_statusnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDokumenitid]() As SqlString
|
||||
Get
|
||||
Return m_sDokumenitid
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDokumenitid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iStatus_bezeichnungnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatus_bezeichnungnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iStatus_bezeichnungnr = 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 [sReihenfolge]() As SqlString
|
||||
Get
|
||||
Return m_sReihenfolge
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sReihenfolge = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bFolgestatus_durch_anderen_verantwortlichen]() As SqlBoolean
|
||||
Get
|
||||
Return m_bFolgestatus_durch_anderen_verantwortlichen
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bFolgestatus_durch_anderen_verantwortlichen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bDokument_bearbeitung_moeglich]() As SqlBoolean
|
||||
Get
|
||||
Return m_bDokument_bearbeitung_moeglich
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bDokument_bearbeitung_moeglich = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iErledigung_ab]() As SqlInt32
|
||||
Get
|
||||
Return m_iErledigung_ab
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iErledigung_ab = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bDokument_ausgangsarchivierung]() As SqlBoolean
|
||||
Get
|
||||
Return m_bDokument_ausgangsarchivierung
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bDokument_ausgangsarchivierung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bDokument_bearbeitung_abgeschlossen]() As SqlBoolean
|
||||
Get
|
||||
Return m_bDokument_bearbeitung_abgeschlossen
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bDokument_bearbeitung_abgeschlossen = 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 [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
|
||||
751
edkb08/Datenbank/clsDokumentcoldindexwert.vb
Normal file
751
edkb08/Datenbank/clsDokumentcoldindexwert.vb
Normal file
@@ -0,0 +1,751 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'dokumentcoldindexwert'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Mittwoch, 6. April 2005, 10:10:46
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'dokumentcoldindexwert'.
|
||||
' /// </summary>
|
||||
Public Class clsDokumentcoldindexwert
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iIndextyp, m_iColdindexwertnr, m_iMutierer, m_iMandantnr As SqlInt32
|
||||
Private m_sNRSTA00, m_sNRDOC00, m_sBEGSF00, m_sBERES03, m_sBEUSR00, m_sBKPAR00, m_sNAVVG00, m_sDokumentid, m_sNRPAR00, m_sBEBEZ00, m_sBESTA00, m_sBEORT00, m_sDMSTA01, m_sBEDAT00 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>iIndextyp. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sDokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>sNRPAR00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBKPAR00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNAVVG00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEBEZ00. May be SqlString.Null</LI>
|
||||
' /// <LI>sDMSTA01. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEDAT00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBESTA00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEORT00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNRDOC00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNRSTA00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEGSF00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEUSR00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBERES03. 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>iColdindexwertnr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Public Overrides Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentcoldindexwert_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iindextyp", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iIndextyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNRPAR00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNRPAR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBKPAR00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBKPAR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNAVVG00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNAVVG00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEBEZ00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEBEZ00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDMSTA01", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDMSTA01))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEDAT00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEDAT00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBESTA00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBESTA00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEORT00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEORT00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNRDOC00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNRDOC00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNRSTA00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNRSTA00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEGSF00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEGSF00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEUSR00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEUSR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBERES03", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBERES03))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@icoldindexwertnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iColdindexwertnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iColdindexwertnr = scmCmdToExecute.Parameters.Item("@icoldindexwertnr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokumentcoldindexwert_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("clsDokumentcoldindexwert::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>iColdindexwertnr</LI>
|
||||
' /// <LI>iIndextyp. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sDokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>sNRPAR00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBKPAR00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNAVVG00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEBEZ00. May be SqlString.Null</LI>
|
||||
' /// <LI>sDMSTA01. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEDAT00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBESTA00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEORT00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNRDOC00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNRSTA00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEGSF00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBEUSR00. May be SqlString.Null</LI>
|
||||
' /// <LI>sBERES03. 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>
|
||||
Public Overrides Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentcoldindexwert_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@icoldindexwertnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iColdindexwertnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iindextyp", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iIndextyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNRPAR00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNRPAR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBKPAR00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBKPAR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNAVVG00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNAVVG00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEBEZ00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEBEZ00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDMSTA01", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDMSTA01))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEDAT00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEDAT00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBESTA00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBESTA00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEORT00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEORT00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNRDOC00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNRDOC00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNRSTA00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNRSTA00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEGSF00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEGSF00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEUSR00", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEUSR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBERES03", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBERES03))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokumentcoldindexwert_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("clsDokumentcoldindexwert::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>iColdindexwertnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Public Overrides Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentcoldindexwert_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@icoldindexwertnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iColdindexwertnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokumentcoldindexwert_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("clsDokumentcoldindexwert::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>iColdindexwertnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iColdindexwertnr</LI>
|
||||
' /// <LI>iIndextyp</LI>
|
||||
' /// <LI>iMandantnr</LI>
|
||||
' /// <LI>sDokumentid</LI>
|
||||
' /// <LI>sNRPAR00</LI>
|
||||
' /// <LI>sBKPAR00</LI>
|
||||
' /// <LI>sNAVVG00</LI>
|
||||
' /// <LI>sBEBEZ00</LI>
|
||||
' /// <LI>sDMSTA01</LI>
|
||||
' /// <LI>sBEDAT00</LI>
|
||||
' /// <LI>sBESTA00</LI>
|
||||
' /// <LI>sBEORT00</LI>
|
||||
' /// <LI>sNRDOC00</LI>
|
||||
' /// <LI>sNRSTA00</LI>
|
||||
' /// <LI>sBEGSF00</LI>
|
||||
' /// <LI>sBEUSR00</LI>
|
||||
' /// <LI>sBERES03</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>
|
||||
Public Overrides Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentcoldindexwert_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = New DataTable("dokumentcoldindexwert")
|
||||
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@icoldindexwertnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iColdindexwertnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokumentcoldindexwert_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iColdindexwertnr = New SqlInt32(CType(dtToReturn.Rows(0)("coldindexwertnr"), Integer))
|
||||
If dtToReturn.Rows(0)("indextyp") Is System.DBNull.Value Then
|
||||
m_iIndextyp = SqlInt32.Null
|
||||
Else
|
||||
m_iIndextyp = New SqlInt32(CType(dtToReturn.Rows(0)("indextyp"), 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)("dokumentid") Is System.DBNull.Value Then
|
||||
m_sDokumentid = SqlString.Null
|
||||
Else
|
||||
m_sDokumentid = New SqlString(CType(dtToReturn.Rows(0)("dokumentid"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NRPAR00") Is System.DBNull.Value Then
|
||||
m_sNRPAR00 = SqlString.Null
|
||||
Else
|
||||
m_sNRPAR00 = New SqlString(CType(dtToReturn.Rows(0)("NRPAR00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BKPAR00") Is System.DBNull.Value Then
|
||||
m_sBKPAR00 = SqlString.Null
|
||||
Else
|
||||
m_sBKPAR00 = New SqlString(CType(dtToReturn.Rows(0)("BKPAR00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NAVVG00") Is System.DBNull.Value Then
|
||||
m_sNAVVG00 = SqlString.Null
|
||||
Else
|
||||
m_sNAVVG00 = New SqlString(CType(dtToReturn.Rows(0)("NAVVG00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BEBEZ00") Is System.DBNull.Value Then
|
||||
m_sBEBEZ00 = SqlString.Null
|
||||
Else
|
||||
m_sBEBEZ00 = New SqlString(CType(dtToReturn.Rows(0)("BEBEZ00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("DMSTA01") Is System.DBNull.Value Then
|
||||
m_sDMSTA01 = SqlString.Null
|
||||
Else
|
||||
m_sDMSTA01 = New SqlString(CType(dtToReturn.Rows(0)("DMSTA01"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BEDAT00") Is System.DBNull.Value Then
|
||||
m_sBEDAT00 = SqlString.Null
|
||||
Else
|
||||
m_sBEDAT00 = New SqlString(CType(dtToReturn.Rows(0)("BEDAT00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BESTA00") Is System.DBNull.Value Then
|
||||
m_sBESTA00 = SqlString.Null
|
||||
Else
|
||||
m_sBESTA00 = New SqlString(CType(dtToReturn.Rows(0)("BESTA00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BEORT00") Is System.DBNull.Value Then
|
||||
m_sBEORT00 = SqlString.Null
|
||||
Else
|
||||
m_sBEORT00 = New SqlString(CType(dtToReturn.Rows(0)("BEORT00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NRDOC00") Is System.DBNull.Value Then
|
||||
m_sNRDOC00 = SqlString.Null
|
||||
Else
|
||||
m_sNRDOC00 = New SqlString(CType(dtToReturn.Rows(0)("NRDOC00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NRSTA00") Is System.DBNull.Value Then
|
||||
m_sNRSTA00 = SqlString.Null
|
||||
Else
|
||||
m_sNRSTA00 = New SqlString(CType(dtToReturn.Rows(0)("NRSTA00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BEGSF00") Is System.DBNull.Value Then
|
||||
m_sBEGSF00 = SqlString.Null
|
||||
Else
|
||||
m_sBEGSF00 = New SqlString(CType(dtToReturn.Rows(0)("BEGSF00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BEUSR00") Is System.DBNull.Value Then
|
||||
m_sBEUSR00 = SqlString.Null
|
||||
Else
|
||||
m_sBEUSR00 = New SqlString(CType(dtToReturn.Rows(0)("BEUSR00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BERES03") Is System.DBNull.Value Then
|
||||
m_sBERES03 = SqlString.Null
|
||||
Else
|
||||
m_sBERES03 = New SqlString(CType(dtToReturn.Rows(0)("BERES03"), 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("clsDokumentcoldindexwert::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
' /// </summary>
|
||||
' /// <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
' /// <remarks>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Public Overrides Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentcoldindexwert_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = New DataTable("dokumentcoldindexwert")
|
||||
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_dokumentcoldindexwert_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("clsDokumentcoldindexwert::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 [iColdindexwertnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iColdindexwertnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iColdindexwertnrTmp As SqlInt32 = Value
|
||||
If iColdindexwertnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iColdindexwertnr", "iColdindexwertnr can't be NULL")
|
||||
End If
|
||||
m_iColdindexwertnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iIndextyp]() As SqlInt32
|
||||
Get
|
||||
Return m_iIndextyp
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iIndextyp = 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 [sDokumentid]() As SqlString
|
||||
Get
|
||||
Return m_sDokumentid
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDokumentid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNRPAR00]() As SqlString
|
||||
Get
|
||||
Return m_sNRPAR00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNRPAR00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBKPAR00]() As SqlString
|
||||
Get
|
||||
Return m_sBKPAR00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBKPAR00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNAVVG00]() As SqlString
|
||||
Get
|
||||
Return m_sNAVVG00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNAVVG00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBEBEZ00]() As SqlString
|
||||
Get
|
||||
Return m_sBEBEZ00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBEBEZ00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDMSTA01]() As SqlString
|
||||
Get
|
||||
Return m_sDMSTA01
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDMSTA01 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBEDAT00]() As SqlString
|
||||
Get
|
||||
Return m_sBEDAT00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBEDAT00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBESTA00]() As SqlString
|
||||
Get
|
||||
Return m_sBESTA00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBESTA00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBEORT00]() As SqlString
|
||||
Get
|
||||
Return m_sBEORT00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBEORT00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNRDOC00]() As SqlString
|
||||
Get
|
||||
Return m_sNRDOC00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNRDOC00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNRSTA00]() As SqlString
|
||||
Get
|
||||
Return m_sNRSTA00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNRSTA00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBEGSF00]() As SqlString
|
||||
Get
|
||||
Return m_sBEGSF00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBEGSF00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBEUSR00]() As SqlString
|
||||
Get
|
||||
Return m_sBEUSR00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBEUSR00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBERES03]() As SqlString
|
||||
Get
|
||||
Return m_sBERES03
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBERES03 = 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
|
||||
1390
edkb08/Datenbank/clsDokumenttyp.vb
Normal file
1390
edkb08/Datenbank/clsDokumenttyp.vb
Normal file
File diff suppressed because it is too large
Load Diff
891
edkb08/Datenbank/clsEdex_sb_serienbrief.vb
Normal file
891
edkb08/Datenbank/clsEdex_sb_serienbrief.vb
Normal file
@@ -0,0 +1,891 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'edex_sb_serienbrief'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Montag, 13. September 2010, 16:18:43
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'edex_sb_serienbrief'.
|
||||
''' </summary>
|
||||
Public Class clsEdex_sb_serienbrief
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daArchivdatum, m_daTermin, m_daDokumentdatum, m_daMutiert_am As SqlDateTime
|
||||
Private m_iDokumenttypnr, m_iWindowheight, m_iWindowwidth, m_iTreewidth, m_iBestaetigt, m_iAusgeloest, m_iBldossier, m_iGedruckt, m_iFehlerhaft, m_iInBearbeitung, m_iErstellt, m_iUnterschriftlinks, m_iUnterschriftrechts, m_iZustaendig, m_iVerantwortlich, m_iPostzustellung, m_iMutierer, m_iStatus, m_iSerienbriefnr, m_iTeam As SqlInt32
|
||||
Private m_sBezeichnung, m_sBemerkung As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>iVerantwortlich. May be SqlInt32.Null</LI>
|
||||
''' <LI>iPostzustellung. May be SqlInt32.Null</LI>
|
||||
''' <LI>daDokumentdatum. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iZustaendig. May be SqlInt32.Null</LI>
|
||||
''' <LI>iUnterschriftlinks. May be SqlInt32.Null</LI>
|
||||
''' <LI>iUnterschriftrechts. May be SqlInt32.Null</LI>
|
||||
''' <LI>iTeam. May be SqlInt32.Null</LI>
|
||||
''' <LI>daArchivdatum. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daTermin. May be SqlDateTime.Null</LI>
|
||||
''' <LI>sBemerkung. May be SqlString.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iStatus. May be SqlInt32.Null</LI>
|
||||
''' <LI>iDokumenttypnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iWindowwidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iWindowheight. May be SqlInt32.Null</LI>
|
||||
''' <LI>iTreewidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFehlerhaft. May be SqlInt32.Null</LI>
|
||||
''' <LI>iInBearbeitung. May be SqlInt32.Null</LI>
|
||||
''' <LI>iErstellt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iGedruckt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iBestaetigt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iAusgeloest. May be SqlInt32.Null</LI>
|
||||
''' <LI>iBldossier. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iSerienbriefnr</LI>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edex_sb_serienbrief_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iverantwortlich", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlich))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ipostzustellung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPostzustellung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dadokumentdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daDokumentdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@izustaendig", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iZustaendig))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iunterschriftlinks", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iUnterschriftlinks))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iunterschriftrechts", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iUnterschriftrechts))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iteam", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTeam))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daarchivdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daArchivdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@datermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbemerkung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBemerkung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@idokumenttypnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iDokumenttypnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iwindowwidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWindowwidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iwindowheight", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWindowheight))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@itreewidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTreewidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifehlerhaft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFehlerhaft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iinBearbeitung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iInBearbeitung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ierstellt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iErstellt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@igedruckt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iGedruckt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibestaetigt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBestaetigt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iausgeloest", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAusgeloest))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibldossier", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBldossier))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iserienbriefnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iSerienbriefnr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iserienbriefnr").Value, 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_edex_sb_serienbrief_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsEdex_sb_serienbrief::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSerienbriefnr</LI>
|
||||
''' <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
''' <LI>iVerantwortlich. May be SqlInt32.Null</LI>
|
||||
''' <LI>iPostzustellung. May be SqlInt32.Null</LI>
|
||||
''' <LI>daDokumentdatum. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iZustaendig. May be SqlInt32.Null</LI>
|
||||
''' <LI>iUnterschriftlinks. May be SqlInt32.Null</LI>
|
||||
''' <LI>iUnterschriftrechts. May be SqlInt32.Null</LI>
|
||||
''' <LI>iTeam. May be SqlInt32.Null</LI>
|
||||
''' <LI>daArchivdatum. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daTermin. May be SqlDateTime.Null</LI>
|
||||
''' <LI>sBemerkung. May be SqlString.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>iStatus. May be SqlInt32.Null</LI>
|
||||
''' <LI>iDokumenttypnr. May be SqlInt32.Null</LI>
|
||||
''' <LI>iWindowwidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iWindowheight. May be SqlInt32.Null</LI>
|
||||
''' <LI>iTreewidth. May be SqlInt32.Null</LI>
|
||||
''' <LI>iFehlerhaft. May be SqlInt32.Null</LI>
|
||||
''' <LI>iInBearbeitung. May be SqlInt32.Null</LI>
|
||||
''' <LI>iErstellt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iGedruckt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iBestaetigt. May be SqlInt32.Null</LI>
|
||||
''' <LI>iAusgeloest. May be SqlInt32.Null</LI>
|
||||
''' <LI>iBldossier. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edex_sb_serienbrief_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iserienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbezeichnung", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iverantwortlich", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlich))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ipostzustellung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iPostzustellung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dadokumentdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daDokumentdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@izustaendig", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iZustaendig))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iunterschriftlinks", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iUnterschriftlinks))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iunterschriftrechts", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iUnterschriftrechts))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iteam", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTeam))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daarchivdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daArchivdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@datermin", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daTermin))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sbemerkung", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBemerkung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@idokumenttypnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iDokumenttypnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iwindowwidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWindowwidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iwindowheight", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iWindowheight))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@itreewidth", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iTreewidth))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifehlerhaft", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFehlerhaft))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iinBearbeitung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iInBearbeitung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ierstellt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iErstellt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@igedruckt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iGedruckt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibestaetigt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBestaetigt))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iausgeloest", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAusgeloest))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ibldossier", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iBldossier))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edex_sb_serienbrief_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsEdex_sb_serienbrief::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSerienbriefnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edex_sb_serienbrief_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iserienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edex_sb_serienbrief_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsEdex_sb_serienbrief::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iSerienbriefnr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iSerienbriefnr</LI>
|
||||
''' <LI>sBezeichnung</LI>
|
||||
''' <LI>iVerantwortlich</LI>
|
||||
''' <LI>iPostzustellung</LI>
|
||||
''' <LI>daDokumentdatum</LI>
|
||||
''' <LI>iZustaendig</LI>
|
||||
''' <LI>iUnterschriftlinks</LI>
|
||||
''' <LI>iUnterschriftrechts</LI>
|
||||
''' <LI>iTeam</LI>
|
||||
''' <LI>daArchivdatum</LI>
|
||||
''' <LI>daTermin</LI>
|
||||
''' <LI>sBemerkung</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>iStatus</LI>
|
||||
''' <LI>iDokumenttypnr</LI>
|
||||
''' <LI>iWindowwidth</LI>
|
||||
''' <LI>iWindowheight</LI>
|
||||
''' <LI>iTreewidth</LI>
|
||||
''' <LI>iFehlerhaft</LI>
|
||||
''' <LI>iInBearbeitung</LI>
|
||||
''' <LI>iErstellt</LI>
|
||||
''' <LI>iGedruckt</LI>
|
||||
''' <LI>iBestaetigt</LI>
|
||||
''' <LI>iAusgeloest</LI>
|
||||
''' <LI>iBldossier</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edex_sb_serienbrief_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("edex_sb_serienbrief")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iserienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iSerienbriefnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edex_sb_serienbrief_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iSerienbriefnr = New SqlInt32(CType(dtToReturn.Rows(0)("serienbriefnr"), Integer))
|
||||
If dtToReturn.Rows(0)("bezeichnung") Is System.DBNull.Value Then
|
||||
m_sBezeichnung = SqlString.Null
|
||||
Else
|
||||
m_sBezeichnung = New SqlString(CType(dtToReturn.Rows(0)("bezeichnung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("verantwortlich") Is System.DBNull.Value Then
|
||||
m_iVerantwortlich = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortlich = New SqlInt32(CType(dtToReturn.Rows(0)("verantwortlich"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("postzustellung") Is System.DBNull.Value Then
|
||||
m_iPostzustellung = SqlInt32.Null
|
||||
Else
|
||||
m_iPostzustellung = New SqlInt32(CType(dtToReturn.Rows(0)("postzustellung"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dokumentdatum") Is System.DBNull.Value Then
|
||||
m_daDokumentdatum = SqlDateTime.Null
|
||||
Else
|
||||
m_daDokumentdatum = New SqlDateTime(CType(dtToReturn.Rows(0)("dokumentdatum"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("zustaendig") Is System.DBNull.Value Then
|
||||
m_iZustaendig = SqlInt32.Null
|
||||
Else
|
||||
m_iZustaendig = New SqlInt32(CType(dtToReturn.Rows(0)("zustaendig"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("unterschriftlinks") Is System.DBNull.Value Then
|
||||
m_iUnterschriftlinks = SqlInt32.Null
|
||||
Else
|
||||
m_iUnterschriftlinks = New SqlInt32(CType(dtToReturn.Rows(0)("unterschriftlinks"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("unterschriftrechts") Is System.DBNull.Value Then
|
||||
m_iUnterschriftrechts = SqlInt32.Null
|
||||
Else
|
||||
m_iUnterschriftrechts = New SqlInt32(CType(dtToReturn.Rows(0)("unterschriftrechts"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("team") Is System.DBNull.Value Then
|
||||
m_iTeam = SqlInt32.Null
|
||||
Else
|
||||
m_iTeam = New SqlInt32(CType(dtToReturn.Rows(0)("team"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("archivdatum") Is System.DBNull.Value Then
|
||||
m_daArchivdatum = SqlDateTime.Null
|
||||
Else
|
||||
m_daArchivdatum = New SqlDateTime(CType(dtToReturn.Rows(0)("archivdatum"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("termin") Is System.DBNull.Value Then
|
||||
m_daTermin = SqlDateTime.Null
|
||||
Else
|
||||
m_daTermin = New SqlDateTime(CType(dtToReturn.Rows(0)("termin"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("bemerkung") Is System.DBNull.Value Then
|
||||
m_sBemerkung = SqlString.Null
|
||||
Else
|
||||
m_sBemerkung = New SqlString(CType(dtToReturn.Rows(0)("bemerkung"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("status") Is System.DBNull.Value Then
|
||||
m_iStatus = SqlInt32.Null
|
||||
Else
|
||||
m_iStatus = New SqlInt32(CType(dtToReturn.Rows(0)("status"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dokumenttypnr") Is System.DBNull.Value Then
|
||||
m_iDokumenttypnr = SqlInt32.Null
|
||||
Else
|
||||
m_iDokumenttypnr = New SqlInt32(CType(dtToReturn.Rows(0)("dokumenttypnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("windowwidth") Is System.DBNull.Value Then
|
||||
m_iWindowwidth = SqlInt32.Null
|
||||
Else
|
||||
m_iWindowwidth = New SqlInt32(CType(dtToReturn.Rows(0)("windowwidth"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("windowheight") Is System.DBNull.Value Then
|
||||
m_iWindowheight = SqlInt32.Null
|
||||
Else
|
||||
m_iWindowheight = New SqlInt32(CType(dtToReturn.Rows(0)("windowheight"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("treewidth") Is System.DBNull.Value Then
|
||||
m_iTreewidth = SqlInt32.Null
|
||||
Else
|
||||
m_iTreewidth = New SqlInt32(CType(dtToReturn.Rows(0)("treewidth"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fehlerhaft") Is System.DBNull.Value Then
|
||||
m_iFehlerhaft = SqlInt32.Null
|
||||
Else
|
||||
m_iFehlerhaft = New SqlInt32(CType(dtToReturn.Rows(0)("fehlerhaft"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("inBearbeitung") Is System.DBNull.Value Then
|
||||
m_iInBearbeitung = SqlInt32.Null
|
||||
Else
|
||||
m_iInBearbeitung = New SqlInt32(CType(dtToReturn.Rows(0)("inBearbeitung"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt") Is System.DBNull.Value Then
|
||||
m_iErstellt = SqlInt32.Null
|
||||
Else
|
||||
m_iErstellt = New SqlInt32(CType(dtToReturn.Rows(0)("erstellt"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("gedruckt") Is System.DBNull.Value Then
|
||||
m_iGedruckt = SqlInt32.Null
|
||||
Else
|
||||
m_iGedruckt = New SqlInt32(CType(dtToReturn.Rows(0)("gedruckt"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("bestaetigt") Is System.DBNull.Value Then
|
||||
m_iBestaetigt = SqlInt32.Null
|
||||
Else
|
||||
m_iBestaetigt = New SqlInt32(CType(dtToReturn.Rows(0)("bestaetigt"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ausgeloest") Is System.DBNull.Value Then
|
||||
m_iAusgeloest = SqlInt32.Null
|
||||
Else
|
||||
m_iAusgeloest = New SqlInt32(CType(dtToReturn.Rows(0)("ausgeloest"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("bldossier") Is System.DBNull.Value Then
|
||||
m_iBldossier = SqlInt32.Null
|
||||
Else
|
||||
m_iBldossier = New SqlInt32(CType(dtToReturn.Rows(0)("bldossier"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsEdex_sb_serienbrief::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edex_sb_serienbrief_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("edex_sb_serienbrief")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edex_sb_serienbrief_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsEdex_sb_serienbrief::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iSerienbriefnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iSerienbriefnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iSerienbriefnrTmp As SqlInt32 = Value
|
||||
If iSerienbriefnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iSerienbriefnr", "iSerienbriefnr can't be NULL")
|
||||
End If
|
||||
m_iSerienbriefnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBezeichnung]() As SqlString
|
||||
Get
|
||||
Return m_sBezeichnung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBezeichnung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortlich]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortlich
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortlich = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPostzustellung]() As SqlInt32
|
||||
Get
|
||||
Return m_iPostzustellung
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iPostzustellung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daDokumentdatum]() As SqlDateTime
|
||||
Get
|
||||
Return m_daDokumentdatum
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daDokumentdatum = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iZustaendig]() As SqlInt32
|
||||
Get
|
||||
Return m_iZustaendig
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iZustaendig = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iUnterschriftlinks]() As SqlInt32
|
||||
Get
|
||||
Return m_iUnterschriftlinks
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iUnterschriftlinks = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iUnterschriftrechts]() As SqlInt32
|
||||
Get
|
||||
Return m_iUnterschriftrechts
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iUnterschriftrechts = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iTeam]() As SqlInt32
|
||||
Get
|
||||
Return m_iTeam
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iTeam = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daArchivdatum]() As SqlDateTime
|
||||
Get
|
||||
Return m_daArchivdatum
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daArchivdatum = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daTermin]() As SqlDateTime
|
||||
Get
|
||||
Return m_daTermin
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daTermin = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBemerkung]() As SqlString
|
||||
Get
|
||||
Return m_sBemerkung
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBemerkung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iStatus]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatus
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iStatus = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iDokumenttypnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iDokumenttypnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iDokumenttypnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iWindowwidth]() As SqlInt32
|
||||
Get
|
||||
Return m_iWindowwidth
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iWindowwidth = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iWindowheight]() As SqlInt32
|
||||
Get
|
||||
Return m_iWindowheight
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iWindowheight = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iTreewidth]() As SqlInt32
|
||||
Get
|
||||
Return m_iTreewidth
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iTreewidth = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFehlerhaft]() As SqlInt32
|
||||
Get
|
||||
Return m_iFehlerhaft
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFehlerhaft = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iInBearbeitung]() As SqlInt32
|
||||
Get
|
||||
Return m_iInBearbeitung
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iInBearbeitung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iErstellt]() As SqlInt32
|
||||
Get
|
||||
Return m_iErstellt
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iErstellt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iGedruckt]() As SqlInt32
|
||||
Get
|
||||
Return m_iGedruckt
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iGedruckt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBestaetigt]() As SqlInt32
|
||||
Get
|
||||
Return m_iBestaetigt
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iBestaetigt = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iAusgeloest]() As SqlInt32
|
||||
Get
|
||||
Return m_iAusgeloest
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAusgeloest = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iBldossier]() As SqlInt32
|
||||
Get
|
||||
Return m_iBldossier
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iBldossier = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
711
edkb08/Datenbank/clsFA_APPL.vb
Normal file
711
edkb08/Datenbank/clsFA_APPL.vb
Normal file
@@ -0,0 +1,711 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'FA_APPL'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Montag, 4. April 2005, 23:36:30
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'FA_APPL'.
|
||||
' /// </summary>
|
||||
Public Class clsFA_APPL
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bLog_In_DB, m_bLog_Per_Mail, m_bAktiv, m_bLog_Mit_DTO As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iVerarbeitungsart, m_iMail_Periodizitaet, m_iMandantnr, m_iMutierer, m_iApplNr, m_iEDOKA_Mitarbeiter As SqlInt32
|
||||
Private m_sReserve_2, m_sOutputFormat, m_sReserve_1, m_sInputverzeichnis, m_sMail_Empfaneger, m_sBezeichnung, m_sDTO_Parameter As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Class constructor.
|
||||
' /// </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Insert method. This method will insert one new row into the database.
|
||||
' /// </summary>
|
||||
' /// <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
' /// <remarks>
|
||||
' /// Properties needed for this method:
|
||||
' /// <UL>
|
||||
' /// <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
' /// <LI>iEDOKA_Mitarbeiter. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sDTO_Parameter. May be SqlString.Null</LI>
|
||||
' /// <LI>sReserve_1. May be SqlString.Null</LI>
|
||||
' /// <LI>sReserve_2. May be SqlString.Null</LI>
|
||||
' /// <LI>sInputverzeichnis. May be SqlString.Null</LI>
|
||||
' /// <LI>bLog_Per_Mail. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bLog_In_DB. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bLog_Mit_DTO. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sMail_Empfaneger. May be SqlString.Null</LI>
|
||||
' /// <LI>iMail_Periodizitaet. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iVerarbeitungsart. 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>
|
||||
' /// <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sOutputFormat. May be SqlString.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iApplNr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edokaimport_FA_APPL_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEDOKA_Mitarbeiter", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iEDOKA_Mitarbeiter))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDTO_Parameter", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDTO_Parameter))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sReserve_1", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sReserve_1))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sReserve_2", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sReserve_2))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sInputverzeichnis", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sInputverzeichnis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bLog_Per_Mail", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bLog_Per_Mail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bLog_In_DB", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bLog_In_DB))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bLog_Mit_DTO", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bLog_Mit_DTO))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMail_Empfaneger", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMail_Empfaneger))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMail_Periodizitaet", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMail_Periodizitaet))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerarbeitungsart", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerarbeitungsart))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 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("@sOutputFormat", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sOutputFormat))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iApplNr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iApplNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iApplNr = scmCmdToExecute.Parameters.Item("@iApplNr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_APPL_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("clsFA_APPL::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>iApplNr</LI>
|
||||
' /// <LI>sBezeichnung. May be SqlString.Null</LI>
|
||||
' /// <LI>iEDOKA_Mitarbeiter. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sDTO_Parameter. May be SqlString.Null</LI>
|
||||
' /// <LI>sReserve_1. May be SqlString.Null</LI>
|
||||
' /// <LI>sReserve_2. May be SqlString.Null</LI>
|
||||
' /// <LI>sInputverzeichnis. May be SqlString.Null</LI>
|
||||
' /// <LI>bLog_Per_Mail. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bLog_In_DB. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bLog_Mit_DTO. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sMail_Empfaneger. May be SqlString.Null</LI>
|
||||
' /// <LI>iMail_Periodizitaet. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iVerarbeitungsart. 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>
|
||||
' /// <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sOutputFormat. 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_edokaimport_FA_APPL_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iApplNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEDOKA_Mitarbeiter", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iEDOKA_Mitarbeiter))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sDTO_Parameter", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDTO_Parameter))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sReserve_1", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sReserve_1))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sReserve_2", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sReserve_2))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sInputverzeichnis", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sInputverzeichnis))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bLog_Per_Mail", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bLog_Per_Mail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bLog_In_DB", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bLog_In_DB))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bLog_Mit_DTO", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bLog_Mit_DTO))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sMail_Empfaneger", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sMail_Empfaneger))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMail_Periodizitaet", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMail_Periodizitaet))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iVerarbeitungsart", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerarbeitungsart))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 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("@sOutputFormat", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sOutputFormat))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_APPL_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("clsFA_APPL::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>iApplNr</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_edokaimport_FA_APPL_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iApplNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_APPL_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("clsFA_APPL::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>iApplNr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iApplNr</LI>
|
||||
' /// <LI>sBezeichnung</LI>
|
||||
' /// <LI>iEDOKA_Mitarbeiter</LI>
|
||||
' /// <LI>sDTO_Parameter</LI>
|
||||
' /// <LI>sReserve_1</LI>
|
||||
' /// <LI>sReserve_2</LI>
|
||||
' /// <LI>sInputverzeichnis</LI>
|
||||
' /// <LI>bLog_Per_Mail</LI>
|
||||
' /// <LI>bLog_In_DB</LI>
|
||||
' /// <LI>bLog_Mit_DTO</LI>
|
||||
' /// <LI>sMail_Empfaneger</LI>
|
||||
' /// <LI>iMail_Periodizitaet</LI>
|
||||
' /// <LI>iVerarbeitungsart</LI>
|
||||
' /// <LI>daErstellt_am</LI>
|
||||
' /// <LI>daMutiert_am</LI>
|
||||
' /// <LI>iMutierer</LI>
|
||||
' /// <LI>bAktiv</LI>
|
||||
' /// <LI>iMandantnr</LI>
|
||||
' /// <LI>sOutputFormat</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_edokaimport_FA_APPL_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("FA_APPL")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iApplNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iApplNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_APPL_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iApplNr = New SqlInt32(CType(dtToReturn.Rows(0)("ApplNr"), 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)("EDOKA_Mitarbeiter") Is System.DBNull.Value Then
|
||||
m_iEDOKA_Mitarbeiter = SqlInt32.Null
|
||||
Else
|
||||
m_iEDOKA_Mitarbeiter = New SqlInt32(CType(dtToReturn.Rows(0)("EDOKA_Mitarbeiter"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("DTO_Parameter") Is System.DBNull.Value Then
|
||||
m_sDTO_Parameter = SqlString.Null
|
||||
Else
|
||||
m_sDTO_Parameter = New SqlString(CType(dtToReturn.Rows(0)("DTO_Parameter"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Reserve_1") Is System.DBNull.Value Then
|
||||
m_sReserve_1 = SqlString.Null
|
||||
Else
|
||||
m_sReserve_1 = New SqlString(CType(dtToReturn.Rows(0)("Reserve_1"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Reserve_2") Is System.DBNull.Value Then
|
||||
m_sReserve_2 = SqlString.Null
|
||||
Else
|
||||
m_sReserve_2 = New SqlString(CType(dtToReturn.Rows(0)("Reserve_2"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Inputverzeichnis") Is System.DBNull.Value Then
|
||||
m_sInputverzeichnis = SqlString.Null
|
||||
Else
|
||||
m_sInputverzeichnis = New SqlString(CType(dtToReturn.Rows(0)("Inputverzeichnis"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Log_Per_Mail") Is System.DBNull.Value Then
|
||||
m_bLog_Per_Mail = SqlBoolean.Null
|
||||
Else
|
||||
m_bLog_Per_Mail = New SqlBoolean(CType(dtToReturn.Rows(0)("Log_Per_Mail"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Log_In_DB") Is System.DBNull.Value Then
|
||||
m_bLog_In_DB = SqlBoolean.Null
|
||||
Else
|
||||
m_bLog_In_DB = New SqlBoolean(CType(dtToReturn.Rows(0)("Log_In_DB"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Log_Mit_DTO") Is System.DBNull.Value Then
|
||||
m_bLog_Mit_DTO = SqlBoolean.Null
|
||||
Else
|
||||
m_bLog_Mit_DTO = New SqlBoolean(CType(dtToReturn.Rows(0)("Log_Mit_DTO"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mail_Empfaneger") Is System.DBNull.Value Then
|
||||
m_sMail_Empfaneger = SqlString.Null
|
||||
Else
|
||||
m_sMail_Empfaneger = New SqlString(CType(dtToReturn.Rows(0)("Mail_Empfaneger"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mail_Periodizitaet") Is System.DBNull.Value Then
|
||||
m_iMail_Periodizitaet = SqlInt32.Null
|
||||
Else
|
||||
m_iMail_Periodizitaet = New SqlInt32(CType(dtToReturn.Rows(0)("Mail_Periodizitaet"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Verarbeitungsart") Is System.DBNull.Value Then
|
||||
m_iVerarbeitungsart = SqlInt32.Null
|
||||
Else
|
||||
m_iVerarbeitungsart = New SqlInt32(CType(dtToReturn.Rows(0)("Verarbeitungsart"), 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
|
||||
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)("OutputFormat") Is System.DBNull.Value Then
|
||||
m_sOutputFormat = SqlString.Null
|
||||
Else
|
||||
m_sOutputFormat = New SqlString(CType(dtToReturn.Rows(0)("OutputFormat"), 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("clsFA_APPL::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_edokaimport_FA_APPL_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("FA_APPL")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_APPL_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("clsFA_APPL::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 [iApplNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iApplNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iApplNrTmp As SqlInt32 = Value
|
||||
If iApplNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iApplNr", "iApplNr can't be NULL")
|
||||
End If
|
||||
m_iApplNr = 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 [iEDOKA_Mitarbeiter]() As SqlInt32
|
||||
Get
|
||||
Return m_iEDOKA_Mitarbeiter
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iEDOKA_Mitarbeiter = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDTO_Parameter]() As SqlString
|
||||
Get
|
||||
Return m_sDTO_Parameter
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDTO_Parameter = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sReserve_1]() As SqlString
|
||||
Get
|
||||
Return m_sReserve_1
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sReserve_1 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sReserve_2]() As SqlString
|
||||
Get
|
||||
Return m_sReserve_2
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sReserve_2 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sInputverzeichnis]() As SqlString
|
||||
Get
|
||||
Return m_sInputverzeichnis
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sInputverzeichnis = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bLog_Per_Mail]() As SqlBoolean
|
||||
Get
|
||||
Return m_bLog_Per_Mail
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bLog_Per_Mail = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bLog_In_DB]() As SqlBoolean
|
||||
Get
|
||||
Return m_bLog_In_DB
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bLog_In_DB = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bLog_Mit_DTO]() As SqlBoolean
|
||||
Get
|
||||
Return m_bLog_Mit_DTO
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bLog_Mit_DTO = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sMail_Empfaneger]() As SqlString
|
||||
Get
|
||||
Return m_sMail_Empfaneger
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sMail_Empfaneger = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMail_Periodizitaet]() As SqlInt32
|
||||
Get
|
||||
Return m_iMail_Periodizitaet
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMail_Periodizitaet = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerarbeitungsart]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerarbeitungsart
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerarbeitungsart = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sOutputFormat]() As SqlString
|
||||
Get
|
||||
Return m_sOutputFormat
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sOutputFormat = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
491
edkb08/Datenbank/clsFA_BCImport.vb
Normal file
491
edkb08/Datenbank/clsFA_BCImport.vb
Normal file
@@ -0,0 +1,491 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'FA_BCImport'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Montag, 4. April 2005, 23:36:30
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'FA_BCImport'.
|
||||
' /// </summary>
|
||||
Public Class clsFA_BCImport
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iStatus, m_iFabcimportnr As SqlInt32
|
||||
Private m_sDateiformat, m_sDateiname, m_sDokumentid 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>sDokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>sDateiname. May be SqlString.Null</LI>
|
||||
' /// <LI>iStatus. May be SqlInt32.Null</LI>
|
||||
' /// <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sDateiformat. May be SqlString.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iFabcimportnr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edokaimport_FA_BCImport_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdateiname", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDateiname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdateiformat", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDateiformat))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ifabcimportnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iFabcimportnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iFabcimportnr = scmCmdToExecute.Parameters.Item("@ifabcimportnr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_BCImport_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("clsFA_BCImport::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>iFabcimportnr</LI>
|
||||
' /// <LI>sDokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>sDateiname. May be SqlString.Null</LI>
|
||||
' /// <LI>iStatus. May be SqlInt32.Null</LI>
|
||||
' /// <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sDateiformat. 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_edokaimport_FA_BCImport_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifabcimportnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFabcimportnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdateiname", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDateiname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdateiformat", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDateiformat))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_BCImport_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("clsFA_BCImport::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>iFabcimportnr</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_edokaimport_FA_BCImport_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifabcimportnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFabcimportnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_BCImport_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("clsFA_BCImport::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>iFabcimportnr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iFabcimportnr</LI>
|
||||
' /// <LI>sDokumentid</LI>
|
||||
' /// <LI>sDateiname</LI>
|
||||
' /// <LI>iStatus</LI>
|
||||
' /// <LI>daErstellt_am</LI>
|
||||
' /// <LI>daMutiert_am</LI>
|
||||
' /// <LI>bAktiv</LI>
|
||||
' /// <LI>sDateiformat</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_edokaimport_FA_BCImport_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("FA_BCImport")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ifabcimportnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFabcimportnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_BCImport_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iFabcimportnr = New SqlInt32(CType(dtToReturn.Rows(0)("fabcimportnr"), Integer))
|
||||
If dtToReturn.Rows(0)("dokumentid") Is System.DBNull.Value Then
|
||||
m_sDokumentid = SqlString.Null
|
||||
Else
|
||||
m_sDokumentid = New SqlString(CType(dtToReturn.Rows(0)("dokumentid"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dateiname") Is System.DBNull.Value Then
|
||||
m_sDateiname = SqlString.Null
|
||||
Else
|
||||
m_sDateiname = New SqlString(CType(dtToReturn.Rows(0)("dateiname"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("status") Is System.DBNull.Value Then
|
||||
m_iStatus = SqlInt32.Null
|
||||
Else
|
||||
m_iStatus = New SqlInt32(CType(dtToReturn.Rows(0)("status"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("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)("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)("dateiformat") Is System.DBNull.Value Then
|
||||
m_sDateiformat = SqlString.Null
|
||||
Else
|
||||
m_sDateiformat = New SqlString(CType(dtToReturn.Rows(0)("dateiformat"), 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("clsFA_BCImport::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_edokaimport_FA_BCImport_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("FA_BCImport")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_BCImport_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("clsFA_BCImport::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 [iFabcimportnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFabcimportnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFabcimportnrTmp As SqlInt32 = Value
|
||||
If iFabcimportnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFabcimportnr", "iFabcimportnr can't be NULL")
|
||||
End If
|
||||
m_iFabcimportnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDokumentid]() As SqlString
|
||||
Get
|
||||
Return m_sDokumentid
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDokumentid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDateiname]() As SqlString
|
||||
Get
|
||||
Return m_sDateiname
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDateiname = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iStatus]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatus
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iStatus = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [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 [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sDateiformat]() As SqlString
|
||||
Get
|
||||
Return m_sDateiformat
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDateiformat = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
490
edkb08/Datenbank/clsFA_Dokumenttyp.vb
Normal file
490
edkb08/Datenbank/clsFA_Dokumenttyp.vb
Normal file
@@ -0,0 +1,490 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'FA_Dokumenttyp'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Montag, 4. April 2005, 23:36:30
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'FA_Dokumenttyp'.
|
||||
' /// </summary>
|
||||
Public Class clsFA_Dokumenttyp
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iAktiv, m_iMutierer, m_iApplNr, m_iEintragnr, m_iEDOKA_Dokumenttyp As SqlInt32
|
||||
Private m_sFA_Dokumenttyp 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>iApplNr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sFA_Dokumenttyp. May be SqlString.Null</LI>
|
||||
' /// <LI>iEDOKA_Dokumenttyp. 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>
|
||||
' /// <LI>iAktiv. May be SqlInt32.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iEintragnr</LI>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_edokaimport_FA_Dokumenttyp_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iApplNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iApplNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFA_Dokumenttyp", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFA_Dokumenttyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEDOKA_Dokumenttyp", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iEDOKA_Dokumenttyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iaktiv", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAktiv))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iEintragnr = scmCmdToExecute.Parameters.Item("@iEintragnr").Value
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_Dokumenttyp_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("clsFA_Dokumenttyp::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>iApplNr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sFA_Dokumenttyp. May be SqlString.Null</LI>
|
||||
' /// <LI>iEDOKA_Dokumenttyp. 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>
|
||||
' /// <LI>iAktiv. 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_edokaimport_FA_Dokumenttyp_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("@iApplNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iApplNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFA_Dokumenttyp", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFA_Dokumenttyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEDOKA_Dokumenttyp", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iEDOKA_Dokumenttyp))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iaktiv", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iAktiv))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_Dokumenttyp_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("clsFA_Dokumenttyp::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_edokaimport_FA_Dokumenttyp_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iEintragnr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iEintragnr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_Dokumenttyp_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("clsFA_Dokumenttyp::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>iApplNr</LI>
|
||||
' /// <LI>sFA_Dokumenttyp</LI>
|
||||
' /// <LI>iEDOKA_Dokumenttyp</LI>
|
||||
' /// <LI>daErstellt_am</LI>
|
||||
' /// <LI>daMutiert_am</LI>
|
||||
' /// <LI>iMutierer</LI>
|
||||
' /// <LI>iAktiv</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_edokaimport_FA_Dokumenttyp_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("FA_Dokumenttyp")
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_Dokumenttyp_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)("ApplNr") Is System.DBNull.Value Then
|
||||
m_iApplNr = SqlInt32.Null
|
||||
Else
|
||||
m_iApplNr = New SqlInt32(CType(dtToReturn.Rows(0)("ApplNr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("FA_Dokumenttyp") Is System.DBNull.Value Then
|
||||
m_sFA_Dokumenttyp = SqlString.Null
|
||||
Else
|
||||
m_sFA_Dokumenttyp = New SqlString(CType(dtToReturn.Rows(0)("FA_Dokumenttyp"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("EDOKA_Dokumenttyp") Is System.DBNull.Value Then
|
||||
m_iEDOKA_Dokumenttyp = SqlInt32.Null
|
||||
Else
|
||||
m_iEDOKA_Dokumenttyp = New SqlInt32(CType(dtToReturn.Rows(0)("EDOKA_Dokumenttyp"), 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
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_iAktiv = SqlInt32.Null
|
||||
Else
|
||||
m_iAktiv = New SqlInt32(CType(dtToReturn.Rows(0)("aktiv"), 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("clsFA_Dokumenttyp::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_edokaimport_FA_Dokumenttyp_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("FA_Dokumenttyp")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_edokaimport_FA_Dokumenttyp_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("clsFA_Dokumenttyp::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 [iApplNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iApplNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iApplNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFA_Dokumenttyp]() As SqlString
|
||||
Get
|
||||
Return m_sFA_Dokumenttyp
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFA_Dokumenttyp = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iEDOKA_Dokumenttyp]() As SqlInt32
|
||||
Get
|
||||
Return m_iEDOKA_Dokumenttyp
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iEDOKA_Dokumenttyp = 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 [iAktiv]() As SqlInt32
|
||||
Get
|
||||
Return m_iAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
490
edkb08/Datenbank/clsKey_tabelle.vb
Normal file
490
edkb08/Datenbank/clsKey_tabelle.vb
Normal file
@@ -0,0 +1,490 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'key_tabelle'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Samstag, 7. Dezember 2002, 22:50:12
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table '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>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 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("@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, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_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, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_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.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
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
|
||||
261
edkb08/Datenbank/clsMehrfachscann.vb
Normal file
261
edkb08/Datenbank/clsMehrfachscann.vb
Normal file
@@ -0,0 +1,261 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'mehrfachscann'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Mittwoch, 19. Juli 2006, 15:16:33
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'mehrfachscann'.
|
||||
' /// </summary>
|
||||
Public Class clsMehrfachscann
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daStatusdatum, m_daMutiert_am, m_daErstellt_am, m_daMutationsdatum As SqlDateTime
|
||||
Private m_iMutierer, m_iNreintrag, m_iStatus, m_iMandantnr As SqlInt32
|
||||
Private m_sDokumentid, m_sStapelnr, m_sColddokumentid 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>iNreintrag</LI>
|
||||
' /// <LI>daMutationsdatum</LI>
|
||||
' /// <LI>sColddokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>sStapelnr</LI>
|
||||
' /// <LI>iStatus</LI>
|
||||
' /// <LI>daStatusdatum</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>sDokumentid. 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.[pv_mehrfachscann_Insert]"
|
||||
scmCmdToExecute.CommandText = "dbo.[pv_mehrfachscann_Insert_EDKB02]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@inreintrag", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNreintrag))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutationsdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, False, 23, 3, "", DataRowVersion.Proposed, m_daMutationsdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@scolddokumentid", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sColddokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sstapelnr", SqlDbType.VarChar, 20, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Proposed, m_sStapelnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@dastatusdatum", SqlDbType.DateTime, 8, ParameterDirection.Input, False, 23, 3, "", DataRowVersion.Proposed, m_daStatusdatum))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pv_mehrfachscann_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("clsMehrfachscann::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iNreintrag]() As SqlInt32
|
||||
Get
|
||||
Return m_iNreintrag
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iNreintragTmp As SqlInt32 = Value
|
||||
If iNreintragTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iNreintrag", "iNreintrag can't be NULL")
|
||||
End If
|
||||
m_iNreintrag = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutationsdatum]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutationsdatum
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
Dim daMutationsdatumTmp As SqlDateTime = Value
|
||||
If daMutationsdatumTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("daMutationsdatum", "daMutationsdatum can't be NULL")
|
||||
End If
|
||||
m_daMutationsdatum = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sColddokumentid]() As SqlString
|
||||
Get
|
||||
Return m_sColddokumentid
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sColddokumentid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sStapelnr]() As SqlString
|
||||
Get
|
||||
Return m_sStapelnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
Dim sStapelnrTmp As SqlString = Value
|
||||
If sStapelnrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("sStapelnr", "sStapelnr can't be NULL")
|
||||
End If
|
||||
m_sStapelnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iStatus]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatus
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iStatusTmp As SqlInt32 = Value
|
||||
If iStatusTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iStatus", "iStatus can't be NULL")
|
||||
End If
|
||||
m_iStatus = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daStatusdatum]() As SqlDateTime
|
||||
Get
|
||||
Return m_daStatusdatum
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
Dim daStatusdatumTmp As SqlDateTime = Value
|
||||
If daStatusdatumTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("daStatusdatum", "daStatusdatum can't be NULL")
|
||||
End If
|
||||
m_daStatusdatum = 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 [sDokumentid]() As SqlString
|
||||
Get
|
||||
Return m_sDokumentid
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDokumentid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
910
edkb08/Datenbank/clsMitarbeiter.vb
Normal file
910
edkb08/Datenbank/clsMitarbeiter.vb
Normal file
@@ -0,0 +1,910 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'mitarbeiter'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 10. August 2003, 23:09:05
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'mitarbeiter'.
|
||||
' /// </summary>
|
||||
Public Class clsMitarbeiter
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bMailempfang, m_bEdokaMesasge, m_bShowtip, m_bAktiv, m_bMailDirektVersenden, m_bEdoka_mail, m_bJournalisierung, m_bMailDokumentrueckgang As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iPartnernr, m_iKlassifizierung, m_iMutierer, m_iMandantnr, m_iFunktionnr, m_iMitarbeiternr, m_iFuermandant, m_iSprache As SqlInt32
|
||||
Private m_sRang, m_sAnrede, m_sKurzzeichen, m_sVorname, m_sName, m_sFax, m_sTelefon, m_sUnterschrift_text, m_sFunktion, m_sTgnummer, m_sEmail As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Class constructor.
|
||||
' /// </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Insert method. This method will insert one new row into the database.
|
||||
' /// </summary>
|
||||
' /// <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
' /// <remarks>
|
||||
' /// Properties needed for this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iMitarbeiternr</LI>
|
||||
' /// <LI>sVorname. May be SqlString.Null</LI>
|
||||
' /// <LI>sName. May be SqlString.Null</LI>
|
||||
' /// <LI>sKurzzeichen. May be SqlString.Null</LI>
|
||||
' /// <LI>sAnrede. May be SqlString.Null</LI>
|
||||
' /// <LI>sTgnummer. May be SqlString.Null</LI>
|
||||
' /// <LI>sEmail. May be SqlString.Null</LI>
|
||||
' /// <LI>sFax. May be SqlString.Null</LI>
|
||||
' /// <LI>sTelefon. May be SqlString.Null</LI>
|
||||
' /// <LI>sUnterschrift_text. May be SqlString.Null</LI>
|
||||
' /// <LI>iFunktionnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iSprache. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iFuermandant</LI>
|
||||
' /// <LI>bShowtip</LI>
|
||||
' /// <LI>iPartnernr</LI>
|
||||
' /// <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bMailempfang. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bEdokaMesasge. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sFunktion. May be SqlString.Null</LI>
|
||||
' /// <LI>bMailDirektVersenden. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sRang. May be SqlString.Null</LI>
|
||||
' /// <LI>bMailDokumentrueckgang. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>iKlassifizierung. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bEdoka_mail. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bJournalisierung. May be SqlBoolean.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@svorname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@skurzzeichen", SqlDbType.VarChar, 10, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzzeichen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sanrede", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sAnrede))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stgnummer", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@semail", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEmail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sfax", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFax))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stelefon", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTelefon))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sunterschrift_text", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sUnterschrift_text))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifuermandant", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFuermandant))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bshowtip", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bShowtip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ipartnernr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailempfang", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailempfang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bEdokaMesasge", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bEdokaMesasge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sfunktion", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFunktion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailDirektVersenden", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailDirektVersenden))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sRang", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sRang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailDokumentrueckgang", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailDokumentrueckgang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iklassifizierung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKlassifizierung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bedoka_mail", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bEdoka_mail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bjournalisierung", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bJournalisierung))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Update method. This method will Update one existing row in the database.
|
||||
' /// </summary>
|
||||
' /// <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
' /// <remarks>
|
||||
' /// Properties needed for this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iMitarbeiternr</LI>
|
||||
' /// <LI>sVorname. May be SqlString.Null</LI>
|
||||
' /// <LI>sName. May be SqlString.Null</LI>
|
||||
' /// <LI>sKurzzeichen. May be SqlString.Null</LI>
|
||||
' /// <LI>sAnrede. May be SqlString.Null</LI>
|
||||
' /// <LI>sTgnummer. May be SqlString.Null</LI>
|
||||
' /// <LI>sEmail. May be SqlString.Null</LI>
|
||||
' /// <LI>sFax. May be SqlString.Null</LI>
|
||||
' /// <LI>sTelefon. May be SqlString.Null</LI>
|
||||
' /// <LI>sUnterschrift_text. May be SqlString.Null</LI>
|
||||
' /// <LI>iFunktionnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iSprache. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iFuermandant</LI>
|
||||
' /// <LI>bShowtip</LI>
|
||||
' /// <LI>iPartnernr</LI>
|
||||
' /// <LI>iMandantnr. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
' /// <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bMailempfang. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bEdokaMesasge. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sFunktion. May be SqlString.Null</LI>
|
||||
' /// <LI>bMailDirektVersenden. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>sRang. May be SqlString.Null</LI>
|
||||
' /// <LI>bMailDokumentrueckgang. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>iKlassifizierung. May be SqlInt32.Null</LI>
|
||||
' /// <LI>bEdoka_mail. May be SqlBoolean.Null</LI>
|
||||
' /// <LI>bJournalisierung. May be SqlBoolean.Null</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@svorname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sVorname))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sname", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@skurzzeichen", SqlDbType.VarChar, 10, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sKurzzeichen))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sanrede", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sAnrede))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stgnummer", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@semail", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sEmail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sfax", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFax))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@stelefon", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTelefon))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sunterschrift_text", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sUnterschrift_text))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifunktionnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iFunktionnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSprache))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ifuermandant", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iFuermandant))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bshowtip", SqlDbType.Bit, 1, ParameterDirection.Input, False, 1, 0, "", DataRowVersion.Proposed, m_bShowtip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@ipartnernr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailempfang", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailempfang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bEdokaMesasge", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bEdokaMesasge))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sfunktion", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFunktion))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailDirektVersenden", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailDirektVersenden))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sRang", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sRang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bMailDokumentrueckgang", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bMailDokumentrueckgang))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iklassifizierung", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iKlassifizierung))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bedoka_mail", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bEdoka_mail))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bjournalisierung", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bJournalisierung))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
' /// </summary>
|
||||
' /// <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
' /// <remarks>
|
||||
' /// Properties needed for this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iMitarbeiternr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
' /// </summary>
|
||||
' /// <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
' /// <remarks>
|
||||
' /// Properties needed for this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iMitarbeiternr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iMitarbeiternr</LI>
|
||||
' /// <LI>sVorname</LI>
|
||||
' /// <LI>sName</LI>
|
||||
' /// <LI>sKurzzeichen</LI>
|
||||
' /// <LI>sAnrede</LI>
|
||||
' /// <LI>sTgnummer</LI>
|
||||
' /// <LI>sEmail</LI>
|
||||
' /// <LI>sFax</LI>
|
||||
' /// <LI>sTelefon</LI>
|
||||
' /// <LI>sUnterschrift_text</LI>
|
||||
' /// <LI>iFunktionnr</LI>
|
||||
' /// <LI>iSprache</LI>
|
||||
' /// <LI>iFuermandant</LI>
|
||||
' /// <LI>bShowtip</LI>
|
||||
' /// <LI>iPartnernr</LI>
|
||||
' /// <LI>iMandantnr</LI>
|
||||
' /// <LI>bAktiv</LI>
|
||||
' /// <LI>daErstellt_am</LI>
|
||||
' /// <LI>daMutiert_am</LI>
|
||||
' /// <LI>iMutierer</LI>
|
||||
' /// <LI>bMailempfang</LI>
|
||||
' /// <LI>bEdokaMesasge</LI>
|
||||
' /// <LI>sFunktion</LI>
|
||||
' /// <LI>bMailDirektVersenden</LI>
|
||||
' /// <LI>sRang</LI>
|
||||
' /// <LI>bMailDokumentrueckgang</LI>
|
||||
' /// <LI>iKlassifizierung</LI>
|
||||
' /// <LI>bEdoka_mail</LI>
|
||||
' /// <LI>bJournalisierung</LI>
|
||||
' /// </UL>
|
||||
' /// Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
' /// </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iMitarbeiternr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiternr"), Integer))
|
||||
If dtToReturn.Rows(0)("vorname") Is System.DBNull.Value Then
|
||||
m_sVorname = SqlString.Null
|
||||
Else
|
||||
m_sVorname = New SqlString(CType(dtToReturn.Rows(0)("vorname"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("name") Is System.DBNull.Value Then
|
||||
m_sName = SqlString.Null
|
||||
Else
|
||||
m_sName = New SqlString(CType(dtToReturn.Rows(0)("name"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("kurzzeichen") Is System.DBNull.Value Then
|
||||
m_sKurzzeichen = SqlString.Null
|
||||
Else
|
||||
m_sKurzzeichen = New SqlString(CType(dtToReturn.Rows(0)("kurzzeichen"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("anrede") Is System.DBNull.Value Then
|
||||
m_sAnrede = SqlString.Null
|
||||
Else
|
||||
m_sAnrede = New SqlString(CType(dtToReturn.Rows(0)("anrede"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("tgnummer") Is System.DBNull.Value Then
|
||||
m_sTgnummer = SqlString.Null
|
||||
Else
|
||||
m_sTgnummer = New SqlString(CType(dtToReturn.Rows(0)("tgnummer"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("email") Is System.DBNull.Value Then
|
||||
m_sEmail = SqlString.Null
|
||||
Else
|
||||
m_sEmail = New SqlString(CType(dtToReturn.Rows(0)("email"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("fax") Is System.DBNull.Value Then
|
||||
m_sFax = SqlString.Null
|
||||
Else
|
||||
m_sFax = New SqlString(CType(dtToReturn.Rows(0)("fax"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("telefon") Is System.DBNull.Value Then
|
||||
m_sTelefon = SqlString.Null
|
||||
Else
|
||||
m_sTelefon = New SqlString(CType(dtToReturn.Rows(0)("telefon"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("unterschrift_text") Is System.DBNull.Value Then
|
||||
m_sUnterschrift_text = SqlString.Null
|
||||
Else
|
||||
m_sUnterschrift_text = New SqlString(CType(dtToReturn.Rows(0)("unterschrift_text"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("funktionnr") Is System.DBNull.Value Then
|
||||
m_iFunktionnr = SqlInt32.Null
|
||||
Else
|
||||
m_iFunktionnr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("sprache") Is System.DBNull.Value Then
|
||||
m_iSprache = SqlInt32.Null
|
||||
Else
|
||||
m_iSprache = New SqlInt32(CType(dtToReturn.Rows(0)("sprache"), Integer))
|
||||
End If
|
||||
m_iFuermandant = New SqlInt32(CType(dtToReturn.Rows(0)("fuermandant"), Integer))
|
||||
m_bShowtip = New SqlBoolean(CType(dtToReturn.Rows(0)("showtip"), Boolean))
|
||||
m_iPartnernr = New SqlInt32(CType(dtToReturn.Rows(0)("partnernr"), Integer))
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mailempfang") Is System.DBNull.Value Then
|
||||
m_bMailempfang = SqlBoolean.Null
|
||||
Else
|
||||
m_bMailempfang = New SqlBoolean(CType(dtToReturn.Rows(0)("Mailempfang"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("EdokaMesasge") Is System.DBNull.Value Then
|
||||
m_bEdokaMesasge = SqlBoolean.Null
|
||||
Else
|
||||
m_bEdokaMesasge = New SqlBoolean(CType(dtToReturn.Rows(0)("EdokaMesasge"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("funktion") Is System.DBNull.Value Then
|
||||
m_sFunktion = SqlString.Null
|
||||
Else
|
||||
m_sFunktion = New SqlString(CType(dtToReturn.Rows(0)("funktion"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("MailDirektVersenden") Is System.DBNull.Value Then
|
||||
m_bMailDirektVersenden = SqlBoolean.Null
|
||||
Else
|
||||
m_bMailDirektVersenden = New SqlBoolean(CType(dtToReturn.Rows(0)("MailDirektVersenden"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Rang") Is System.DBNull.Value Then
|
||||
m_sRang = SqlString.Null
|
||||
Else
|
||||
m_sRang = New SqlString(CType(dtToReturn.Rows(0)("Rang"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("MailDokumentrueckgang") Is System.DBNull.Value Then
|
||||
m_bMailDokumentrueckgang = SqlBoolean.Null
|
||||
Else
|
||||
m_bMailDokumentrueckgang = New SqlBoolean(CType(dtToReturn.Rows(0)("MailDokumentrueckgang"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("klassifizierung") Is System.DBNull.Value Then
|
||||
m_iKlassifizierung = SqlInt32.Null
|
||||
Else
|
||||
m_iKlassifizierung = New SqlInt32(CType(dtToReturn.Rows(0)("klassifizierung"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("edoka_mail") Is System.DBNull.Value Then
|
||||
m_bEdoka_mail = SqlBoolean.Null
|
||||
Else
|
||||
m_bEdoka_mail = New SqlBoolean(CType(dtToReturn.Rows(0)("edoka_mail"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("journalisierung") Is System.DBNull.Value Then
|
||||
m_bJournalisierung = SqlBoolean.Null
|
||||
Else
|
||||
m_bJournalisierung = New SqlBoolean(CType(dtToReturn.Rows(0)("journalisierung"), Boolean))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
' /// <summary>
|
||||
' /// Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
' /// </summary>
|
||||
' /// <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
' /// <remarks>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// </UL>
|
||||
' /// </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("mitarbeiter")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsMitarbeiter::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iMitarbeiternr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMitarbeiternr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iMitarbeiternrTmp As SqlInt32 = Value
|
||||
If iMitarbeiternrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iMitarbeiternr", "iMitarbeiternr can't be NULL")
|
||||
End If
|
||||
m_iMitarbeiternr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sVorname]() As SqlString
|
||||
Get
|
||||
Return m_sVorname
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sVorname = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sName]() As SqlString
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sKurzzeichen]() As SqlString
|
||||
Get
|
||||
Return m_sKurzzeichen
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sKurzzeichen = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sAnrede]() As SqlString
|
||||
Get
|
||||
Return m_sAnrede
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sAnrede = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTgnummer]() As SqlString
|
||||
Get
|
||||
Return m_sTgnummer
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTgnummer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sEmail]() As SqlString
|
||||
Get
|
||||
Return m_sEmail
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sEmail = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFax]() As SqlString
|
||||
Get
|
||||
Return m_sFax
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFax = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTelefon]() As SqlString
|
||||
Get
|
||||
Return m_sTelefon
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTelefon = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sUnterschrift_text]() As SqlString
|
||||
Get
|
||||
Return m_sUnterschrift_text
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sUnterschrift_text = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFunktionnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iFunktionnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iFunktionnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iSprache]() As SqlInt32
|
||||
Get
|
||||
Return m_iSprache
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iSprache = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iFuermandant]() As SqlInt32
|
||||
Get
|
||||
Return m_iFuermandant
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iFuermandantTmp As SqlInt32 = Value
|
||||
If iFuermandantTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iFuermandant", "iFuermandant can't be NULL")
|
||||
End If
|
||||
m_iFuermandant = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bShowtip]() As SqlBoolean
|
||||
Get
|
||||
Return m_bShowtip
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
Dim bShowtipTmp As SqlBoolean = Value
|
||||
If bShowtipTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("bShowtip", "bShowtip can't be NULL")
|
||||
End If
|
||||
m_bShowtip = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iPartnernr]() As SqlInt32
|
||||
Get
|
||||
Return m_iPartnernr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iPartnernrTmp As SqlInt32 = Value
|
||||
If iPartnernrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iPartnernr", "iPartnernr can't be NULL")
|
||||
End If
|
||||
m_iPartnernr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMandantnr]() As SqlInt32
|
||||
Get
|
||||
Return m_iMandantnr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMandantnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bMailempfang]() As SqlBoolean
|
||||
Get
|
||||
Return m_bMailempfang
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bMailempfang = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bEdokaMesasge]() As SqlBoolean
|
||||
Get
|
||||
Return m_bEdokaMesasge
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bEdokaMesasge = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFunktion]() As SqlString
|
||||
Get
|
||||
Return m_sFunktion
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFunktion = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bMailDirektVersenden]() As SqlBoolean
|
||||
Get
|
||||
Return m_bMailDirektVersenden
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bMailDirektVersenden = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sRang]() As SqlString
|
||||
Get
|
||||
Return m_sRang
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sRang = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bMailDokumentrueckgang]() As SqlBoolean
|
||||
Get
|
||||
Return m_bMailDokumentrueckgang
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bMailDokumentrueckgang = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iKlassifizierung]() As SqlInt32
|
||||
Get
|
||||
Return m_iKlassifizierung
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iKlassifizierung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bEdoka_mail]() As SqlBoolean
|
||||
Get
|
||||
Return m_bEdoka_mail
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bEdoka_mail = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bJournalisierung]() As SqlBoolean
|
||||
Get
|
||||
Return m_bJournalisierung
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bJournalisierung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
61
edkb08/Datenbank/clsMyKey_Tabelle.vb
Normal file
61
edkb08/Datenbank/clsMyKey_Tabelle.vb
Normal file
@@ -0,0 +1,61 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
Namespace edokadb
|
||||
Public Class clsMyKey_Tabelle
|
||||
Inherits edokadb.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 = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
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
|
||||
73
edkb08/Datenbank/clsMyMitarbeiter.vb
Normal file
73
edkb08/Datenbank/clsMyMitarbeiter.vb
Normal file
@@ -0,0 +1,73 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Security.Principal
|
||||
|
||||
|
||||
Namespace edokadb
|
||||
Public Class clsMyMitarbeiter
|
||||
Inherits edokaDB.clsMitarbeiter
|
||||
|
||||
#Region "Deklarationen"
|
||||
Private m_xtgnummer As String
|
||||
|
||||
Property xtgnummer() As String
|
||||
Get
|
||||
Return m_xtgnummer
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_xtgnummer = Value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Public Function SelectWithTGNummer() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[sp_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, m_xtgnummer))
|
||||
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_mitarbeiter_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
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
1150
edkb08/Datenbank/clsPartner.vb
Normal file
1150
edkb08/Datenbank/clsPartner.vb
Normal file
File diff suppressed because it is too large
Load Diff
1121
edkb08/Datenbank/clsPartner_sik.vb
Normal file
1121
edkb08/Datenbank/clsPartner_sik.vb
Normal file
File diff suppressed because it is too large
Load Diff
510
edkb08/Datenbank/clsStatushistory.vb
Normal file
510
edkb08/Datenbank/clsStatushistory.vb
Normal file
@@ -0,0 +1,510 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'statushistory'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Sonntag, 25. Mai 2003, 21:40:11
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'statushistory'.
|
||||
' /// </summary>
|
||||
Public Class clsStatushistory
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daErstellt_am, m_daMutiert_am As SqlDateTime
|
||||
Private m_iMutierer, m_iVerantwortlich, m_iStatushistorynr, m_iMandantnr, m_iStatus As SqlInt32
|
||||
Private m_sDokumentid 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>iStatushistorynr</LI>
|
||||
' /// <LI>iStatus</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>sDokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>iVerantwortlich. 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_statushistory_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatushistorynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iStatushistorynr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iverantwortlich", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlich))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_statushistory_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("clsStatushistory::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>iStatushistorynr</LI>
|
||||
' /// <LI>iStatus</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>sDokumentid. May be SqlString.Null</LI>
|
||||
' /// <LI>iVerantwortlich. 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_statushistory_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatushistorynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iStatushistorynr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatus", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iStatus))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 1, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 23, 3, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sdokumentid", SqlDbType.VarChar, 22, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDokumentid))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iverantwortlich", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iVerantwortlich))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_statushistory_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("clsStatushistory::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>iStatushistorynr</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_statushistory_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@istatushistorynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iStatushistorynr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_statushistory_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("clsStatushistory::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>iStatushistorynr</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iStatushistorynr</LI>
|
||||
' /// <LI>iStatus</LI>
|
||||
' /// <LI>iMandantnr</LI>
|
||||
' /// <LI>bAktiv</LI>
|
||||
' /// <LI>daErstellt_am</LI>
|
||||
' /// <LI>daMutiert_am</LI>
|
||||
' /// <LI>iMutierer</LI>
|
||||
' /// <LI>sDokumentid</LI>
|
||||
' /// <LI>iVerantwortlich</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_statushistory_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("statushistory")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatushistorynr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iStatushistorynr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_statushistory_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iStatushistorynr = New SqlInt32(CType(dtToReturn.Rows(0)("statushistorynr"), Integer))
|
||||
m_iStatus = New SqlInt32(CType(dtToReturn.Rows(0)("status"), Integer))
|
||||
If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then
|
||||
m_iMandantnr = SqlInt32.Null
|
||||
Else
|
||||
m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("dokumentid") Is System.DBNull.Value Then
|
||||
m_sDokumentid = SqlString.Null
|
||||
Else
|
||||
m_sDokumentid = New SqlString(CType(dtToReturn.Rows(0)("dokumentid"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("verantwortlich") Is System.DBNull.Value Then
|
||||
m_iVerantwortlich = SqlInt32.Null
|
||||
Else
|
||||
m_iVerantwortlich = New SqlInt32(CType(dtToReturn.Rows(0)("verantwortlich"), 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("clsStatushistory::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_statushistory_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("statushistory")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_statushistory_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("clsStatushistory::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 [iStatushistorynr]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatushistorynr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iStatushistorynrTmp As SqlInt32 = Value
|
||||
If iStatushistorynrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iStatushistorynr", "iStatushistorynr can't be NULL")
|
||||
End If
|
||||
m_iStatushistorynr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iStatus]() As SqlInt32
|
||||
Get
|
||||
Return m_iStatus
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iStatusTmp As SqlInt32 = Value
|
||||
If iStatusTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iStatus", "iStatus can't be NULL")
|
||||
End If
|
||||
m_iStatus = 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 [sDokumentid]() As SqlString
|
||||
Get
|
||||
Return m_sDokumentid
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sDokumentid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iVerantwortlich]() As SqlInt32
|
||||
Get
|
||||
Return m_iVerantwortlich
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iVerantwortlich = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
528
edkb08/Datenbank/clsVv.vb
Normal file
528
edkb08/Datenbank/clsVv.vb
Normal file
@@ -0,0 +1,528 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'VV'
|
||||
' // Generated by LLBLGen v1.2.1045.38210 Final on: Mittwoch, 17. September 2003, 00:12:40
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace edokadb
|
||||
' /// <summary>
|
||||
' /// Purpose: Data Access class for the table 'VV'.
|
||||
' /// </summary>
|
||||
Public Class clsVV
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_iNRPRD00, m_iNRVBS00, m_iNRSPR00, m_iNRVVG00, m_iNRPAR00 As SqlInt32
|
||||
Private m_sNAVVG00, m_sSAREC00, m_sBEPRDLG, m_sTXRBK00, m_sNEVVG00 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>iNRVVG00</LI>
|
||||
' /// <LI>iNRPAR00. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iNRSPR00. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sBEPRDLG. May be SqlString.Null</LI>
|
||||
' /// <LI>iNRPRD00. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sTXRBK00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNEVVG00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNAVVG00. May be SqlString.Null</LI>
|
||||
' /// <LI>iNRVBS00. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sSAREC00. 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_VV_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRVVG00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRVVG00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRPAR00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRPAR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRSPR00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRSPR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEPRDLG", SqlDbType.NVarChar, 35, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEPRDLG))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRPRD00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRPRD00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTXRBK00", SqlDbType.VarChar, 35, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTXRBK00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNEVVG00", SqlDbType.VarChar, 16, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNEVVG00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNAVVG00", SqlDbType.VarChar, 16, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNAVVG00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRVBS00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRVBS00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSAREC00", SqlDbType.VarChar, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSAREC00))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_VV_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("clsVV::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>iNRVVG00</LI>
|
||||
' /// <LI>iNRPAR00. May be SqlInt32.Null</LI>
|
||||
' /// <LI>iNRSPR00. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sBEPRDLG. May be SqlString.Null</LI>
|
||||
' /// <LI>iNRPRD00. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sTXRBK00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNEVVG00. May be SqlString.Null</LI>
|
||||
' /// <LI>sNAVVG00. May be SqlString.Null</LI>
|
||||
' /// <LI>iNRVBS00. May be SqlInt32.Null</LI>
|
||||
' /// <LI>sSAREC00. 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_VV_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRVVG00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRVVG00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRPAR00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRPAR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRSPR00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRSPR00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sBEPRDLG", SqlDbType.NVarChar, 35, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sBEPRDLG))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRPRD00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRPRD00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sTXRBK00", SqlDbType.VarChar, 35, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sTXRBK00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNEVVG00", SqlDbType.VarChar, 16, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNEVVG00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sNAVVG00", SqlDbType.VarChar, 16, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sNAVVG00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRVBS00", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNRVBS00))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sSAREC00", SqlDbType.VarChar, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sSAREC00))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_VV_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("clsVV::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>iNRVVG00</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_VV_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iNRVVG00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRVVG00))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_VV_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("clsVV::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>iNRVVG00</LI>
|
||||
' /// </UL>
|
||||
' /// Properties set after a succesful call of this method:
|
||||
' /// <UL>
|
||||
' /// <LI>iErrorCode</LI>
|
||||
' /// <LI>iNRVVG00</LI>
|
||||
' /// <LI>iNRPAR00</LI>
|
||||
' /// <LI>iNRSPR00</LI>
|
||||
' /// <LI>sBEPRDLG</LI>
|
||||
' /// <LI>iNRPRD00</LI>
|
||||
' /// <LI>sTXRBK00</LI>
|
||||
' /// <LI>sNEVVG00</LI>
|
||||
' /// <LI>sNAVVG00</LI>
|
||||
' /// <LI>iNRVBS00</LI>
|
||||
' /// <LI>sSAREC00</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_VV_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("VV")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iNRVVG00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRVVG00))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_VV_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iNRVVG00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRVVG00"), Integer))
|
||||
If dtToReturn.Rows(0)("NRPAR00") Is System.DBNull.Value Then
|
||||
m_iNRPAR00 = SqlInt32.Null
|
||||
Else
|
||||
m_iNRPAR00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRPAR00"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NRSPR00") Is System.DBNull.Value Then
|
||||
m_iNRSPR00 = SqlInt32.Null
|
||||
Else
|
||||
m_iNRSPR00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRSPR00"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("BEPRDLG") Is System.DBNull.Value Then
|
||||
m_sBEPRDLG = SqlString.Null
|
||||
Else
|
||||
m_sBEPRDLG = New SqlString(CType(dtToReturn.Rows(0)("BEPRDLG"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NRPRD00") Is System.DBNull.Value Then
|
||||
m_iNRPRD00 = SqlInt32.Null
|
||||
Else
|
||||
m_iNRPRD00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRPRD00"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("TXRBK00") Is System.DBNull.Value Then
|
||||
m_sTXRBK00 = SqlString.Null
|
||||
Else
|
||||
m_sTXRBK00 = New SqlString(CType(dtToReturn.Rows(0)("TXRBK00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NEVVG00") Is System.DBNull.Value Then
|
||||
m_sNEVVG00 = SqlString.Null
|
||||
Else
|
||||
m_sNEVVG00 = New SqlString(CType(dtToReturn.Rows(0)("NEVVG00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NAVVG00") Is System.DBNull.Value Then
|
||||
m_sNAVVG00 = SqlString.Null
|
||||
Else
|
||||
m_sNAVVG00 = New SqlString(CType(dtToReturn.Rows(0)("NAVVG00"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("NRVBS00") Is System.DBNull.Value Then
|
||||
m_iNRVBS00 = SqlInt32.Null
|
||||
Else
|
||||
m_iNRVBS00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRVBS00"), Integer))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("SAREC00") Is System.DBNull.Value Then
|
||||
m_sSAREC00 = SqlString.Null
|
||||
Else
|
||||
m_sSAREC00 = New SqlString(CType(dtToReturn.Rows(0)("SAREC00"), 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("clsVV::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_VV_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("VV")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = scmCmdToExecute.Parameters.Item("@iErrorCode").Value
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_VV_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("clsVV::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 [iNRVVG00]() As SqlInt32
|
||||
Get
|
||||
Return m_iNRVVG00
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iNRVVG00Tmp As SqlInt32 = Value
|
||||
If iNRVVG00Tmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iNRVVG00", "iNRVVG00 can't be NULL")
|
||||
End If
|
||||
m_iNRVVG00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iNRPAR00]() As SqlInt32
|
||||
Get
|
||||
Return m_iNRPAR00
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iNRPAR00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iNRSPR00]() As SqlInt32
|
||||
Get
|
||||
Return m_iNRSPR00
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iNRSPR00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sBEPRDLG]() As SqlString
|
||||
Get
|
||||
Return m_sBEPRDLG
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sBEPRDLG = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iNRPRD00]() As SqlInt32
|
||||
Get
|
||||
Return m_iNRPRD00
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iNRPRD00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sTXRBK00]() As SqlString
|
||||
Get
|
||||
Return m_sTXRBK00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sTXRBK00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNEVVG00]() As SqlString
|
||||
Get
|
||||
Return m_sNEVVG00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNEVVG00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sNAVVG00]() As SqlString
|
||||
Get
|
||||
Return m_sNAVVG00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sNAVVG00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iNRVBS00]() As SqlInt32
|
||||
Get
|
||||
Return m_iNRVBS00
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iNRVBS00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sSAREC00]() As SqlString
|
||||
Get
|
||||
Return m_sSAREC00
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sSAREC00 = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
43
edkb08/Datenbank/db_connection.vb
Normal file
43
edkb08/Datenbank/db_connection.vb
Normal file
@@ -0,0 +1,43 @@
|
||||
Imports System.ComponentModel
|
||||
Imports Microsoft.VisualBasic
|
||||
|
||||
Namespace edokadb
|
||||
|
||||
Public Class DB_Connection
|
||||
Shared Sub New()
|
||||
'Edoka
|
||||
oread = System.IO.File.OpenText(DivFnkt.ApplicationPath + "edokaconn.cfg")
|
||||
sConnectionString_edoka = oread.ReadLine
|
||||
'sConnectionString_edoka = Crypto.DecryptText(sConnectionString, "HutterundMueller")
|
||||
'sConnectionString_edoka = Left(sConnectionString, Len(sConnectionString) - 1)
|
||||
Globals.sConnectionString_edoka = sConnectionString_edoka
|
||||
oread.Close()
|
||||
|
||||
'Journale
|
||||
oread = System.IO.File.OpenText(DivFnkt.ApplicationPath + "journaleconn.cfg")
|
||||
sConnectionString_journale = oread.ReadLine
|
||||
'sConnectionString_journale = Crypto.DecryptText(sConnectionString, "HutterundMueller")
|
||||
'sConnectionString_journale = Left(sConnectionString, Len(sConnectionString) - 1)
|
||||
Globals.sConnectionString_journale = sConnectionString_journale
|
||||
oread.Close()
|
||||
|
||||
|
||||
'Journale für Mailversand
|
||||
oread = System.IO.File.OpenText(DivFnkt.ApplicationPath + "journaleconn_Mail.cfg")
|
||||
sConnectionString_journale_mail = oread.ReadLine
|
||||
'sConnectionString_journale = Crypto.DecryptText(sConnectionString, "HutterundMueller")
|
||||
'sConnectionString_journale = Left(sConnectionString, Len(sConnectionString) - 1)
|
||||
Globals.sConnectionString_journale_mail = sConnectionString_journale_Mail
|
||||
oread.Close()
|
||||
|
||||
|
||||
|
||||
Globals.conn_edoka.sConnectionString = sConnectionString_edoka
|
||||
Globals.conn_journale.sConnectionString = sConnectionString_journale
|
||||
Globals.conn_journale_Mail.sConnectionString = sConnectionString_journale_Mail
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
|
||||
BIN
edkb08/Datenbank/vssver.scc
Normal file
BIN
edkb08/Datenbank/vssver.scc
Normal file
Binary file not shown.
134
edkb08/Globals.vb
Normal file
134
edkb08/Globals.vb
Normal file
@@ -0,0 +1,134 @@
|
||||
'''<summary>Globale Variablen und FUnktionen</summary>
|
||||
Module Globals
|
||||
'''<summary>Datentabelle mit den EDOKA-Applikationsdaten</summary>
|
||||
Public Applikationsdaten As DataTable
|
||||
'''<summary>Datensatzzeiger in der Tabelle Applikationsdaten</summary>
|
||||
Public AppldataRow As Integer
|
||||
|
||||
'''<summary>Verbindung zur Daten EDOKA</summary>
|
||||
Public sConnectionString_edoka As String
|
||||
'''<summary>Verbindung zur Daten EDOKA_Journale</summary>
|
||||
Public sConnectionString_journale As String
|
||||
'''<summary>Verbindung zur Daten EDOKA_Journale mit dem Mail-User</summary>
|
||||
Public sConnectionString_journale_Mail As String
|
||||
Public CurrentTS As String
|
||||
Public BLScan As Boolean = False
|
||||
Public NoIndexdata As Boolean = False
|
||||
Public ImportPraefix As String = "EDKIMP"
|
||||
Public ImportPraefix_Canon_Nr As Integer = 0
|
||||
'Public Canon_Herkunft As String = "IRIS_FORMS"
|
||||
Public Fehlermeldung As String = ""
|
||||
Public Function Canon_Herkunft(Input As String) As Boolean
|
||||
If Input = "IRIS_FORMS" Then
|
||||
Return True
|
||||
Exit Function
|
||||
End If
|
||||
If Input = "IRIS_FORMS_DMS" Then
|
||||
Return True
|
||||
Exit Function
|
||||
End If
|
||||
If Input = "IRIS_FORMS_EDK" Then
|
||||
Return True
|
||||
Exit Function
|
||||
End If
|
||||
If Input = "IRIS_FORMS_LSV" Then
|
||||
Return True
|
||||
Exit Function
|
||||
End If
|
||||
If Input = "IRIS_FORMS_UVM" Then
|
||||
Return True
|
||||
Exit Function
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
'''<summary>Befehlszeilenargumente</summary>
|
||||
Public args As String() = Environment.GetCommandLineArgs()
|
||||
|
||||
'''<summary>Connectionprovider für die Datenbank EDOKA</summary>
|
||||
'''<seealso
|
||||
'''cref="edokadb.clsConnectionProvider">edokadb.clsConnectionProvider</seealso>
|
||||
Public conn_edoka As New edokadb.clsConnectionProvider()
|
||||
'''<summary>Connectionprovider für die Datenbank EDOKA_Journale</summary>
|
||||
'''<seealso
|
||||
'''cref="edokadb.clsConnectionProvider">edokadb.clsConnectionProvider</seealso>
|
||||
Public conn_journale As New edokadb.clsConnectionProvider()
|
||||
|
||||
|
||||
'''<summary>Connectionprovider für die Datenbank EDOKA_Journale</summary>
|
||||
'''<seealso
|
||||
'''cref="edokadb.clsConnectionProvider">edokadb.clsConnectionProvider</seealso>
|
||||
Public conn_journale_Mail As New edokadb.clsConnectionProvider()
|
||||
|
||||
'''<summary>Instanz des Objektes DivFnkt</summary>
|
||||
Public DivFnkt As New clsDivFnkt()
|
||||
|
||||
Public xFehler As Integer = 0
|
||||
Public Warning As Integer = 0
|
||||
Public DokumentID As String
|
||||
Public ColdDokumentID As String
|
||||
Public KeyNr As Long
|
||||
Public Params As New ClsParameters()
|
||||
Public temp_indexdaten As DataTable
|
||||
|
||||
|
||||
Public ofile As System.IO.File
|
||||
Public oread As System.IO.StreamReader
|
||||
|
||||
'''<summary>Hält die Applikationsdaten für ein zu importierendes Dokumente
|
||||
'''fest</summary>
|
||||
Public ApplData As New DataTable()
|
||||
|
||||
'''<summary>Ausgabe eines Strings mit vorgestelltem TimeStamp</summary>
|
||||
'''<param name="s"></param>
|
||||
Public Sub PrintOut(ByVal s As String)
|
||||
'Console.WriteLine(Format(Now, "yyyyMMddHHmmss") + ": " + s)
|
||||
PrintLog(Format(Now, "yyyyMMddHHmmss") + ": " + s, EventLogEntryType.Information)
|
||||
End Sub
|
||||
|
||||
Public Sub Printout(ByVal s As String, ByVal LogEntryType As EventLogEntryType)
|
||||
PrintLog(Format(Now, "yyyyMMddHHmmss") + ": " + s, LogEntryType)
|
||||
End Sub
|
||||
|
||||
Dim EVLog As New EventLog("Log_EDKB08")
|
||||
|
||||
'''<summary>Eintrag ins EventLog von EDKB08 schreiben</summary>
|
||||
'''<param name="message"></param>
|
||||
'''<param name="eventmessage"></param>
|
||||
Public Sub PrintLog(ByVal message As String, Optional ByVal eventmessage As EventLogEntryType = EventLogEntryType.Information)
|
||||
#If CONFIG = "Release" Then 'Release
|
||||
If Not EventLog.SourceExists("EDKB08") Then
|
||||
EventLog.CreateEventSource("EDKB08", "EDKB08 Log")
|
||||
End If
|
||||
EVLog.Source = "EDKB08 Log"
|
||||
|
||||
EventLog.WriteEntry(EVLog.Source, message, eventmessage)
|
||||
#Else
|
||||
Debug.Print(message)
|
||||
|
||||
|
||||
|
||||
#End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
'''<summary>Globaler Verweis zur Klasse CLSJournal</summary>
|
||||
Public Journal As New clsJournal()
|
||||
|
||||
'''<summary>Daten für der Herkunftsapplikation</summary>
|
||||
'''<remarks>Diese interne Tabelle enthält die Daten für die Herkunftsapplikation
|
||||
'''einer Indexdatei</remarks>
|
||||
Public Herkunftsapplikation As DataTable
|
||||
|
||||
'''<summary>Interne Variable zur Festhaltung von Fehlern</summary>
|
||||
Public Fehler As Integer = 0
|
||||
|
||||
|
||||
Public Mitarbeiternr As Integer = 0
|
||||
|
||||
|
||||
|
||||
|
||||
End Module
|
||||
281
edkb08/Main.vb
Normal file
281
edkb08/Main.vb
Normal file
@@ -0,0 +1,281 @@
|
||||
Imports System.IO.File
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.ComponentModel
|
||||
Imports System
|
||||
Imports System.IO
|
||||
Imports System.SystemException
|
||||
|
||||
'''<summary>EDKB08 - Hauptprogramm</summary>
|
||||
'''<remarks>EDKB08 ist ein Importfunktion für Dokumente, welche durch
|
||||
'''Fremdanwendungen geliefert und in EDOKA importiert werden sollen.
|
||||
'''
|
||||
'''Als Input werden die einzelenen Dokumente sowie eine oderer mehrer Dateien mit
|
||||
'''den zugehörenden Indexinformationen in ein definiertes Verzeichnis gestellt.
|
||||
'''
|
||||
'''EDKB08 überwacht das definierte Verzeichnis. Sobald eine Datei mit der Endung
|
||||
'''".IND" angeliefert wird, startet der eigentliche Importvorgang.</remarks>
|
||||
Module Main
|
||||
|
||||
|
||||
#Region "Deklarationen"
|
||||
'''<summary>Variable mit dem Namen des zu überwachenden Verzeichnises</summary>
|
||||
Dim Watch_Directory As String
|
||||
'''<summary>FileSystemWatcher</summary>
|
||||
'''<remarks>Dieser Reagiert auf das Ereignis OnCreate im angegebenen Verzeichnis
|
||||
'''(Watch_Directory)</remarks>
|
||||
Dim FileWatch As New FileSystemWatcher()
|
||||
|
||||
'''<summary>Varaible zum Zwischenspeichern der Indexdaten einer
|
||||
'''Indexdaten-Datei</summary>
|
||||
Dim indexdata As DataTable
|
||||
|
||||
Dim WithEvents JournalTimer As New Timers.Timer()
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Hauptverarbeitung"
|
||||
'''<summary>Steuerroutine für EDKB08</summary>
|
||||
'''<remarks>Diese Routine wird beim Programmstart durchlaufen. Dabei werden die
|
||||
'''benötigten Parameter ausgelesen und an der Konsole angezeigt.
|
||||
'''
|
||||
'''Nach erfolgreicher Initialisierung werden Aktivitäten im vordefinierten
|
||||
'''Verzeichnis abgewartet.</remarks>
|
||||
Public Sub Main()
|
||||
PrintOut("Start EDKB08")
|
||||
JournalTimer.Interval = 3600000
|
||||
JournalTimer.Enabled = True
|
||||
|
||||
'Parameter auslesen
|
||||
If Params.Loadparameters = False Then
|
||||
PrintOut(Params.Meldung)
|
||||
PrintOut("Verarbeitung abgebrochen")
|
||||
Exit Sub
|
||||
Else
|
||||
Watch_Directory = Params.Inputverzeichnis
|
||||
PrintOut(Params.Meldung)
|
||||
PrintOut("Parameter:")
|
||||
PrintOut("Überwachtes Verzeichnis: " + Params.Inputverzeichnis)
|
||||
PrintOut("E-Mail OK: " + Params.MailAdresseOK)
|
||||
PrintOut("E-Mail NOK:" + Params.MailAdresseNOK)
|
||||
End If
|
||||
'Datenbank initialisieren
|
||||
Dim db_conn As New edokadb.DB_Connection()
|
||||
|
||||
'Verzeichnis-Überwachung initialisieren und starten
|
||||
If Not Init_Filewatcher() Then
|
||||
PrintOut("Verarbeitung gestoppt", EventLogEntryType.Error)
|
||||
End If
|
||||
If Not Start_Watching() Then
|
||||
PrintOut("Verarbeitung gestoppt", EventLogEntryType.Error)
|
||||
Exit Sub
|
||||
End If
|
||||
PrintOut("")
|
||||
PrintOut("Return-Taste betätigen, um EDKB08 zu stoppen")
|
||||
Console.ReadLine()
|
||||
PrintOut("EDKB08 gestoppt")
|
||||
End Sub
|
||||
|
||||
'''<summary>Verarbeitung von angelieferten Indexdateien. Die Verarbeitung läuft so
|
||||
'''lange, bis keine .IND-Dateien mehr im Improt-Verzeichnis vorhanden
|
||||
'''sind.</summary>
|
||||
'''<remarks>Die angeleiferten Indexdateien im Verzeichnis werden eingelesen und
|
||||
'''verarbeitet.</remarks>
|
||||
Private Sub Verarbeiten()
|
||||
Dim looper As Boolean = True
|
||||
Dim counter As Integer
|
||||
counter = 0
|
||||
While looper = True
|
||||
counter = counter + 1
|
||||
Globals.Journal.Open_Journal()
|
||||
'Alle .IND-Dateien im Verzeichnis auslesen
|
||||
Dim clsindex As New clsIndexData()
|
||||
Dim di As New IO.DirectoryInfo(Watch_Directory)
|
||||
Dim diar1 As IO.FileInfo() = di.GetFiles("*.ind")
|
||||
Dim dra As IO.FileInfo
|
||||
If diar1.Length = 0 Then
|
||||
looper = False
|
||||
clsindex = Nothing
|
||||
di = Nothing
|
||||
diar1 = Nothing
|
||||
Globals.Journal.Delete_Entry()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
For Each dra In diar1
|
||||
Globals.Journal.Insert_Journal("", "", "", dra.FullName, "", "Start der Verarbeitung", "", "")
|
||||
PrintOut("File-Nr " + counter + ": " + dra.FullName)
|
||||
clsindex.IndexFileName = dra.FullName
|
||||
If clsindex.getindexdata Then
|
||||
indexdata = clsindex.Indexdata
|
||||
Dim check_and_import As New clsCheckandImport()
|
||||
check_and_import.IndexData = indexdata
|
||||
|
||||
If check_and_import.Herkunftsapplikationen_auslesen Then
|
||||
'Sofern die Herkunftsapplikation erruiert werden konnte, wird die Journaltabelle mit der Applikationsid nachgeführt
|
||||
Globals.Journal.Update_Journal()
|
||||
|
||||
'Verarbeitung der Daten
|
||||
check_and_import.CheckandImport()
|
||||
check_and_import = Nothing
|
||||
End If
|
||||
End If
|
||||
Journal.Insert_Journal("", "", "", dra.FullName, "", "Total Index-Datensätze: " + LTrim(Str(indexdata.Rows.Count)), "", "")
|
||||
Journal.Insert_Journal("", "", "", dra.FullName, "", "Verarbeitung abgeschlossen.", "", "")
|
||||
Logdatei_Erstellen()
|
||||
|
||||
Next
|
||||
clsindex = Nothing
|
||||
di = Nothing
|
||||
diar1 = Nothing
|
||||
Globals.Journal.Close_Journal()
|
||||
End While
|
||||
End Sub
|
||||
|
||||
'''<summary>Journaldatei erstellen und je nach Applikationseinstellungen
|
||||
'''versenden</summary>
|
||||
'''<remarks>Erstellt eine Journaldatei mit den Journaldaten der Verarbeitung und
|
||||
'''sendet diese mittels Mail bzw. mittls DTO weiter</remarks>
|
||||
Private Sub Logdatei_Erstellen()
|
||||
Dim filename As String
|
||||
Try
|
||||
If Globals.Herkunftsapplikation.Rows(0).Item("log_per_mail") = False And Globals.Herkunftsapplikation.Rows(0).Item("log_mit_dto") = False Then Exit Sub
|
||||
If Globals.Herkunftsapplikation.Rows(0).Item("log_per_mail") = True And Globals.Herkunftsapplikation.Rows(0).Item("Mail_Periodizitaet") = 0 Then
|
||||
filename = Journal.Print_Log(Globals.Herkunftsapplikation.Rows(0).Item(0), Globals.Herkunftsapplikation.Rows(0).Item(1), Globals.Herkunftsapplikation.Rows(0).Item("outputformat"))
|
||||
End If
|
||||
If Globals.Herkunftsapplikation.Rows(0).Item("log_mit_dto") = True Then
|
||||
filename = Journal.Print_Log(Globals.Herkunftsapplikation.Rows(0).Item(0), Globals.Herkunftsapplikation.Rows(0).Item(1), Globals.Herkunftsapplikation.Rows(0).Item("outputformat"))
|
||||
Send_DTO(filename)
|
||||
End If
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'''<summary>DTO-Versand</summary>
|
||||
'''<param name="filename"></param>
|
||||
Private Sub Send_DTO(ByVal filename As String)
|
||||
Try
|
||||
Dim i As Integer
|
||||
Dim tw As TextWriter
|
||||
Dim s As String
|
||||
s = Herkunftsapplikation.Rows(0).Item(3)
|
||||
s = s.Replace("%1", filename)
|
||||
tw = New StreamWriter(New FileStream(Params.TempPfad + "dtotransfer.cmd", FileMode.Create))
|
||||
tw.WriteLine(s)
|
||||
tw.Flush()
|
||||
tw.Close()
|
||||
i = Microsoft.VisualBasic.Shell(Params.TempPfad + "dtotransfer.cmd", AppWinStyle.Hide, True)
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub Send_Mail(ByVal filename As String, ByVal empfaenger As String)
|
||||
Try
|
||||
Dim i As Integer
|
||||
Dim tw As TextWriter
|
||||
Dim s As String
|
||||
s = Herkunftsapplikation.Rows(0).Item(3)
|
||||
s = s.Replace("%1", filename)
|
||||
tw = New StreamWriter(New FileStream(Params.TempPfad + "dtotransfer.cmd", FileMode.Create))
|
||||
tw.WriteLine(s)
|
||||
tw.Flush()
|
||||
tw.Close()
|
||||
i = Microsoft.VisualBasic.Shell(Params.TempPfad + "dtotransfer.cmd", AppWinStyle.Hide, True)
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "FileWatcher"
|
||||
'''<summary>Initialisierung des Filewacher-Objektes</summary>
|
||||
'''<remarks>Das Filewacher-Objekt wird mit den entpsrechenden Pfad- sowie
|
||||
'''Dateifilter-Angaben initialisiert.</remarks>
|
||||
Private Function Init_Filewatcher() As Boolean
|
||||
Try
|
||||
FileWatch.Path = Watch_Directory
|
||||
FileWatch.IncludeSubdirectories = False
|
||||
FileWatch.Filter = "*.*"
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
PrintOut("Fehler bei der Initialisierung des Filewacherobjekts auf " + Watch_Directory)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'''<summary>Eventhandler des FileWatching-Objektes aktivieren</summary>
|
||||
Private Function Start_Watching() As Boolean
|
||||
Try
|
||||
AddHandler FileWatch.Created, New FileSystemEventHandler(AddressOf OnFileEvent)
|
||||
FileWatch.EnableRaisingEvents = True
|
||||
PrintOut("Event-Handler initialisiert")
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
PrintOut("Fehler bei der Event-Initialisierung")
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'''<summary>Aktivitäten im Inputverzeichnis verarbeiten</summary>
|
||||
'''<remarks>Wird eine Datei mit der Endung .IND angeliefert, wird der Eventhandler
|
||||
'''gestoppt und die anstehenden Dokumente verarbeitet.
|
||||
'''
|
||||
'''Nach abgeschlossener Verarbeitung wird der Eventhandler wieder
|
||||
'''eingeschaltet</remarks>
|
||||
'''<param name="source"></param>
|
||||
'''<param name="e"></param>
|
||||
Private Sub OnFileEvent(ByVal source As Object, ByVal e As FileSystemEventArgs)
|
||||
If UCase(Microsoft.VisualBasic.Right(e.FullPath, 4)) = ".IND" Then
|
||||
PrintOut("Neue Datei " + e.FullPath)
|
||||
FileWatch.EnableRaisingEvents = False
|
||||
Verarbeiten()
|
||||
FileWatch.EnableRaisingEvents = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Utils"
|
||||
#End Region
|
||||
|
||||
'Public Sub JournalTimer_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles JournalTimer.Elapsed
|
||||
|
||||
' If Now.Hour > 0 And Now.Hour < 1 Then
|
||||
' Dim filename As String
|
||||
' Dim dt As DataTable
|
||||
' Dim i As Integer
|
||||
' PrintOut("Start Tägliche Journalerstellung")
|
||||
' dt = get_applikationen()
|
||||
' For i = 0 To dt.Rows.Count - 1
|
||||
' filename = Journal.Print_Log(dt.Rows(i).Item(0), dt.Rows(i).Item(1), dt.Rows(i).Item(2))
|
||||
' Send_Mail(filename, dt.Rows(i).Item(3))
|
||||
' PrintOut(dt.Rows(i).Item(1) + ": " + "Journal gesendet")
|
||||
' Next
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Private Function get_applikationen() As DataTable
|
||||
' Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
' Dim dtToReturn As DataTable = New DataTable()
|
||||
' Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
||||
' scmCmdToExecute.CommandText = "dbo.sp_edoka_import_Journalversand] "
|
||||
' scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
' scmCmdToExecute.Connection = conn_edoka.scoDBConnection
|
||||
' Try
|
||||
' sdaAdapter.Fill(dtToReturn)
|
||||
' Return dtToReturn
|
||||
' Catch ex As Exception
|
||||
' PrintOut("Tägliche Journalerstellung fehlgeschlagen. " + ex.Message, EventLogEntryType.Error)
|
||||
' Finally
|
||||
' scmCmdToExecute.Dispose()
|
||||
' sdaAdapter.Dispose()
|
||||
' dtToReturn.Dispose()
|
||||
' End Try
|
||||
'End Function
|
||||
|
||||
End Module
|
||||
|
||||
|
||||
3333
edkb08/clsCheckandImport.vb
Normal file
3333
edkb08/clsCheckandImport.vb
Normal file
File diff suppressed because it is too large
Load Diff
269
edkb08/clsDivFnkt.vb
Normal file
269
edkb08/clsDivFnkt.vb
Normal file
@@ -0,0 +1,269 @@
|
||||
Imports System.IO
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Reflection
|
||||
|
||||
'''<summary>Diverse allgemeine Funktionen</summary>
|
||||
'''<remarks>Diesee Klasse kapselt diverse, allgemeine Funktionen, welche aus
|
||||
'''diversen anderen Klassen genutzt werden.$EOL$
|
||||
'''<para>Die Instanzierung der Klasse erfolgt über das Module <see
|
||||
'''cref="Globals">Globals.vb</see></para></remarks>
|
||||
'''<seealso cref="Globals.DivFnkt">Globals.DivFnkt</seealso>
|
||||
Public Class clsDivFnkt
|
||||
'''<summary>Generieren der EDOKA-DokumentID</summary>
|
||||
'''<remarks>Diese Methode generiert eine neue eindeutige, 22-stellige
|
||||
'''EDOKA-Dokumentid. $EOL$
|
||||
'''<para>Die Letzte ziffer ist eine Prüfziffer</para></remarks>
|
||||
'''<returns>DokumentID für EDOKA</returns>
|
||||
'''<seealso
|
||||
'''cref="clsDivFnkt.Pruefziffer">Prüfziffer-Berechnung</seealso>
|
||||
Public Function Generate_Key() As String
|
||||
Dim dbkey As New edokadb.clsMyKey_Tabelle()
|
||||
Dim key As Long
|
||||
Dim skey As String
|
||||
Dim s As String
|
||||
dbkey.cpMainConnectionProvider = conn_edoka
|
||||
conn_edoka.OpenConnection()
|
||||
key = dbkey.get_dbkey("dokument")
|
||||
conn_edoka.CloseConnection(False)
|
||||
skey = "OFFEDK000"
|
||||
|
||||
s = Str(Year(Now))
|
||||
While Microsoft.VisualBasic.Left(s, 1) = " "
|
||||
s = Microsoft.VisualBasic.Right(s, Len(s) - 1)
|
||||
End While
|
||||
skey = skey + s
|
||||
|
||||
s = Str(key)
|
||||
While Microsoft.VisualBasic.Left(s, 1) = " "
|
||||
s = Microsoft.VisualBasic.Right(s, Len(s) - 1)
|
||||
End While
|
||||
|
||||
While Len(s) < 8
|
||||
s = "0" + s
|
||||
End While
|
||||
skey = skey + s
|
||||
|
||||
s = Pruefziffer(Microsoft.VisualBasic.Right(skey, 15))
|
||||
While Microsoft.VisualBasic.Left(s, 1) = " "
|
||||
s = Microsoft.VisualBasic.Right(s, Len(s) - 1)
|
||||
End While
|
||||
skey = skey + s
|
||||
Generate_Key = skey
|
||||
End Function
|
||||
|
||||
'''<summary>Berechnung der Prüfziffer nach Modulo9/Rekursiv</summary>
|
||||
'''<param name="zahl">Dokumentid ohne Präfix</param>
|
||||
'''<returns>DokumentID ohne Präfix (OFFEDK) inkl. Prüfziffer</returns>
|
||||
'''<seealso cref="clsDivFnkt.Generate_Key">EDKB08.clsDivFnkt</seealso>
|
||||
Public Function Pruefziffer(ByVal zahl As String) As String
|
||||
Dim ptab(9, 9) As Integer
|
||||
Dim pz(9) As Integer
|
||||
Dim s1, s2, s3 As String
|
||||
|
||||
Dim i1, i2 As Long
|
||||
|
||||
s1 = "0,9,4,6,8,2,7,1,3,5"
|
||||
s2 = s1
|
||||
For i1 = 0 To 9
|
||||
For i2 = 0 To 9
|
||||
ptab(i1, i2) = Mid(s2, (i2 * 2) + 1, 1)
|
||||
Next
|
||||
s3 = Microsoft.VisualBasic.Left(s1, 1)
|
||||
s1 = Microsoft.VisualBasic.Right(s1, Len(s1) - 2)
|
||||
s1 = s1 + "," + s3
|
||||
s2 = s1
|
||||
Next
|
||||
pz(0) = 0
|
||||
pz(1) = 9
|
||||
pz(2) = 8
|
||||
pz(3) = 7
|
||||
pz(4) = 6
|
||||
pz(5) = 5
|
||||
pz(6) = 4
|
||||
pz(7) = 3
|
||||
pz(8) = 2
|
||||
pz(9) = 1
|
||||
|
||||
Dim i, x, y As Integer
|
||||
y = 0
|
||||
For i = 1 To Len(zahl)
|
||||
x = Val(Mid(zahl, i, 1))
|
||||
y = ptab(x, y)
|
||||
Next
|
||||
Pruefziffer = Str(pz(y))
|
||||
End Function
|
||||
|
||||
'''<summary>Dokumen in der EDOKA-Datenbank speichern</summary>
|
||||
'''<remarks>Die Funktion speichert ein Dokument des Filesystems in die
|
||||
'''EDOKA-Datenbank Tabelle DOKS</remarks>
|
||||
'''<param name="sDokumentID">DEDOKA-Dokumentid</param>
|
||||
'''<param name="sDokumentName">Origianl-Dokumentname (Fullpath)</param>
|
||||
'''<returns>True=Speichern erfolgreich, False=Speichern fehlgeschalgen</returns>
|
||||
Public Function Save_To_DB(ByVal sDokumentID As String, ByVal sDokumentName As String, ByVal barcodekleberdokument As Boolean) As Boolean
|
||||
Dim sqlstatement As String = "Select * from doks where dokumentid='" + sDokumentID + "'"
|
||||
If barcodekleberdokument = True Then
|
||||
Dim s As String
|
||||
s = sDokumentID
|
||||
s = s.Replace("OFFEDK", Globals.ImportPraefix)
|
||||
sqlstatement = "Select * from doks where dokumentid='" + s + "'"
|
||||
End If
|
||||
Try
|
||||
Dim Connection As New SqlConnection()
|
||||
' Dim DA As New SqlDataAdapter("select * from doks where dokumentid='" + sDokumentID + "'", Connection)
|
||||
Dim DA As New SqlDataAdapter(sqlstatement, Connection)
|
||||
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
||||
Dim ds As New DataSet()
|
||||
Dim fs As New FileStream(sDokumentName, FileMode.Open, FileAccess.Read)
|
||||
Dim mydata(fs.Length) As Byte
|
||||
Try
|
||||
fs.Read(mydata, 0, fs.Length)
|
||||
fs.Close()
|
||||
Connection.ConnectionString = Globals.sConnectionString_edoka
|
||||
Connection.Open()
|
||||
DA.Fill(ds, "docs")
|
||||
Dim myRow As DataRow
|
||||
If ds.Tables(0).Rows.Count = 0 Then
|
||||
' Neues Dokument speichern
|
||||
myRow = ds.Tables(0).NewRow
|
||||
myRow.Item(0) = sDokumentID
|
||||
myRow.Item(1) = mydata
|
||||
ds.Tables(0).Rows.Add(myRow)
|
||||
DA.Update(ds, "docs")
|
||||
Else
|
||||
'Bestehendes Dokument sichenr
|
||||
myRow = ds.Tables(0).Rows(0)
|
||||
myRow.Item(1) = mydata
|
||||
DA.Update(ds, "docs")
|
||||
End If
|
||||
If Params.DeleteOriginalfiles = 1 Then
|
||||
Try
|
||||
File.SetAttributes(sDokumentName, FileAttributes.Normal)
|
||||
Catch
|
||||
End Try
|
||||
Try
|
||||
File.Delete(sDokumentName)
|
||||
Catch ex As Exception
|
||||
PrintOut("clsDivFnkt.Save_To_DB().2" + ex.Message, EventLogEntryType.Error)
|
||||
End Try
|
||||
End If
|
||||
Catch ex As Exception
|
||||
PrintOut("clsDivFnkt.Save_To_DB().0" + ex.Message, EventLogEntryType.Error)
|
||||
Return False
|
||||
End Try
|
||||
fs = Nothing
|
||||
cb = Nothing
|
||||
ds = Nothing
|
||||
DA = Nothing
|
||||
|
||||
Connection.Close()
|
||||
Connection = Nothing
|
||||
Return True
|
||||
Catch EX As Exception
|
||||
PrintOut("clsDivFnkt.Save_To_DB().1" + ex.Message, EventLogEntryType.Error)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'canon
|
||||
Public Function Save_blscan_To_DB(ByVal nreintrag As Integer, sdokumentname As String) As Boolean
|
||||
Dim sqlstatement As String = "Select * from bl_scan where nreintrag=" + nreintrag.ToString
|
||||
|
||||
Try
|
||||
Dim Connection As New SqlConnection()
|
||||
' Dim DA As New SqlDataAdapter("select * from doks where dokumentid='" + sDokumentID + "'", Connection)
|
||||
Dim DA As New SqlDataAdapter(sqlstatement, Connection)
|
||||
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
||||
Dim ds As New DataSet()
|
||||
Dim fs As New FileStream(sdokumentname, FileMode.Open, FileAccess.Read)
|
||||
Dim mydata(fs.Length) As Byte
|
||||
Try
|
||||
fs.Read(mydata, 0, fs.Length)
|
||||
fs.Close()
|
||||
Connection.ConnectionString = Globals.sConnectionString_edoka
|
||||
Connection.Open()
|
||||
DA.Fill(ds, "docs")
|
||||
Dim myRow As DataRow
|
||||
If ds.Tables(0).Rows.Count = 0 Then
|
||||
' Neues Dokument speichern
|
||||
myRow = ds.Tables(0).NewRow
|
||||
myRow.Item(0) = DokumentID
|
||||
myRow.Item(22) = mydata
|
||||
ds.Tables(0).Rows.Add(myRow)
|
||||
DA.Update(ds, "docs")
|
||||
Else
|
||||
'Bestehendes Dokument sichenr
|
||||
myRow = ds.Tables(0).Rows(0)
|
||||
myRow.Item(22) = mydata
|
||||
DA.Update(ds, "docs")
|
||||
End If
|
||||
If Params.DeleteOriginalfiles = 1 Then
|
||||
Try
|
||||
File.SetAttributes(sdokumentname, FileAttributes.Normal)
|
||||
Catch
|
||||
End Try
|
||||
Try
|
||||
File.Delete(sdokumentname)
|
||||
Catch ex As Exception
|
||||
Printout("clsDivFnkt.Save_blscan_To_DB().2" + ex.Message, EventLogEntryType.Error)
|
||||
End Try
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Printout("clsDivFnkt.Save_blscan_To_DB().0" + ex.Message, EventLogEntryType.Error)
|
||||
Return False
|
||||
End Try
|
||||
fs = Nothing
|
||||
cb = Nothing
|
||||
ds = Nothing
|
||||
DA = Nothing
|
||||
|
||||
Connection.Close()
|
||||
Connection = Nothing
|
||||
Return True
|
||||
Catch EX As Exception
|
||||
Printout("clsDivFnkt.Save_blscan_To_DB().1" + EX.Message, EventLogEntryType.Error)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Save_Indexdata(ByVal jobid As Integer, ByVal datei As String) As Boolean
|
||||
Dim sqlstatement As String = "Select * from import_job where import_jobnr = " + LTrim(Str(jobid))
|
||||
Dim Connection As New SqlConnection()
|
||||
Dim DA As New SqlDataAdapter("Select * from import_job where import_jobnr = " + LTrim(Str(jobid)), Connection)
|
||||
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
||||
Dim ds As New DataSet()
|
||||
Dim fs As New FileStream(datei, FileMode.Open, FileAccess.Read)
|
||||
Dim mydata(fs.Length) As Byte
|
||||
Try
|
||||
fs.Read(mydata, 0, fs.Length)
|
||||
fs.Close()
|
||||
Connection.ConnectionString = Globals.sConnectionString_journale
|
||||
Connection.Open()
|
||||
DA.Fill(ds, "docs")
|
||||
Dim myRow As DataRow
|
||||
'Bestehendes Dokument sichenr
|
||||
myRow = ds.Tables(0).Rows(0)
|
||||
myRow.Item(7) = mydata
|
||||
DA.Update(ds, "docs")
|
||||
Catch ex As Exception
|
||||
PrintOut("clsDivFnkt.Save_Indexdata()" + ex.Message, EventLogEntryType.Error)
|
||||
Return False
|
||||
Finally
|
||||
fs = Nothing
|
||||
cb = Nothing
|
||||
ds = Nothing
|
||||
DA = Nothing
|
||||
|
||||
Connection.Close()
|
||||
Connection = Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Public Function ApplicationPath() As String
|
||||
'Return Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
|
||||
Return Path.GetDirectoryName([Assembly].GetEntryAssembly().Location) + "\"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
373
edkb08/clsIndexData.vb
Normal file
373
edkb08/clsIndexData.vb
Normal file
@@ -0,0 +1,373 @@
|
||||
Imports System.IO
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
|
||||
'''<summary>Funktionen für d4as Einlesen der Indexdaten aus einer XML- oder
|
||||
'''Textdatei</summary>
|
||||
'''<remarks>Die Funktion liest je nach Inhalt der Inputdatei (Indexfilename) als
|
||||
'''XML oder als TXT (Komma-getrennt) die Indexwerte aus der Datei und liefert
|
||||
'''diese im Property IndexData zurück.</remarks>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Public Class clsIndexData
|
||||
|
||||
#Region "Deklarationen"
|
||||
|
||||
'''<summary>Interne Variable für IndexFilenName</summary>
|
||||
Dim m_indexfilename As String
|
||||
'''<summary>Enthält der Name der Inputdatei mit den Indexdaten (XML oder
|
||||
'''TXT)</summary>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Property IndexFileName() As String
|
||||
Get
|
||||
Return m_indexfilename
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_indexfilename = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für IndexData</summary>
|
||||
Dim m_Indexdata As DataTable
|
||||
'''<summary>Datentabelle mit den geladenen Indexwerten</summary>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Property Indexdata() As DataTable
|
||||
Get
|
||||
Return m_Indexdata
|
||||
End Get
|
||||
Set(ByVal Value As DataTable)
|
||||
m_Indexdata = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Temporäre Collection mit den getrennten Indexdaten aus der
|
||||
'''txt-Input-Datei</summary>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Dim Splitline As Collection
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
'''<summary>Angelieferte Indexdaten auslesen und in die Datentabele Indexdata
|
||||
'''speichern. Abhängig vom angelieferten Format, XML-Datei einlesen oder
|
||||
'''Komma-getrennte Textdatei auslesen</summary>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Public Function getindexdata() As Boolean
|
||||
Index_Datei_Sichern(Me.IndexFileName)
|
||||
Try
|
||||
Dim s As String = ""
|
||||
FileOpen(1, Me.IndexFileName, OpenMode.Input)
|
||||
Input(1, s)
|
||||
FileClose(1)
|
||||
If UCase(Microsoft.VisualBasic.Left(s, 5)) = "<?XML" Or UCase(s.Substring(3, 5)) = "<?XML" Then
|
||||
'XML-Datenstrom verarbeiten
|
||||
xmlinput()
|
||||
Return True
|
||||
Else
|
||||
'Komma-Delimited-Datenstrom verarbeiten
|
||||
Datentabelle_Erstellen()
|
||||
Dim tr As TextReader
|
||||
Dim hasdata As Boolean = True
|
||||
tr = File.OpenText(Me.IndexFileName)
|
||||
Try
|
||||
While hasdata
|
||||
s = tr.ReadLine
|
||||
If s = "" Or s = Nothing Then
|
||||
tr.Close()
|
||||
FileSystem.Rename(Me.IndexFileName, Me.IndexFileName + "." + Format(Now, "yyyyMMddHHmmss"))
|
||||
If Me.Indexdata.Rows.Count > 0 Then Return True
|
||||
Exit Function
|
||||
End If
|
||||
Indexwerte_Einlesen(s)
|
||||
End While
|
||||
Catch
|
||||
tr.Close()
|
||||
Return False
|
||||
End Try
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Journal.Insert_Journal("", "", "", "", 16, "Fehler beim Öffnen der Inputdatei " + Me.IndexFileName, "", "")
|
||||
Finally
|
||||
Try
|
||||
FileClose(1)
|
||||
Catch
|
||||
End Try
|
||||
If Params.DeleteOriginalfiles = 0 Then
|
||||
FileSystem.Rename(Me.IndexFileName, Me.IndexFileName + "." + Format(Now, "yyyyMMddHHmmss"))
|
||||
Else
|
||||
Try
|
||||
File.SetAttributes(Me.IndexFileName, FileAttributes.Normal)
|
||||
Catch
|
||||
End Try
|
||||
Try
|
||||
File.Move(Me.IndexFileName, Params.sikind + Now.ToString("yyyyMMddHHmmss") + "_" + Path.GetFileName(Me.IndexFileName))
|
||||
'File.Delete(Me.IndexFileName)
|
||||
Catch
|
||||
End Try
|
||||
End If
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub Index_Datei_Sichern(ByVal filename As String)
|
||||
Try
|
||||
Dim sqlstatement As String = "Select * from Import_Job where Import_JobNr = " + LTrim(Str(Journal.JournalNr))
|
||||
Dim Connection As New SqlConnection()
|
||||
Dim DA As New SqlDataAdapter(sqlstatement, Globals.sConnectionString_journale)
|
||||
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
||||
|
||||
Dim dsDATEN As New DataSet()
|
||||
Dim fs As New FileStream(filename, FileMode.Open, FileAccess.Read)
|
||||
Dim mydata(fs.Length) As Byte
|
||||
Try
|
||||
fs.Read(mydata, 0, fs.Length)
|
||||
fs.Close()
|
||||
Connection.ConnectionString = Globals.sConnectionString_journale
|
||||
Connection.Open()
|
||||
DA.Fill(dsDATEN, "docs")
|
||||
Dim myRow As DataRow
|
||||
myRow = dsDATEN.Tables(0).Rows(0)
|
||||
myRow.Item(7) = mydata
|
||||
DA.Update(dsDATEN, "docs")
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
fs = Nothing
|
||||
cb = Nothing
|
||||
dsDATEN = Nothing
|
||||
DA = Nothing
|
||||
Connection.Close()
|
||||
Connection = Nothing
|
||||
Catch
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Private Sub map_iris_struktur(ByRef idxds As DataSet)
|
||||
Dim tmpds As New DataSet
|
||||
tmpds.ReadXml(System.AppDomain.CurrentDomain.BaseDirectory + "\canonstruktur.xml")
|
||||
Dim dr As DataRow = tmpds.Tables(0).NewRow
|
||||
For Each col As DataColumn In tmpds.Tables(0).Columns
|
||||
dr.Item(col.ColumnName) = ""
|
||||
Next
|
||||
For Each col As DataColumn In idxds.Tables(0).Columns
|
||||
dr.Item(col.ColumnName) = idxds.Tables(0).Rows(0).Item(col.ColumnName)
|
||||
|
||||
Next
|
||||
tmpds.Tables(0).Rows.Clear()
|
||||
tmpds.Tables(0).Rows.Add(dr)
|
||||
idxds.Tables.Clear()
|
||||
|
||||
idxds.Tables.Add(tmpds.Tables(0).Copy)
|
||||
tmpds.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub map_iris_LSV(ByRef idxds As DataSet)
|
||||
|
||||
Dim tmpds As New DataSet
|
||||
tmpds.ReadXml(System.AppDomain.CurrentDomain.BaseDirectory + "\edkb08struktur.xml")
|
||||
tmpds.Tables(0).Columns.Add("DOKUMENTWERT21")
|
||||
tmpds.Tables(0).Columns.Add("DOKUMENTWERT22")
|
||||
tmpds.Tables(0).Columns.Add("DOKUMENTWERT23")
|
||||
tmpds.Tables(0).Columns.Add("DOKUMENTWERT24")
|
||||
tmpds.Tables(0).Columns.Add("DOKUMENTWERT25")
|
||||
tmpds.Tables(0).Columns.Add("Stapelkennung")
|
||||
|
||||
Dim dr As DataRow = tmpds.Tables(0).NewRow
|
||||
For Each col As DataColumn In tmpds.Tables(0).Columns
|
||||
dr.Item(col.ColumnName) = ""
|
||||
Next
|
||||
|
||||
For Each col As DataColumn In idxds.Tables(0).Columns
|
||||
Try
|
||||
dr.Item(col.ColumnName) = idxds.Tables(0).Rows(0).Item(col.ColumnName)
|
||||
Catch
|
||||
End Try
|
||||
Next
|
||||
|
||||
dr.Item("ersteller") = idxds.Tables(0).Rows(0).Item("Benutzer")
|
||||
'dr.Item("DOKUMENTTYPNR") = idxds.Tables(0).Rows(0).Item("Dokumenttyp")
|
||||
'//dr.Item("DOKUMENTWERT1") = "Scandatum;" + idxds.Tables(0).Rows(0).Item("Scandatum")
|
||||
'dr.Item("DOKUMENTWERT2") = "Paginatornummer;" + idxds.Tables(0).Rows(0).Item("Paginatornummer")
|
||||
'dr.Item("DOKUMENTWERT3") = "Status;" + idxds.Tables(0).Rows(0).Item("Status")
|
||||
'dr.Item("DOKUMENTWERT4") = "IBAN;" + idxds.Tables(0).Rows(0).Item("IBAN")
|
||||
|
||||
|
||||
For i As Integer = 11 To 33
|
||||
dr.Item("DOKUMENTWERT" + (i - 10).ToString) = idxds.Tables(0).Columns(i).ColumnName + ";" + idxds.Tables(0).Rows(0).Item(i).ToString
|
||||
Next
|
||||
|
||||
|
||||
|
||||
tmpds.Tables(0).Rows.Clear()
|
||||
tmpds.Tables(0).Rows.Add(dr)
|
||||
idxds.Tables.Clear()
|
||||
|
||||
|
||||
idxds.Tables.Add(tmpds.Tables(0).Copy)
|
||||
tmpds.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Function parsexml(ByVal istr As String) As String
|
||||
istr = istr.Replace("&", "&")
|
||||
Return istr
|
||||
End Function
|
||||
|
||||
'''<summary>XML-Datei als Datatable einlesen</summary>
|
||||
'''<author>Stefan Hutter</author>
|
||||
'''
|
||||
Private Sub xmlinput()
|
||||
Try
|
||||
|
||||
|
||||
Dim idxds As New DataSet()
|
||||
Try
|
||||
idxds.ReadXml(Me.IndexFileName)
|
||||
Catch
|
||||
FileOpen(21, Me.IndexFileName, OpenMode.Input)
|
||||
FileOpen(22, Me.IndexFileName + ".tmp", OpenMode.Output)
|
||||
Dim il As String
|
||||
Dim ol As String
|
||||
While Not EOF(21)
|
||||
Input(21, il)
|
||||
|
||||
ol = parsexml(il)
|
||||
PrintLine(22, ol)
|
||||
End While
|
||||
FileClose(21)
|
||||
FileClose(22)
|
||||
File.Delete(Me.IndexFileName)
|
||||
Rename(Me.IndexFileName + ".tmp", Me.IndexFileName)
|
||||
idxds.ReadXml(Me.IndexFileName)
|
||||
End Try
|
||||
|
||||
|
||||
Try
|
||||
If Globals.Canon_Herkunft(idxds.Tables(0).Rows(0).Item("Herkunftsapplikation")) Then
|
||||
'20210816 - LSV
|
||||
If idxds.Tables(0).Rows(0).Item("Herkunftsapplikation") = "IRIS_FORMS_LSV" Then
|
||||
map_iris_LSV(idxds)
|
||||
Else
|
||||
|
||||
map_iris_struktur(idxds)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try 'canon-Mapping'
|
||||
'Anpassungen EBES_LSV
|
||||
Dim i As Integer
|
||||
For i = 0 To idxds.Tables.Count - 1
|
||||
'-- Canon von >20 auf > 5 geändert
|
||||
If idxds.Tables(i).Columns.Count > 20 Then
|
||||
Me.Indexdata = idxds.Tables(i)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' Me.Indexdata = idxds.Tables(0)
|
||||
Catch ex As Exception
|
||||
Journal.Insert_Journal("", "", "", Me.IndexFileName, 16, "Fehler beim einlesen der XML-Datei: " + ex.Message, "", "")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'''<summary>Datentabelle "Indexdata" erstellen, damit die Komma-Getrennten
|
||||
'''Datensätze eingelesen und zugewiesen werden können</summary>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Private Sub Datentabelle_Erstellen()
|
||||
Try
|
||||
Dim idxds As New DataSet()
|
||||
idxds.ReadXml(DivFnkt.ApplicationPath + "TabStruktur_Delimited_Import.xml")
|
||||
Me.Indexdata = idxds.Tables(0)
|
||||
Me.Indexdata.Rows(0).Delete()
|
||||
Catch ex As Exception
|
||||
Journal.Insert_Journal("", "", "", "", 16, "Fehler beim Erstellen der Initialiseriungstabelle mit der XML-Struktur" + ex.Message, "", "")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'''<summary>Einzele Indexwerte aus dem Inputfile auslesen und als Datensatz in der
|
||||
'''Tabelle "Indexdata" speichern</summary>
|
||||
'''<param name="s">Zeile der Inputdatei (Komma-getrennte Werte)</param>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Private Sub Indexwerte_Einlesen(ByVal s As String)
|
||||
Splitline = SplitDelimitedLine(s, ",", """")
|
||||
Insert_Into_DB(Splitline)
|
||||
End Sub
|
||||
|
||||
'''<summary>Datensatz in der Tabelle "Indexdata" einfügen. Die Anzahl der
|
||||
'''Spalten in der Tabelle ist abhängig vom Default-XML, welches zur
|
||||
'''Tabellenerstellung verwendet wird.</summary>
|
||||
'''<param name="data"></param>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Private Sub Insert_Into_DB(ByVal data As Collection)
|
||||
Dim i As Integer
|
||||
Try
|
||||
Dim datacolumns As Integer = Me.Indexdata.Columns.Count
|
||||
Dim RowVals(datacolumns - 1) As Object
|
||||
|
||||
For i = 0 To datacolumns - 1
|
||||
RowVals(i) = ""
|
||||
Next
|
||||
For i = 1 To data.Count
|
||||
RowVals(i - 1) = data.Item(i)
|
||||
Next
|
||||
Me.Indexdata.Rows.Add(RowVals)
|
||||
Catch ex As Exception
|
||||
Journal.Insert_Journal("", "", "", "", 16, "Fehler beim Einlesen der Indexdaten: RecordNr:" + Str(i) + ": " + ex.Message, "", "")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'''<summary>Splitfunktion</summary>
|
||||
'''<param name="CurrentLine">Input-Zeile</param>
|
||||
'''<param name="Delimiter">Trennzeichen der einzelnen werte (z.B. Komma,
|
||||
'''Strichpunkt usw.)</param>
|
||||
'''<param name="Qualifier">Qualiflyer, welcher die Werte umschliesst (z.B.
|
||||
'''")</param>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Private Function SplitDelimitedLine(ByVal CurrentLine As String, ByVal Delimiter As String, ByVal Qualifier As String) As Collection
|
||||
Try
|
||||
Dim i As Integer
|
||||
Dim SplitString As New Collection()
|
||||
Dim CountDelimiter As Boolean
|
||||
Dim Total As Integer
|
||||
Dim Ch As Char
|
||||
Dim Section As String
|
||||
CountDelimiter = True
|
||||
Total = 0
|
||||
Section = ""
|
||||
For i = 1 To Len(CurrentLine)
|
||||
Ch = Mid(CurrentLine, i, 1)
|
||||
Select Case Ch
|
||||
Case Qualifier
|
||||
If CountDelimiter Then
|
||||
CountDelimiter = False
|
||||
Else
|
||||
CountDelimiter = True
|
||||
End If
|
||||
|
||||
Case Delimiter
|
||||
If CountDelimiter Then
|
||||
'SplitString.Add(New MySection(Section))
|
||||
SplitString.Add(Section)
|
||||
Section = ""
|
||||
Total = Total + 1
|
||||
End If
|
||||
Case Else
|
||||
Section = Section & Ch
|
||||
End Select
|
||||
Next
|
||||
If CountDelimiter Then
|
||||
'SplitString.Add(New MySection(Section))
|
||||
SplitString.Add(Section)
|
||||
End If
|
||||
SplitDelimitedLine = SplitString
|
||||
Catch ex As Exception
|
||||
Journal.Insert_Journal("", "", "", "", 16, "Fehler beim Einlesen der Indexdaten: " + ex.Message, "", "")
|
||||
Dim SplitString As New Collection()
|
||||
SplitDelimitedLine = SplitString
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
335
edkb08/clsParameter.vb
Normal file
335
edkb08/clsParameter.vb
Normal file
@@ -0,0 +1,335 @@
|
||||
Imports System.IO
|
||||
|
||||
'''<summary>Klasse zum auselesen der Steuerparameter aus der Datei
|
||||
'''\bin\parameters.cfg</summary>
|
||||
'''<author>Stefan Hutter</author>
|
||||
Public Class ClsParameters
|
||||
|
||||
#Region "Deklarationen"
|
||||
|
||||
'''<summary>Interne Variable zum Auslesen der Datei</summary>
|
||||
Dim ofile As System.IO.File
|
||||
'''<summary>Interne Variable zum Auslesen der Datei</summary>
|
||||
Dim oread As System.IO.StreamReader
|
||||
|
||||
'''<summary>Interne Variable für das Property Application ID</summary>
|
||||
Dim m_applicationid As String
|
||||
'''<summary>ApplikationsID für die Journalisierung</summary>
|
||||
Property ApplicationID() As String
|
||||
Get
|
||||
Return m_applicationid
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_applicationid = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property Inputverzeichnis</summary>
|
||||
Dim m_Inputverzeichnis As String
|
||||
'''<summary>Inputverzeichnis, in welchem die Dokumente und Indexdateien gespeichert
|
||||
'''sind</summary>
|
||||
Property Inputverzeichnis() As String
|
||||
Get
|
||||
Return m_Inputverzeichnis
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_Inputverzeichnis = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property MailadresseOK</summary>
|
||||
Dim m_MailadresseOK As String
|
||||
'''<summary>EMail-Adresse, an die ein Mail gesendet wird, sofern die Verarbeitung
|
||||
'''ordnungsgemäss durchgelaufen ist</summary>
|
||||
Property MailAdresseOK() As String
|
||||
Get
|
||||
Return m_MailadresseOK
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_MailadresseOK = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property MailadresseNOK</summary>
|
||||
Dim m_MailadresseNOK As String
|
||||
'''<summary>Mailadresse, an die im Fehlerfall ein Mail gesendet wird</summary>
|
||||
Property MailAdresseNOK() As String
|
||||
Get
|
||||
Return m_MailadresseNOK
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_MailadresseNOK = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property Meldung</summary>
|
||||
Dim m_meldung As String
|
||||
'''<summary>Allfälliger Meldungstext, welcher beim Laden der Parameter generiert
|
||||
'''wird</summary>
|
||||
Property Meldung() As String
|
||||
Get
|
||||
Return m_meldung
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_meldung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property Temppfad</summary>
|
||||
Dim m_temppfad As String
|
||||
'''<summary>Pfad für temporäre Dateien</summary>
|
||||
Property TempPfad() As String
|
||||
Get
|
||||
Return m_temppfad
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_temppfad = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property Mailserver</summary>
|
||||
Dim m_mailserver As String
|
||||
'''<summary>SMTP-Mailserver für den Journalversand</summary>
|
||||
Property Mailserver() As String
|
||||
Get
|
||||
Return m_mailserver
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_mailserver = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_mailabsender As String
|
||||
Property Mailabsender() As String
|
||||
Get
|
||||
Return m_mailabsender
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_mailabsender = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property Journaltimer_time</summary>
|
||||
Dim m_journaltimer_time As Integer = 60 * 60 * 1000
|
||||
'''<summary>Journaltimer-Zeit in Milisekunden</summary>
|
||||
Property JournalTimer_Time() As Integer
|
||||
Get
|
||||
Return m_journaltimer_time
|
||||
End Get
|
||||
Set(ByVal Value As Integer)
|
||||
m_journaltimer_time = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property DeleteOriginalfiles</summary>
|
||||
Dim m_deleteoriginalfiles As Integer = 0
|
||||
'''<summary>DeleteOriginalfiles</summary>
|
||||
Property DeleteOriginalfiles() As Integer
|
||||
Get
|
||||
Return m_deleteoriginalfiles
|
||||
End Get
|
||||
Set(ByVal Value As Integer)
|
||||
m_deleteoriginalfiles = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property GSF Config File Path</summary>
|
||||
Dim m_gsf_ConfigPath As String
|
||||
'''<summary>gsf ConfigPath</summary>
|
||||
Property Prop_gsf_ConfigPath() As String
|
||||
Get
|
||||
Return m_gsf_ConfigPath
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_gsf_ConfigPath = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property GSF Timer Intervall</summary>
|
||||
Dim m_gsf_TimerInterval As Integer = 0
|
||||
'''<summary>gsf Timer Interval</summary>
|
||||
Property Prop_gsf_TimerInterval() As Integer
|
||||
Get
|
||||
Return m_gsf_TimerInterval
|
||||
End Get
|
||||
Set(ByVal Value As Integer)
|
||||
m_gsf_TimerInterval = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>Interne Variable für das Property GSF DateiEndung</summary>
|
||||
Dim m_gsf_ConfigDateiendung As String
|
||||
'''<summary>gsf DateiEndung</summary>
|
||||
Property Prop_gsf_ConfigDateiendung() As String
|
||||
Get
|
||||
Return m_gsf_ConfigDateiendung
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_gsf_ConfigDateiendung = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_directorytimer_intervall As Integer
|
||||
Property DirectoryTimer_Intervall As Integer
|
||||
Get
|
||||
Return m_directorytimer_intervall
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_directorytimer_intervall = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_directoryscanner As String
|
||||
Property Directoryscanner As String
|
||||
Get
|
||||
Return m_directoryscanner
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_directoryscanner = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_sikind As String
|
||||
Property sikind As String
|
||||
Get
|
||||
Return m_sikind
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sikind = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_logpath As String = ""
|
||||
Property Logpath As String
|
||||
Get
|
||||
Return m_logpath
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_logpath = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_useFileEventRename As Boolean = False
|
||||
Property UseFileEventRename As Boolean
|
||||
Get
|
||||
Return m_useFileEventRename
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_useFileEventRename = value = "True"
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_waitafterfileevent As Integer
|
||||
Property WaitAfterFileevent As Integer
|
||||
Get
|
||||
Return m_waitafterfileevent
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_waitafterfileevent = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_waitbeforeprocess As Integer
|
||||
Property WaitBeforeProcess As Integer
|
||||
Get
|
||||
Return m_waitbeforeprocess
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_waitbeforeprocess = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Wait_before_xmlind_ren As Int16
|
||||
Property Wait_before_xmlind_ren As Integer
|
||||
Get
|
||||
Return m_Wait_before_xmlind_ren
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_Wait_before_xmlind_ren = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Wait_before_readdir As Integer
|
||||
Property Wait_before_readdir As Integer
|
||||
Get
|
||||
Return m_Wait_before_readdir
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_Wait_before_readdir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_wait_before_fileproc As Integer
|
||||
Property Wait_Before_Fileprocess As Integer
|
||||
Get
|
||||
Return m_wait_before_fileproc
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_wait_before_fileproc = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_wait_afger_fileproc As Integer
|
||||
Property wait_After_Fileprocess As Integer
|
||||
Get
|
||||
Return m_wait_afger_fileproc
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_wait_afger_fileproc = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
'''<summary>Laden der Parameterdaten aus parameters.cfg</summary>
|
||||
'''<remarks>Die Funktion lädt für die Anwendung die notwendigen Parameter aus der
|
||||
'''Datei "Parameters.cfg"</remarks>
|
||||
'''<returns>True im OK-Fall
|
||||
'''False im Fehlerfall</returns>
|
||||
Public Function Loadparameters() As Boolean
|
||||
Try
|
||||
oread = System.IO.File.OpenText(DivFnkt.ApplicationPath + "parameters.cfg")
|
||||
'oread = ofile.OpenText(args(1) + "parameters.cfg")
|
||||
Me.ApplicationID = ParamValue(oread.ReadLine)
|
||||
Me.Inputverzeichnis = ParamValue(oread.ReadLine)
|
||||
If Right(Me.Inputverzeichnis, 1) <> "\" Then Me.Inputverzeichnis = Me.Inputverzeichnis + "\"
|
||||
Me.TempPfad = ParamValue(oread.ReadLine)
|
||||
Me.JournalTimer_Time = ParamValue(oread.ReadLine) * 60 * 1000
|
||||
Me.Mailabsender = ParamValue(oread.ReadLine)
|
||||
Me.Mailserver = ParamValue(oread.ReadLine)
|
||||
Me.DeleteOriginalfiles = ParamValue(oread.ReadLine)
|
||||
Me.MailAdresseOK = ParamValue(oread.ReadLine)
|
||||
Me.MailAdresseNOK = ParamValue(oread.ReadLine)
|
||||
Me.Prop_gsf_ConfigPath = ParamValue(oread.ReadLine)
|
||||
Me.Prop_gsf_TimerInterval = ParamValue(oread.ReadLine) * 60 * 1000
|
||||
Me.Prop_gsf_ConfigDateiendung = ParamValue(oread.ReadLine)
|
||||
Me.DirectoryTimer_Intervall = ParamValue(oread.ReadLine) * 60 * 1000
|
||||
Me.Directoryscanner = ParamValue(oread.ReadLine)
|
||||
Me.sikind = ParamValue(oread.ReadLine)
|
||||
Me.Logpath = ParamValue(oread.ReadLine)
|
||||
Me.UseFileEventRename = ParamValue(oread.ReadLine)
|
||||
Me.WaitAfterFileevent = ParamValue(oread.ReadLine)
|
||||
Me.WaitBeforeProcess = ParamValue(oread.ReadLine)
|
||||
Me.Wait_before_xmlind_ren = ParamValue(oread.ReadLine)
|
||||
Me.Wait_Before_Fileprocess = ParamValue(oread.ReadLine)
|
||||
Me.wait_After_Fileprocess = ParamValue(oread.ReadLine)
|
||||
oread.Close()
|
||||
Me.Meldung = "Parameter auslesen i.O."
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Me.Meldung = ex.Message
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
'''<summary>Parameterbezeichnung und Parameterwert trennen</summary>
|
||||
'''<param name="sinput">Inputstring mit Parameterbezeichnung und
|
||||
'''Parameterwert</param>
|
||||
'''<returns>Parameterwert als String</returns>
|
||||
Private Function ParamValue(ByVal sinput As String) As String
|
||||
Dim splitter As String()
|
||||
splitter = Split(sinput, "=")
|
||||
ParamValue = splitter(1)
|
||||
End Function
|
||||
End Class
|
||||
3
edkb08/log_report/Class1.vb
Normal file
3
edkb08/log_report/Class1.vb
Normal file
@@ -0,0 +1,3 @@
|
||||
Public Class Class1
|
||||
|
||||
End Class
|
||||
15
edkb08/log_report/Dataset1.xsd.bak
Normal file
15
edkb08/log_report/Dataset1.xsd.bak
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<xs:schema id="Dataset1"
|
||||
targetNamespace="http://tempuri.org/Dataset1.xsd"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="qualified"
|
||||
xmlns="http://tempuri.org/Dataset1.xsd"
|
||||
xmlns:mstns="http://tempuri.org/Dataset1.xsd"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xs:element name="Dataset1" msdata:IsDataSet="true">
|
||||
<xs:complexType>
|
||||
<xs:choice maxOccurs="unbounded"></xs:choice>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
164
edkb08/log_report/Export.vb
Normal file
164
edkb08/log_report/Export.vb
Normal file
@@ -0,0 +1,164 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports System.Xml
|
||||
Imports System.Xml.Xsl
|
||||
Imports System.Threading
|
||||
'Imports CrystalDecisions.CrystalReports.Engine
|
||||
'Imports CrystalDecisions.Shared
|
||||
|
||||
'''<summary>Funktionen für den Export der Journaldaten</summary>
|
||||
Public Class Export
|
||||
|
||||
Dim filename As String
|
||||
'''<summary>Auswertung erstellen und ggf. mittels DTO versenden</summary>
|
||||
'''<param name="dt">Datentabelle mit den Auswertungsdaten der Applikation</param>
|
||||
'''<param name="format">Format der Auswertung (txt, csv, xls, doc, pdf,
|
||||
'''xml)</param>
|
||||
Public Function Create_Report(ByVal dt As DataTable, ByVal format As String, ByVal Applikation As String) As String
|
||||
Try
|
||||
filename = Params.TempPfad + Applikation + "_" + Microsoft.VisualBasic.Format(Now, "yyyyMMddHHmmss") + "_EDKB08_Log"
|
||||
Select Case UCase(format)
|
||||
Case "PDF"
|
||||
filename = filename + ".pdf"
|
||||
'CR_Report(dt, format) 20140204 MNK Ausbau CrystalReport Funktion
|
||||
Case "XLS"
|
||||
filename = filename + ".xls"
|
||||
'CR_Report(dt, format) 20140204 MNK Ausbau CrystalReport Funktion
|
||||
Case "DOC"
|
||||
filename = filename + ".doc"
|
||||
'CR_Report(dt, format) 20140204 MNK Ausbau CrystalReport Funktion
|
||||
Case "CSV"
|
||||
filename = filename + ".csv"
|
||||
Extract_CSV(dt)
|
||||
Case "TXT"
|
||||
filename = filename + ".txt"
|
||||
Extract_TXT(dt)
|
||||
Case "XML"
|
||||
filename = filename + ".xml"
|
||||
Dim ds As New DataSet()
|
||||
ds.Tables.Add(dt.Copy)
|
||||
ds.WriteXml(filename)
|
||||
ds.Dispose()
|
||||
End Select
|
||||
Return filename
|
||||
Catch ex As Exception
|
||||
PrintOut("Fehler Crystal:" + ex.Message, EventLogEntryType.Error)
|
||||
Return ""
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
'''<summary>Journaldatei als CSV-Datei erstellen</summary>
|
||||
'''<param name="dt">Journaldaten</param>
|
||||
Private Sub Extract_CSV(ByVal dt As DataTable)
|
||||
Dim s As String
|
||||
Dim i As Integer
|
||||
Dim c As Integer
|
||||
|
||||
Dim tw As TextWriter
|
||||
tw = New StreamWriter(New FileStream(filename, FileMode.Create))
|
||||
s = ""
|
||||
For i = 0 To dt.Columns.Count - 1
|
||||
s = s + dt.Columns(i).ColumnName + ";"
|
||||
Next
|
||||
tw.WriteLine(s)
|
||||
s = ""
|
||||
For i = 0 To dt.Rows.Count - 1
|
||||
For c = 0 To dt.Columns.Count - 1
|
||||
Try
|
||||
s = s + CType(dt.Rows(i).Item(c), String) + ";"
|
||||
Catch
|
||||
s = s + ""
|
||||
End Try
|
||||
Next
|
||||
tw.WriteLine(s)
|
||||
s = ""
|
||||
Next
|
||||
tw.Flush()
|
||||
tw.Close()
|
||||
End Sub
|
||||
|
||||
'''<summary>Journaldatei als TXT-Datei erstellen</summary>
|
||||
'''<param name="dt">Journaldaten</param>
|
||||
Private Sub Extract_TXT(ByVal dt As DataTable)
|
||||
Dim s As String
|
||||
Dim i As Integer
|
||||
Dim c As Integer
|
||||
|
||||
Dim tw As TextWriter
|
||||
tw = New StreamWriter(New FileStream(filename, FileMode.Create))
|
||||
s = ""
|
||||
For i = 0 To dt.Columns.Count - 1
|
||||
s = s + """" + dt.Columns(i).ColumnName + """" + ";"
|
||||
Next
|
||||
tw.WriteLine(s)
|
||||
s = ""
|
||||
For i = 0 To dt.Rows.Count - 1
|
||||
For c = 0 To dt.Columns.Count - 1
|
||||
Try
|
||||
s = s + """" + CType(dt.Rows(i).Item(c), String) + """" + ";"
|
||||
Catch
|
||||
s = s + ""
|
||||
End Try
|
||||
Next
|
||||
tw.WriteLine(s)
|
||||
s = ""
|
||||
Next
|
||||
tw.Flush()
|
||||
tw.Close()
|
||||
End Sub
|
||||
|
||||
'''<summary>Crystal-Report-Druck</summary>
|
||||
'''<param name="dt">Datentabelle, welche an Crystal zum Druck übergeben
|
||||
'''wird</param>
|
||||
'''<param name="format">Zu Exportierendes Format (XLS, DOC, PDF)</param>
|
||||
' Private Sub CR_Report(ByVal dt As DataTable, ByVal format As String)
|
||||
' Try
|
||||
' Dim CrystalReportDocument As ReportDocument
|
||||
' Dim CrystalExportOptions As ExportOptions
|
||||
' Dim CrystalDiskFileDestinationOptions As DiskFileDestinationOptions
|
||||
' Dim ds As New DataSet()
|
||||
' ds.Tables.Add(dt.Copy)
|
||||
|
||||
' CrystalReportDocument = New ReportDocument()
|
||||
' CrystalReportDocument.Load(DivFnkt.ApplicationPath + "Journal1.rpt")
|
||||
' CrystalReportDocument.SetDataSource(dt)
|
||||
|
||||
' CrystalReportDocument.SetDataSource(ds.Tables(0))
|
||||
|
||||
' CrystalDiskFileDestinationOptions = New DiskFileDestinationOptions()
|
||||
' CrystalDiskFileDestinationOptions.DiskFileName = filename
|
||||
' CrystalExportOptions = CrystalReportDocument.ExportOptions
|
||||
' With CrystalExportOptions
|
||||
' .DestinationOptions = CrystalDiskFileDestinationOptions
|
||||
' .ExportDestinationType = ExportDestinationType.DiskFile
|
||||
' Select Case UCase(format)
|
||||
' Case "PDF"
|
||||
' .ExportFormatType = ExportFormatType.PortableDocFormat
|
||||
' Case "XLS"
|
||||
' .ExportFormatType = ExportFormatType.Excel
|
||||
' Case "DOC"
|
||||
' .ExportFormatType = ExportFormatType.WordForWindows
|
||||
' End Select
|
||||
' End With
|
||||
' CrystalReportDocument.Export()
|
||||
' Try
|
||||
' 'sorry for this code (RS 2006-11-14)
|
||||
' CrystalReportDocument = Nothing
|
||||
' CrystalDiskFileDestinationOptions = Nothing
|
||||
' CrystalExportOptions = Nothing
|
||||
' Catch ex As Exception
|
||||
' PrintOut("Export.CR_Report()" + ex.Message, EventLogEntryType.Error)
|
||||
' End Try
|
||||
'Catch ex As Exception
|
||||
' PrintOut("Aufbereitung Crystal:" + ex.Message, EventLogEntryType.Error)
|
||||
' End Try
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
29
edkb08/log_report/Journal.xsd
Normal file
29
edkb08/log_report/Journal.xsd
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" standalone="yes" ?>
|
||||
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="de-CH">
|
||||
<xs:complexType>
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="Table1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="Import_JobNr" type="xs:int" minOccurs="0" />
|
||||
<xs:element name="Start_TS" type="xs:dateTime" minOccurs="0" />
|
||||
<xs:element name="Import_Eintragnr" type="xs:int" minOccurs="0" />
|
||||
<xs:element name="TS" type="xs:dateTime" minOccurs="0" />
|
||||
<xs:element name="RecordNo" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Partnernr" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Dateityp" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Dateiname" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Status" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Statustext" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="EDOKA_Dokumentid" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Journal_Ausgeliefert" type="xs:int" minOccurs="0" />
|
||||
<xs:element name="Appl" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="Indexdaten" type="xs:string" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
5
edkb08/log_report/Journal.xsx
Normal file
5
edkb08/log_report/Journal.xsx
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--Diese Datei wird automatisch vom XML-Schema-Designer generiert. Sie enthält Layoutinformationen für Komponenten auf der Designeroberfläche.-->
|
||||
<XSDDesignerLayout layoutVersion="1" viewPortLeft="0" viewPortTop="0">
|
||||
<Table1_XmlElement left="635" top="635" width="5292" height="2963" selected="0" zOrder="0" index="0" />
|
||||
</XSDDesignerLayout>
|
||||
266
edkb08/log_report/clsJournal.vb
Normal file
266
edkb08/log_report/clsJournal.vb
Normal file
@@ -0,0 +1,266 @@
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.IO
|
||||
|
||||
|
||||
'''<summary>Funktionen für die Journalisierung der einzelnen
|
||||
'''Verarbeitungsschritte</summary>
|
||||
Public Class clsJournal
|
||||
|
||||
#Region "Deklarationen"
|
||||
'''<summary>Interne Variable für das Property JournalNr</summary>
|
||||
Dim m_Journalnr As Integer
|
||||
|
||||
'''<summary>Property für die JournalNr</summary>
|
||||
Property JournalNr() As Integer
|
||||
Get
|
||||
Return m_Journalnr
|
||||
End Get
|
||||
Set(ByVal Value As Integer)
|
||||
m_Journalnr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
'''<summary>Variable für die Datenbankklasse clsImport_Job</summary>
|
||||
Dim Journal As New edokadb.clsImport_Job()
|
||||
'''<summary>Variable für die Datenbankklasse clsimport_eintrag</summary>
|
||||
Dim Journaleintrag As New edokadb.clsImport_Eintrag()
|
||||
|
||||
'''<summary>Interne Variable für das halten einer Datentabelle</summary>
|
||||
Dim tmptbl As New DataTable()
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "öffentliche Methoden"
|
||||
'''<summary>Öffnet ein neuer Journaleintrag in der Tabelle Import_Job</summary>
|
||||
'''<remarks>Für jede Indexdatei wird in der Verarbeitung ein neues Journal mit den
|
||||
'''entsprechenden Einträgen erstellt</remarks>
|
||||
'''<seealso cref="Main.Verarbeiten">Verarbeiten</seealso>
|
||||
Public Function Open_Journal() As Boolean
|
||||
Try
|
||||
Journal.cpMainConnectionProvider = Globals.conn_journale
|
||||
Journal.daStart_TS = New SqlDateTime(CType(Now, DateTime))
|
||||
Journal.iFeherhaft = New SqlInt32(CType(0, Int32))
|
||||
Journal.iJournal_Ausgeliefert = New SqlInt32(CType(0, Int32))
|
||||
Try
|
||||
Globals.conn_journale.OpenConnection()
|
||||
Catch
|
||||
End Try
|
||||
|
||||
Journal.Insert()
|
||||
Try
|
||||
Globals.conn_journale.CloseConnection(True)
|
||||
Catch
|
||||
End Try
|
||||
|
||||
Me.JournalNr = Journal.iImport_JobNr.Value
|
||||
Journal.Dispose()
|
||||
Catch
|
||||
Try
|
||||
Globals.conn_journale.CloseConnection(True)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
'''<summary>Schliessen des aktuell geöffneten Verarbeitungsjournales</summary>
|
||||
'''<remarks>Beim Abschluss eines Jobs wird der aktuelle Timestamp in der Tabelle
|
||||
'''Import_Job nachgeführt</remarks>
|
||||
'''<seealso cref="Main.Verarbeiten">Verarbeiten</seealso>
|
||||
Public Function Close_Journal() As Boolean
|
||||
Journal.cpMainConnectionProvider = Globals.conn_journale
|
||||
Journal.iImport_JobNr = New SqlInt32(CType(Me.JournalNr, Int32))
|
||||
Journal.SelectOne()
|
||||
If Fehler <> 0 Then
|
||||
Journal.iFeherhaft = New SqlInt32(CType(1, Integer))
|
||||
End If
|
||||
Journal.daEnde_TS = New SqlDateTime(CType(Now, DateTime))
|
||||
Globals.conn_journale.OpenConnection()
|
||||
Journal.Update()
|
||||
Globals.conn_journale.CloseConnection(True)
|
||||
End Function
|
||||
|
||||
'''<summary>Journaleintrag löschen</summary>
|
||||
'''<remarks>Löscht den Journaleintrag aus der Variabel JournalNr</remarks>
|
||||
Public Sub Delete_Entry()
|
||||
Journal.cpMainConnectionProvider = Globals.conn_journale
|
||||
Journal.iImport_JobNr = New SqlInt32(CType(Me.JournalNr, Int32))
|
||||
Journal.SelectOne()
|
||||
Journal.daEnde_TS = New SqlDateTime(CType(Now, DateTime))
|
||||
Globals.conn_journale.OpenConnection()
|
||||
Journal.Delete()
|
||||
Globals.conn_journale.CloseConnection(True)
|
||||
End Sub
|
||||
'''<summary>Einfügen eines neuen Journaldatensatzes</summary>
|
||||
'''<param name="RecNo">Recordnummer der Indexdaten bzw. "" für allgemeine
|
||||
'''Journaleinträte</param>
|
||||
'''<param name="Partnernr">Partnernr oder "" für allgemeine
|
||||
'''Einträge</param>
|
||||
'''<param name="dateityp">Dateityp der zu importierenden Datei bzw. ""
|
||||
'''für allgemeine Einträge</param>
|
||||
'''<param name="dateiname">Index-Dateiname oder Dateiname der zu importierenden
|
||||
'''Datei</param>
|
||||
'''<param name="Status">Status Nr</param>
|
||||
'''<param name="Statustext">Bezeichnung zur Statusnr</param>
|
||||
'''<param name="EDOKA_Dokumentid">Dokumentid des EDOKA-Dokumentes nach dem Import
|
||||
'''oder ""</param>
|
||||
'''<param name="Applikationnr">Fremdschlüssel zur Tabelle FA_APPL</param>
|
||||
'''<seealso cref="edokadb.clsFA_APPL">edkb08.edokadb.clsFA_APPL</seealso>
|
||||
Public Sub Insert_Journal(ByVal RecNo As String, ByVal Partnernr As String, ByVal dateityp As String, ByVal dateiname As String,
|
||||
ByVal Status As String, ByVal Statustext As String, ByVal EDOKA_Dokumentid As String,
|
||||
ByVal Applikationnr As String)
|
||||
If Status <> "" And Status <> "0" Then
|
||||
If Globals.Fehlermeldung <> "" Then Globals.Fehlermeldung = Globals.Fehlermeldung + vbCrLf
|
||||
Globals.Fehlermeldung = Globals.Fehlermeldung + Statustext
|
||||
End If
|
||||
Me.Journaleintrag.cpMainConnectionProvider = Globals.conn_journale
|
||||
Me.Journaleintrag.sRecordNo = New SqlString(CType(RecNo, String))
|
||||
Me.Journaleintrag.sPartnernr = New SqlString(CType(Partnernr, String))
|
||||
Me.Journaleintrag.sDateityp = New SqlString(CType(dateityp, String))
|
||||
Me.Journaleintrag.sDateiname = New SqlString(CType(dateiname, String))
|
||||
Me.Journaleintrag.sStatus = New SqlString(CType(Status, String))
|
||||
Me.Journaleintrag.sStatustext = New SqlString(CType(Statustext, String))
|
||||
Me.Journaleintrag.sEDOKA_Dokumentid = New SqlString(CType(EDOKA_Dokumentid, String))
|
||||
Try
|
||||
If Globals.Herkunftsapplikation.Rows.Count = 0 Then
|
||||
Me.Journaleintrag.sApplikationsnr = New SqlString(CType(0, String))
|
||||
Else
|
||||
Me.Journaleintrag.sApplikationsnr = New SqlString(CType(Globals.Herkunftsapplikation.Rows(0).Item(0), String))
|
||||
End If
|
||||
Catch
|
||||
Me.Journaleintrag.sApplikationsnr = New SqlString(CType(0, String))
|
||||
End Try
|
||||
Me.Journaleintrag.daTS = New SqlDateTime(CType(Now, DateTime))
|
||||
Me.Journaleintrag.iImport_JobNr = New SqlInt32(CType(JournalNr, Int32))
|
||||
Me.Journaleintrag.sEDOKA_Dokumenttyp = New SqlString(CType("", String))
|
||||
If RecNo <> "" Then
|
||||
Me.Journaleintrag.sIndexdaten = New SqlString(CType(get_indexdata(RecNo), String))
|
||||
Else
|
||||
Me.Journaleintrag.sIndexdaten = New SqlString(CType("", String))
|
||||
End If
|
||||
|
||||
Globals.conn_journale.OpenConnection()
|
||||
Me.Journaleintrag.Insert()
|
||||
Globals.conn_journale.CloseConnection(True)
|
||||
|
||||
If Status <> "0" And Status <> "" Then
|
||||
PrintLog(Str(Me.Journaleintrag.iImport_Eintragnr.Value) + " " + Status + " " + Statustext, EventLogEntryType.Error)
|
||||
Else
|
||||
PrintLog(Str(Me.Journaleintrag.iImport_Eintragnr.Value) + " " + Status + " " + Statustext, EventLogEntryType.Information)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function get_indexdata(ByVal Recno As Integer) As String
|
||||
Try
|
||||
Dim s As String = ""
|
||||
Dim i As Integer
|
||||
For i = 0 To Globals.temp_indexdaten.Columns.Count - 1
|
||||
s = s + LTrim(Str(i + 1)) + ": " + Trim(Globals.temp_indexdaten.Rows(Recno).Item(i)) + " "
|
||||
Next
|
||||
Return s
|
||||
Catch
|
||||
Return ""
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'''<summary>Ergänzt den Journaleintrag mit der zugehörenden
|
||||
'''Herkunftsapplikation</summary>
|
||||
'''<seealso cref="Globals.Herkunftsapplikation">edkb08.Globals</seealso>
|
||||
Public Sub Update_Journal()
|
||||
Try
|
||||
Dim j As New edokadb.clsImport_Job()
|
||||
j.iImport_JobNr = New SqlInt32(CType(Globals.Journal.JournalNr, Int32))
|
||||
j.cpMainConnectionProvider = Globals.conn_journale
|
||||
j.SelectOne()
|
||||
j.iApplikationNr = New SqlInt32(CType(Globals.Herkunftsapplikation.Rows(0).Item(0), Int32))
|
||||
Globals.conn_journale.OpenConnection()
|
||||
j.Update()
|
||||
Globals.conn_journale.CloseConnection(True)
|
||||
Catch ex As Exception
|
||||
PrintOut("clsJournal:Update_Journal:" + ex.Message + ex.StackTrace, EventLogEntryType.Error)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
#Region "Journal"
|
||||
|
||||
Public Function Print_Log(ByVal Applid As Integer, ByVal Applname As String, ByVal type As String) As String
|
||||
Dim dt As New DataTable()
|
||||
dt = Get_Journaldata(Applid)
|
||||
Dim ds As New DataSet()
|
||||
ds.Tables.Add(dt)
|
||||
|
||||
Dim x As New Export()
|
||||
Return x.Create_Report(dt, UCase(type), Globals.Herkunftsapplikation.Rows(0).Item(1))
|
||||
End Function
|
||||
|
||||
Public Function Print_Log_Batch(ByVal Applid As Integer, ByVal Applname As String, ByVal type As String) As String
|
||||
Dim dt As New DataTable()
|
||||
dt = Get_Journaldata(Applid)
|
||||
Dim ds As New DataSet()
|
||||
ds.Tables.Add(dt)
|
||||
|
||||
Dim x As New Export()
|
||||
Return x.Create_Report(dt, UCase(type), Applname)
|
||||
End Function
|
||||
|
||||
' Function table_to_csv(ByVal DT As DataTable) As String
|
||||
' Dim zeile As String = ""
|
||||
' Dim DR As DataRow
|
||||
' Dim DC As DataColumn
|
||||
|
||||
' ' Spaltenüberschriften
|
||||
' For Each DC In DT.Columns
|
||||
' zeile += IIf(zeile <> "", ";", "").ToString
|
||||
' zeile += DC.ColumnName
|
||||
' Next
|
||||
' table_to_csv += zeile & Chr(13)
|
||||
|
||||
' ' - Alle Zeillen ausgeben
|
||||
' For Each DR In DT.Rows
|
||||
' zeile = ""
|
||||
' ' Schleife über alle Spalten
|
||||
' For Each DC In DT.Columns
|
||||
' zeile += IIf(zeile <> "", ";", "").ToString
|
||||
' zeile += DR.Item(DC.ColumnName).ToString
|
||||
|
||||
' Next
|
||||
' table_to_csv += zeile & Chr(13)
|
||||
' Next
|
||||
'End Function
|
||||
|
||||
Private Function Get_Journaldata(ByVal applid As Integer) As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "import_journal"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = New DataTable()
|
||||
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
||||
Try
|
||||
scmCmdToExecute.Connection = conn_journale.scoDBConnection
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@applid", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, applid))
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
Throw New Exception("Dokumenterstellung::Generic_Select::" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
|
||||
Finally
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
BIN
edkb08/log_report/vssver.scc
Normal file
BIN
edkb08/log_report/vssver.scc
Normal file
Binary file not shown.
BIN
edkb08/vssver.scc
Normal file
BIN
edkb08/vssver.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user