216 lines
5.8 KiB
VB.net
216 lines
5.8 KiB
VB.net
|
||
|
||
Public Class MyListItem
|
||
Private mText As String
|
||
Private mValue As String
|
||
|
||
Public Sub New(ByVal pText As String, ByVal pValue As String)
|
||
mText = pText
|
||
mValue = pValue
|
||
End Sub
|
||
|
||
Public ReadOnly Property Text() As String
|
||
Get
|
||
Return mText
|
||
End Get
|
||
End Property
|
||
|
||
Public ReadOnly Property Value() As String
|
||
Get
|
||
Return mValue
|
||
End Get
|
||
End Property
|
||
|
||
Public Overrides Function ToString() As String
|
||
Return mText
|
||
End Function
|
||
|
||
|
||
End Class
|
||
|
||
|
||
|
||
Public Class MyListItem2
|
||
Private mText As Object
|
||
Private mValue As Object
|
||
|
||
Public Sub New(ByVal pText As Object, ByVal pValue As Object)
|
||
mText = pText
|
||
mValue = pValue
|
||
End Sub
|
||
|
||
Public ReadOnly Property Text() As Object
|
||
Get
|
||
Return mText
|
||
End Get
|
||
End Property
|
||
|
||
Public ReadOnly Property Value() As Object
|
||
Get
|
||
Return mValue
|
||
End Get
|
||
End Property
|
||
|
||
' Public Overrides Function ToString() As Object
|
||
' Return mText
|
||
' End Function
|
||
|
||
|
||
|
||
|
||
|
||
End Class
|
||
|
||
'Public Class SQLVariable
|
||
' Private ReadOnly TextSQLName As String
|
||
' Private ReadOnly ValueSQLVALUE As Object
|
||
' Private ReadOnly ScalarvariablenameIntern As String
|
||
' Private ReadOnly primaryParam As Boolean
|
||
' Private ReadOnly onlyForLoad As Boolean
|
||
' Private ReadOnly onlyForSave As Boolean
|
||
|
||
' ''' <summary>
|
||
' ''' Erstellt eine neue SQLVariable für Parameterübergaben an SQL-Befehle.
|
||
' ''' </summary>
|
||
' ''' <param name="Text">Spaltenname in der Datenbank</param>
|
||
' ''' <param name="Value">Wert, der gespeichert oder gelesen werden soll</param>
|
||
' ''' <param name="Scalarvariablename">Parametername für SQL-Bindung (optional, sonst = Text)</param>
|
||
' ''' <param name="primaryParam">Kennzeichnet Primärschlüssel für WHERE-Klausel</param>
|
||
' ''' <param name="onlyForLoad">Wird nur beim Laden verwendet</param>
|
||
' ''' <param name="onlyForSave">Wird nur beim Speichern verwendet</param>
|
||
' Public Sub New(ByVal Text As String,
|
||
' ByVal Value As Object,
|
||
' Optional Scalarvariablename As String = "",
|
||
' Optional primaryParam As Boolean = False,
|
||
' Optional onlyForLoad As Boolean = False,
|
||
' Optional onlyForSave As Boolean = False)
|
||
|
||
' If String.IsNullOrWhiteSpace(Text) Then
|
||
' Throw New ArgumentException("❌ SQLVariable: Text darf nicht leer sein!")
|
||
' End If
|
||
|
||
' Me.TextSQLName = Text
|
||
' Me.ValueSQLVALUE = Value
|
||
' Me.primaryParam = primaryParam
|
||
' Me.onlyForLoad = onlyForLoad
|
||
' Me.onlyForSave = onlyForSave
|
||
' Me.ScalarvariablenameIntern = If(String.IsNullOrWhiteSpace(Scalarvariablename), Text, Scalarvariablename)
|
||
' End Sub
|
||
|
||
' ''' <summary>
|
||
' ''' Name der SQL-Spalte
|
||
' ''' </summary>
|
||
' Public ReadOnly Property Text() As String
|
||
' Get
|
||
' Return TextSQLName
|
||
' End Get
|
||
' End Property
|
||
|
||
' ''' <summary>
|
||
' ''' Wert der SQL-Spalte
|
||
' ''' </summary>
|
||
' Public ReadOnly Property Value() As Object
|
||
' Get
|
||
' Return ValueSQLVALUE
|
||
' End Get
|
||
' End Property
|
||
|
||
' ''' <summary>
|
||
' ''' Parametername für die SQL-Zuweisung (z. B. @Bezeichnung)
|
||
' ''' </summary>
|
||
' Public ReadOnly Property Scalarvariable() As String
|
||
' Get
|
||
' Return ScalarvariablenameIntern
|
||
' End Get
|
||
' End Property
|
||
|
||
' ''' <summary>
|
||
' ''' True, wenn es sich um einen Primärschlüssel handelt
|
||
' ''' </summary>
|
||
' Public ReadOnly Property isPrimaryParam() As Boolean
|
||
' Get
|
||
' Return primaryParam
|
||
' End Get
|
||
' End Property
|
||
|
||
' ''' <summary>
|
||
' ''' True, wenn nur für Lade-Operationen verwenden
|
||
' ''' </summary>
|
||
' Public ReadOnly Property isOnlyForLoad() As Boolean
|
||
' Get
|
||
' Return onlyForLoad
|
||
' End Get
|
||
' End Property
|
||
|
||
' ''' <summary>
|
||
' ''' True, wenn nur für Speicher-Operationen verwenden
|
||
' ''' </summary>
|
||
' Public ReadOnly Property isOnlyForSave() As Boolean
|
||
' Get
|
||
' Return onlyForSave
|
||
' End Get
|
||
' End Property
|
||
'End Class
|
||
|
||
Public Class SQLVariable
|
||
Private TextSQLName As String
|
||
Private ValueSQLVALUE As Object
|
||
Private Scalarvariablename As String
|
||
Private primaryParam As Boolean
|
||
Private onlyForLoad As Boolean
|
||
Private onlyForSave As Boolean
|
||
|
||
Public Sub New(ByVal Text As String, ByVal Value As Object, Optional Scalarvariablename As String = "", Optional primaryParam As Boolean = False, Optional onlyForLoad As Boolean = False, Optional onlyForSave As Boolean = False)
|
||
Me.TextSQLName = Text
|
||
Me.ValueSQLVALUE = Value
|
||
Me.primaryParam = primaryParam
|
||
Me.onlyForLoad = onlyForLoad
|
||
Me.onlyForSave = onlyForSave
|
||
|
||
If Scalarvariablename <> "" Then Me.Scalarvariablename = Scalarvariablename Else Me.Scalarvariablename = Text
|
||
End Sub
|
||
|
||
Public ReadOnly Property Text() As String
|
||
Get
|
||
Return TextSQLName
|
||
End Get
|
||
End Property
|
||
|
||
Public ReadOnly Property Value() As Object
|
||
Get
|
||
Return ValueSQLVALUE
|
||
End Get
|
||
End Property
|
||
|
||
Public ReadOnly Property Scalarvariable() As Object
|
||
Get
|
||
Return Scalarvariablename
|
||
End Get
|
||
End Property
|
||
|
||
Public ReadOnly Property isPrimaryParam() As Boolean
|
||
Get
|
||
Return primaryParam
|
||
End Get
|
||
End Property
|
||
|
||
Public ReadOnly Property isonlyForLoad() As Boolean
|
||
Get
|
||
Return onlyForLoad
|
||
End Get
|
||
End Property
|
||
|
||
Public ReadOnly Property isonlyForSave() As Boolean
|
||
Get
|
||
Return onlyForSave
|
||
End Get
|
||
End Property
|
||
|
||
|
||
' Public Overrides Function ToString() As Object
|
||
' Return mText
|
||
' End Function
|
||
|
||
|
||
|
||
End Class |