' /////////////////////////////////////////////////////////////////////////// ' // Description: Data Access class for the table 'suchdaten' ' // Generated by LLBLGen v1.2.1045.38210 Final on: Donnerstag, 15. Juli 2004, 01:14:23 ' // 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 ' /// ' /// Purpose: Data Access class for the table 'suchdaten'. ' /// Public Class clsSuchdaten Inherits clsDBInteractionBase #Region " Class Member Declarations " Private m_iNodenr, m_iMitarbeiternr, m_iId, m_iSuchprofilnr As SqlInt32 Private m_sOp2, m_sDaten2, m_sDaten1, m_sAndor, m_sOp1 As SqlString #End Region ' /// ' /// Purpose: Class constructor. ' /// Public Sub New() ' // Nothing for now. End Sub ' /// ' /// Purpose: Insert method. This method will insert one new row into the database. ' /// ' /// True if succeeded, otherwise an Exception is thrown. ' /// ' /// Properties needed for this method: ' /// ' /// Properties set after a succesful call of this method: ' /// ' /// Overrides Public Function Insert() As Boolean Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[pr_suchdaten_Insert]" scmCmdToExecute.CommandType = CommandType.StoredProcedure ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(New SqlParameter("@iid", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iId)) scmCmdToExecute.Parameters.Add(New SqlParameter("@isuchprofilnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iSuchprofilnr)) scmCmdToExecute.Parameters.Add(New SqlParameter("@inodenr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iNodenr)) scmCmdToExecute.Parameters.Add(New SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sandor", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sAndor)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sop1", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sOp1)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sdaten1", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDaten1)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sop2", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sOp2)) scmCmdToExecute.Parameters.Add(New SqlParameter("@sdaten2", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sDaten2)) 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_suchdaten_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("clsSuchdaten::Insert::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() End Try End Function ' /// ' /// Purpose: SelectAll method. This method will Select all rows from the table. ' /// ' /// DataTable object if succeeded, otherwise an Exception is thrown. ' /// ' /// Properties set after a succesful call of this method: ' /// ' /// Public Overrides Function SelectAll() As DataTable Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[pr_suchdaten_SelectAll]" scmCmdToExecute.CommandType = CommandType.StoredProcedure Dim dtToReturn As DataTable = New DataTable("suchdaten") 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_suchdaten_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("clsSuchdaten::SelectAll::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() sdaAdapter.Dispose() End Try End Function #Region " Class Property Declarations " Public Property [iId]() As SqlInt32 Get Return m_iId End Get Set(ByVal Value As SqlInt32) m_iId = Value End Set End Property Public Property [iSuchprofilnr]() As SqlInt32 Get Return m_iSuchprofilnr End Get Set(ByVal Value As SqlInt32) m_iSuchprofilnr = Value End Set End Property Public Property [iNodenr]() As SqlInt32 Get Return m_iNodenr End Get Set(ByVal Value As SqlInt32) m_iNodenr = Value End Set End Property Public Property [iMitarbeiternr]() As SqlInt32 Get Return m_iMitarbeiternr End Get Set(ByVal Value As SqlInt32) m_iMitarbeiternr = Value End Set End Property Public Property [sAndor]() As SqlString Get Return m_sAndor End Get Set(ByVal Value As SqlString) m_sAndor = Value End Set End Property Public Property [sOp1]() As SqlString Get Return m_sOp1 End Get Set(ByVal Value As SqlString) m_sOp1 = Value End Set End Property Public Property [sDaten1]() As SqlString Get Return m_sDaten1 End Get Set(ByVal Value As SqlString) m_sDaten1 = Value End Set End Property Public Property [sOp2]() As SqlString Get Return m_sOp2 End Get Set(ByVal Value As SqlString) m_sOp2 = Value End Set End Property Public Property [sDaten2]() As SqlString Get Return m_sDaten2 End Get Set(ByVal Value As SqlString) m_sDaten2 = Value End Set End Property #End Region End Class End Namespace