Initial commit
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,490 @@
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
' // Description: Data Access class for the table 'ToolTip'
|
||||
' // Generated by LLBLGen v1.21.2003.712 Final on: Dienstag, 1. Januar 2013, 14:02:28
|
||||
' // Because the Base Class already implements IDispose, this class doesn't.
|
||||
' ///////////////////////////////////////////////////////////////////////////
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace DB
|
||||
''' <summary>
|
||||
''' Purpose: Data Access class for the table 'ToolTip'.
|
||||
''' </summary>
|
||||
Public Class clsToolTip
|
||||
Inherits clsDBInteractionBase
|
||||
|
||||
#Region " Class Member Declarations "
|
||||
|
||||
Private m_bAktiv As SqlBoolean
|
||||
Private m_daMutiert_am, m_daErstellt_am As SqlDateTime
|
||||
Private m_iMutierer, m_iToolTipNr As SqlInt32
|
||||
Private m_sToolTip, m_sControlName, m_sFormularName As SqlString
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Class constructor.
|
||||
''' </summary>
|
||||
Public Sub New()
|
||||
' // Nothing for now.
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Insert method. This method will insert one new row into the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' <LI>sFormularName. May be SqlString.Null</LI>
|
||||
''' <LI>sControlName. May be SqlString.Null</LI>
|
||||
''' <LI>sToolTip. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Insert() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_Insert]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFormularName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFormularName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sControlName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sControlName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sToolTip", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sToolTip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_Insert' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::Insert::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Update method. This method will Update one existing row in the database.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' <LI>sFormularName. May be SqlString.Null</LI>
|
||||
''' <LI>sControlName. May be SqlString.Null</LI>
|
||||
''' <LI>sToolTip. May be SqlString.Null</LI>
|
||||
''' <LI>bAktiv. May be SqlBoolean.Null</LI>
|
||||
''' <LI>daErstellt_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>daMutiert_am. May be SqlDateTime.Null</LI>
|
||||
''' <LI>iMutierer. May be SqlInt32.Null</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Update() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_Update]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sFormularName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sFormularName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sControlName", SqlDbType.VarChar, 50, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sControlName))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@sToolTip", SqlDbType.VarChar, 1024, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_sToolTip))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@bAktiv", SqlDbType.Bit, 1, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_bAktiv))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daErstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@daMutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am))
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iMutierer", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iMutierer))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_Update' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::Update::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Delete method. This method will Delete one existing row in the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>True if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function Delete() As Boolean
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_Delete]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(New SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery()
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_Delete' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::Delete::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties needed for this method:
|
||||
''' <UL>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' </UL>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
''' <LI>iToolTipNr</LI>
|
||||
''' <LI>sFormularName</LI>
|
||||
''' <LI>sControlName</LI>
|
||||
''' <LI>sToolTip</LI>
|
||||
''' <LI>bAktiv</LI>
|
||||
''' <LI>daErstellt_am</LI>
|
||||
''' <LI>daMutiert_am</LI>
|
||||
''' <LI>iMutierer</LI>
|
||||
'''</UL>
|
||||
''' Will fill all properties corresponding with a field in the table with the value of the row selected.
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectOne() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_SelectOne]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("ToolTip")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iToolTipNr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iToolTipNr))
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
If dtToReturn.Rows.Count > 0 Then
|
||||
m_iToolTipNr = New SqlInt32(CType(dtToReturn.Rows(0)("ToolTipNr"), Integer))
|
||||
If dtToReturn.Rows(0)("FormularName") Is System.DBNull.Value Then
|
||||
m_sFormularName = SqlString.Null
|
||||
Else
|
||||
m_sFormularName = New SqlString(CType(dtToReturn.Rows(0)("FormularName"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ControlName") Is System.DBNull.Value Then
|
||||
m_sControlName = SqlString.Null
|
||||
Else
|
||||
m_sControlName = New SqlString(CType(dtToReturn.Rows(0)("ControlName"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("ToolTip") Is System.DBNull.Value Then
|
||||
m_sToolTip = SqlString.Null
|
||||
Else
|
||||
m_sToolTip = New SqlString(CType(dtToReturn.Rows(0)("ToolTip"), String))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Aktiv") Is System.DBNull.Value Then
|
||||
m_bAktiv = SqlBoolean.Null
|
||||
Else
|
||||
m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("Aktiv"), Boolean))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Erstellt_am") Is System.DBNull.Value Then
|
||||
m_daErstellt_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Erstellt_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutiert_am") Is System.DBNull.Value Then
|
||||
m_daMutiert_am = SqlDateTime.Null
|
||||
Else
|
||||
m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("Mutiert_am"), Date))
|
||||
End If
|
||||
If dtToReturn.Rows(0)("Mutierer") Is System.DBNull.Value Then
|
||||
m_iMutierer = SqlInt32.Null
|
||||
Else
|
||||
m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("Mutierer"), Integer))
|
||||
End If
|
||||
End If
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::SelectOne::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Purpose: SelectAll method. This method will Select all rows from the table.
|
||||
''' </summary>
|
||||
''' <returns>DataTable object if succeeded, otherwise an Exception is thrown. </returns>
|
||||
''' <remarks>
|
||||
''' Properties set after a succesful call of this method:
|
||||
''' <UL>
|
||||
''' <LI>iErrorCode</LI>
|
||||
'''</UL>
|
||||
''' </remarks>
|
||||
Overrides Public Function SelectAll() As DataTable
|
||||
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_ToolTip_SelectAll]"
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
||||
Dim dtToReturn As DataTable = new DataTable("ToolTip")
|
||||
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute)
|
||||
|
||||
' // Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection
|
||||
|
||||
Try
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode))
|
||||
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Open connection.
|
||||
m_scoMainConnection.Open()
|
||||
Else
|
||||
If m_cpMainConnectionProvider.bIsTransactionPending Then
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction
|
||||
End If
|
||||
End If
|
||||
|
||||
' // Execute query.
|
||||
sdaAdapter.Fill(dtToReturn)
|
||||
m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
|
||||
|
||||
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
|
||||
' // Throw error.
|
||||
Throw New Exception("Stored Procedure 'pr_ToolTip_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString())
|
||||
End If
|
||||
|
||||
Return dtToReturn
|
||||
Catch ex As Exception
|
||||
' // some error occured. Bubble it to caller and encapsulate Exception object
|
||||
Throw New Exception("clsToolTip::SelectAll::Error occured.", ex)
|
||||
Finally
|
||||
If m_bMainConnectionIsCreatedLocal Then
|
||||
' // Close connection.
|
||||
m_scoMainConnection.Close()
|
||||
End If
|
||||
scmCmdToExecute.Dispose()
|
||||
sdaAdapter.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
#Region " Class Property Declarations "
|
||||
|
||||
Public Property [iToolTipNr]() As SqlInt32
|
||||
Get
|
||||
Return m_iToolTipNr
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
Dim iToolTipNrTmp As SqlInt32 = Value
|
||||
If iToolTipNrTmp.IsNull Then
|
||||
Throw New ArgumentOutOfRangeException("iToolTipNr", "iToolTipNr can't be NULL")
|
||||
End If
|
||||
m_iToolTipNr = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sFormularName]() As SqlString
|
||||
Get
|
||||
Return m_sFormularName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sFormularName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sControlName]() As SqlString
|
||||
Get
|
||||
Return m_sControlName
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sControlName = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [sToolTip]() As SqlString
|
||||
Get
|
||||
Return m_sToolTip
|
||||
End Get
|
||||
Set(ByVal Value As SqlString)
|
||||
m_sToolTip = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [bAktiv]() As SqlBoolean
|
||||
Get
|
||||
Return m_bAktiv
|
||||
End Get
|
||||
Set(ByVal Value As SqlBoolean)
|
||||
m_bAktiv = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daErstellt_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daErstellt_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daErstellt_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [daMutiert_am]() As SqlDateTime
|
||||
Get
|
||||
Return m_daMutiert_am
|
||||
End Get
|
||||
Set(ByVal Value As SqlDateTime)
|
||||
m_daMutiert_am = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Public Property [iMutierer]() As SqlInt32
|
||||
Get
|
||||
Return m_iMutierer
|
||||
End Get
|
||||
Set(ByVal Value As SqlInt32)
|
||||
m_iMutierer = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,434 @@
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
Public Class frmPPlan
|
||||
|
||||
|
||||
#Region "Deklarationen"
|
||||
Dim sec As New Utils.MySecurity
|
||||
Dim msg As New Utils.MyMessage
|
||||
Dim FormReadonly As Boolean = False
|
||||
Dim FormDataChanged As Boolean = False
|
||||
Private Anzeige As Boolean = False
|
||||
|
||||
Dim OnGetData As Boolean
|
||||
|
||||
Dim c1bookmark
|
||||
Dim c2bookmark
|
||||
Dim pruefplan As New clspruefplan
|
||||
|
||||
Dim WithEvents evh As MyGenericEventHandler = Globals.MyEventHanlder
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Closing / Check_Changes"
|
||||
''' <summary>
|
||||
''' Schliessen des Formulars
|
||||
''' </summary>
|
||||
''' <param name="sender"></param>
|
||||
''' <param name="e"></param>
|
||||
''' <remarks></remarks>
|
||||
Private Sub FormularClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
|
||||
Me.FormReadonly = True
|
||||
If Me.FormReadonly = True Then Exit Sub
|
||||
If Check_Changes() = False Then
|
||||
e.Cancel = True
|
||||
Else
|
||||
pruefplan.dispose()
|
||||
Me.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Prüfung, ob Datenänderungen vorgenommen wurden.
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Private Function Check_Changes() As Boolean
|
||||
If Me.FormReadonly Then
|
||||
Return True
|
||||
Exit Function
|
||||
End If
|
||||
Dim msgres As MsgBoxResult
|
||||
If Me.FormDataChanged Then
|
||||
msgres = msg.Show_MessageYesNoCancel(3)
|
||||
Select Case msgres
|
||||
Case MsgBoxResult.Yes
|
||||
Return True
|
||||
Case MsgBoxResult.Cancel
|
||||
Return False
|
||||
Case MsgBoxResult.No
|
||||
Me.FormDataChanged = False
|
||||
Return True
|
||||
End Select
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Eventhandler ChangeEreignisse"
|
||||
''' <summary>
|
||||
''' Allg Eventhandler für Chanage-Ereignise festlegen
|
||||
''' </summary>
|
||||
''' <param name="Container"></param>
|
||||
''' <remarks></remarks>
|
||||
Private Sub AddChanges(ByVal Container As Control)
|
||||
Dim l As New List(Of Control)
|
||||
Me.GetControl(Me, "*", l)
|
||||
Dim evh As EventHandler = AddressOf ChangesMade
|
||||
For Each c As Control In l
|
||||
If TypeOf c Is TextBox Then
|
||||
Dim ctl As TextBox = c
|
||||
AddHandler ctl.TextChanged, evh
|
||||
End If
|
||||
If TypeOf c Is MaskedTextBox Then
|
||||
Dim ctl As MaskedTextBox = c
|
||||
AddHandler ctl.TextChanged, evh
|
||||
End If
|
||||
If TypeOf c Is ComboBox Then
|
||||
Dim ctl As ComboBox = c
|
||||
AddHandler ctl.SelectedValueChanged, evh
|
||||
End If
|
||||
If TypeOf c Is RichTextBox Then
|
||||
Dim ctl As RichTextBox = c
|
||||
AddHandler ctl.TextChanged, evh
|
||||
End If
|
||||
If TypeOf c Is CheckBox Then
|
||||
If c.Name <> "cboxNurAktive" Then
|
||||
Dim ctl As CheckBox = c
|
||||
AddHandler ctl.CheckedChanged, evh
|
||||
End If
|
||||
End If
|
||||
If TypeOf c Is CheckedListBox Then
|
||||
Dim ctl As CheckedListBox = c
|
||||
AddHandler ctl.ItemCheck, AddressOf ChecketListBoxChange
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Envent-Handler für Change-Ereignisse
|
||||
''' </summary>
|
||||
''' <param name="sender"></param>
|
||||
''' <param name="e"></param>
|
||||
''' <remarks></remarks>
|
||||
Private Sub ChangesMade(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
Me.FormDataChanged = True
|
||||
Dim objtype As System.Type = sender.GetType
|
||||
If objtype.Name = "MaskedTextBox" Then
|
||||
Dim o As MaskedTextBox = sender
|
||||
If o.Text = "01.01.1900" Then o.Text = " . . "
|
||||
End If
|
||||
End Sub
|
||||
Private Sub ChecketListBoxChange(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs)
|
||||
Me.FormDataChanged = True
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Sucht in den Base-Controls sämtliche Controls mit dem Namen in "Key" (Wildcards * möglich) und listet
|
||||
''' die gefundnen Controls in der Liste L zur weiteren Bearbeitung
|
||||
''' </summary>
|
||||
''' <param name="BaseControl">Base-Contrlo (z.B. aktuelles Formular</param>
|
||||
''' <param name="Key">Schlüssel welcher gesucht werden soll</param>
|
||||
''' <param name="L">Liste der gefundenen Objekte</param>
|
||||
''' <returns>True wenn eines oder mehr Controls gefunden wurden, false wenn kein Control gefunden wurde.
|
||||
''' </returns>
|
||||
''' <remarks></remarks>
|
||||
Private Function GetControl(ByVal BaseControl As Control, ByVal Key As String, ByRef L As List(Of Control), Optional ByVal ReturnAtFirstElement As Boolean = False) As Boolean
|
||||
If L Is Nothing Then L = New List(Of Control)
|
||||
Dim Gut As Boolean
|
||||
Dim ReturnFlag As Boolean = False
|
||||
If Key IsNot Nothing Then Key = Key.ToLower
|
||||
|
||||
If BaseControl.HasChildren = True Then
|
||||
For Each ctl As Control In BaseControl.Controls
|
||||
Gut = False
|
||||
If Key Is Nothing Then
|
||||
Gut = True
|
||||
Else
|
||||
If ctl.Name.Length >= Key.Length Then
|
||||
Key = Key.ToLower
|
||||
If Key.StartsWith("*") Then
|
||||
If Key.Substring(1) = ctl.Name.ToLower.Substring(ctl.Name.Length - (Key.Length - 1), Key.Length - 1) Then Gut = True
|
||||
ElseIf Key.EndsWith("*") Then
|
||||
If Key.Substring(0, Key.Length - 1) = ctl.Name.ToLower.Substring(0, Key.Length - 1) Then Gut = True
|
||||
Else
|
||||
If Key = ctl.Name.ToLower Then Gut = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Gut = True Then
|
||||
L.Add(ctl)
|
||||
If ReturnAtFirstElement = True Then ReturnFlag = True
|
||||
End If
|
||||
If ReturnFlag = False Then
|
||||
Call GetControl(ctl, Key, L)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If L.Count - 1 > -1 Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Form"
|
||||
|
||||
Sub New()
|
||||
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
Me.ImageList1 = Globals.GueltigImages
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub frmPPlan_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Refresh_List()
|
||||
End Sub
|
||||
|
||||
Sub Refresh_List(Optional searchstring As String = "")
|
||||
Me.pruefplan.Get_Eintraege(Me.C1Daten, 0, Me.tsTxtSearch.Text)
|
||||
Dim bmp0 As New Bitmap(Me.ImageList1.Images(0))
|
||||
Dim bmp1 As New Bitmap(Me.ImageList1.Images(1))
|
||||
Dim bmp2 As New Bitmap(Me.ImageList1.Images(2))
|
||||
Dim bmp3 As New Bitmap(Me.ImageList1.Images(3))
|
||||
|
||||
Dim v0 As New C1.Win.C1TrueDBGrid.ValueItem()
|
||||
Dim v1 As New C1.Win.C1TrueDBGrid.ValueItem()
|
||||
Dim v2 As New C1.Win.C1TrueDBGrid.ValueItem()
|
||||
Dim v3 As New C1.Win.C1TrueDBGrid.ValueItem()
|
||||
|
||||
v0.DisplayValue = bmp0
|
||||
v0.Value = 0
|
||||
|
||||
v1.DisplayValue = bmp1
|
||||
v1.Value = 1
|
||||
|
||||
v2.DisplayValue = bmp2
|
||||
v2.Value = 2
|
||||
|
||||
v3.DisplayValue = bmp3
|
||||
v3.Value = 3
|
||||
|
||||
Me.C1Daten.Columns("Icon").ValueItems.Values.Add(v0)
|
||||
Me.C1Daten.Columns("Icon").ValueItems.Values.Add(v1)
|
||||
Me.C1Daten.Columns("Icon").ValueItems.Values.Add(v2)
|
||||
Me.C1Daten.Columns("Icon").ValueItems.Values.Add(v3)
|
||||
Me.C1Daten.Columns("Icon").ValueItems.Translate = True
|
||||
Me.C1Daten.Splits(0).DisplayColumns("icon").Style.HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Center
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "C1Daten"
|
||||
Private Sub C1Daten_MouseDown(sender As Object, e As MouseEventArgs) Handles C1Daten.MouseDown
|
||||
Me.C1Daten.Bookmark = Me.C1Daten.RowContaining(e.Y)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub C1Daten_RowColChange(sender As Object, e As C1.Win.C1TrueDBGrid.RowColChangeEventArgs) Handles C1Daten.RowColChange
|
||||
Refresh_Details()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Sub Refresh_Details()
|
||||
Try
|
||||
Me.txtPruefgegenstand.Text = ""
|
||||
Me.txtPrioritaet.Text = ""
|
||||
Me.txtPeriodizitaet.Text = ""
|
||||
Me.txtZeitpunkt.Text = ""
|
||||
Me.txtVerantwortlich.Text = ""
|
||||
Me.txtVerantwortungISI.Text = ""
|
||||
Me.txtBeschreibung.Text = ""
|
||||
Me.txtBezeichnung.Text = ""
|
||||
Me.txtGueltigbis.Text = ""
|
||||
|
||||
Me.txtPruefgegenstand.Text = C1Daten.Columns("Pruefgegenstand").Value
|
||||
Me.txtPeriodizitaet.Text = C1Daten.Columns("Periodizitaet").Value
|
||||
Me.txtPrioritaet.Text = C1Daten.Columns("Prioritaet").Value
|
||||
Me.txtZeitpunkt.Text = C1Daten.Columns("Zeitpunkt").Value
|
||||
Me.txtVerantwortlich.Text = C1Daten.Columns("Verantwortung").Value
|
||||
Me.txtVerantwortungISI.Text = C1Daten.Columns("Verantwortung_ISI").Value
|
||||
Me.txtVerantwortlichPlan.Text = C1Daten.Columns("VerantwortungPlan").Value
|
||||
Me.txtBeschreibung.Text = C1Daten.Columns("Beschreibung").Value
|
||||
Me.txtBezeichnung.Text = C1Daten.Columns("Bezeichnung").Value
|
||||
Me.txtGueltigbis.Text = C1Daten.Columns("Gueltig_bis").Value
|
||||
Me.DokumenteAllgemein.Show_Toolbar = False
|
||||
Me.DokumenteAllgemein.ConnectionString = Globals.sConnectionString
|
||||
Me.DokumenteAllgemein.Mitarbeiternr = Globals.clsmitarbeiter.iMitarbeiternr.Value
|
||||
Me.DokumenteAllgemein.Doktype = 3
|
||||
Me.DokumenteAllgemein.ThemaNr = C1Daten.Columns("PruefplanNr").Value
|
||||
Me.DokumenteAllgemein.Refresh()
|
||||
Me.DokumenteAllgemein.TempFilePath = Globals.clsapplication.sTmp_filepath.Value
|
||||
Me.cbKeinMail.Checked = C1Daten.Columns("Kein_Mailversand").Value = True
|
||||
Me.cbSelbstkontrolle.Checked = C1Daten.Columns("Selbstkontrolle").Value = True
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
'MsgBox(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub TSBtnAddNew_Click(sender As Object, e As EventArgs) Handles TSBtnAddNew.Click
|
||||
Dim f As New frmPruefplanDetail
|
||||
f.MdiParent = Me.MdiParent
|
||||
f.PruefplanHandler = Me.Handle
|
||||
f.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub DetailsAnzeigenBearbeitenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DetailsAnzeigenBearbeitenToolStripMenuItem.Click
|
||||
Try
|
||||
c1bookmark = C1Daten.Bookmark
|
||||
|
||||
|
||||
Dim f As New frmPruefplanDetail
|
||||
f.Pruefplannr = Me.C1Daten.Columns("pruefplannr").Value
|
||||
f.MdiParent = Me.MdiParent
|
||||
f.PruefplanHandler = Me.Handle
|
||||
f.Show()
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub C1Daten_DoubleClick(sender As Object, e As EventArgs) Handles C1Daten.DoubleClick
|
||||
Try
|
||||
DetailsAnzeigenBearbeitenToolStripMenuItem_Click(sender, e)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub TSBtnQuit_Click(sender As Object, e As EventArgs) Handles TSBtnQuit.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub evh_Pruefplandetail_Saved(handler As Integer, key As Integer) Handles evh.Pruefplandetail_Saved, evh.Pruefplandetail_Closed
|
||||
Try
|
||||
If handler = Me.Handle Then
|
||||
Me.Refresh_List()
|
||||
|
||||
For i = 0 To Me.C1Daten.Splits(0).Rows.Count - 1
|
||||
If C1Daten.Columns("PruefplanNr").CellValue(i) = key Then
|
||||
Me.C1Daten.Bookmark = i
|
||||
Refresh_Details()
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Catch
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub tsBtnSearchStruktur_Definition_Click(sender As Object, e As EventArgs) Handles tsBtnSearchStruktur_Definition.Click
|
||||
Refresh_List(Me.tsTxtSearch.Text)
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton4_Click(sender As Object, e As EventArgs) Handles tsbtnFilterAufheben.Click
|
||||
Me.tsTxtSearch.Text = ""
|
||||
Refresh_List(Me.tsTxtSearch.Text)
|
||||
End Sub
|
||||
|
||||
Private Sub tsTxtSearch_KeyDown(sender As Object, e As KeyEventArgs) Handles tsTxtSearch.KeyDown
|
||||
If e.KeyCode = Keys.Enter Then
|
||||
tsBtnSearchStruktur_Definition_Click(sender, e)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DefinitionAnzeigenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DefinitionAnzeigenToolStripMenuItem.Click
|
||||
|
||||
Dim f As New frmVorgabeDefinition
|
||||
f.Key = Me.C1Daten.Columns("VorgabeDefinitionNr").Value
|
||||
|
||||
f.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub NeueDefinitionErfassenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NeueDefinitionErfassenToolStripMenuItem.Click
|
||||
TSBtnAddNew_Click(sender, e)
|
||||
End Sub
|
||||
|
||||
Private Sub VorgabeAnzeigenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles VorgabeAnzeigenToolStripMenuItem.Click
|
||||
Dim f As New frmVorgabe(Me.C1Daten.Columns("Pruefplannr").Value)
|
||||
f.MdiParent = Me.MdiParent
|
||||
f.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click
|
||||
DetailsAnzeigenBearbeitenToolStripMenuItem_Click(sender, e)
|
||||
End Sub
|
||||
|
||||
Private Sub TSBtnDelete_Click(sender As Object, e As EventArgs) Handles TSBtnDelete.Click
|
||||
Try
|
||||
Dim i As Integer = Me.pruefplan.Get_Data(Me.C1Daten.Columns("Pruefplannr").Value)
|
||||
|
||||
If MsgBox("Prüfplaneintrag wirklich löschen?", vbYesNo + vbQuestion) = MsgBoxResult.Yes Then
|
||||
Me.pruefplan.Get_Data(Me.C1Daten.Columns("Pruefplannr").Value)
|
||||
Me.pruefplan.Delete_Data()
|
||||
Me.Refresh_List()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub PrüfschrittGenerierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PrüfschrittGenerierenToolStripMenuItem.Click
|
||||
Generate_Action()
|
||||
End Sub
|
||||
|
||||
Public Function Generate_Action()
|
||||
|
||||
Try
|
||||
Dim ds As New DataSet
|
||||
Dim connection As New SqlConnection()
|
||||
Dim da As New SqlDataAdapter("", connection)
|
||||
Dim sqlcmd As New SqlCommand
|
||||
'sqlcmd.CommandText = "generate_massnahme"
|
||||
sqlcmd.CommandText = "generate_pruefschritt"
|
||||
sqlcmd.Parameters.Add(New SqlParameter("@pruefplannr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Me.C1Daten.Columns("Pruefplannr").Value))
|
||||
sqlcmd.Parameters.Add(New SqlParameter("@mitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Globals.clsmitarbeiter.iMitarbeiternr.Value))
|
||||
|
||||
sqlcmd.CommandType = CommandType.StoredProcedure
|
||||
sqlcmd.Connection = connection
|
||||
Try
|
||||
connection.ConnectionString = Globals.sConnectionString
|
||||
connection.Open()
|
||||
sqlcmd.ExecuteNonQuery()
|
||||
MsgBox("Generierung abgeschlossen")
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Finally
|
||||
connection.Close()
|
||||
da.Dispose()
|
||||
sqlcmd.Dispose()
|
||||
End Try
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub BeendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles BeendenToolStripMenuItem.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "Toolbar"
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
Reference in New Issue
Block a user