Initial commit
This commit is contained in:
122
DPM2016/Klassen/MyCombobox.vb
Normal file
122
DPM2016/Klassen/MyCombobox.vb
Normal file
@@ -0,0 +1,122 @@
|
||||
Public Class MyCombobox
|
||||
Inherits ComboBox
|
||||
|
||||
Dim db As New clsDB
|
||||
|
||||
|
||||
|
||||
Dim m_sql As String
|
||||
Property Dataselection As String
|
||||
Get
|
||||
Return m_sql
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sql = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim M_TableAlias As String = ""
|
||||
Property TableAlias As String
|
||||
Get
|
||||
Return M_TableAlias
|
||||
End Get
|
||||
Set(value As String)
|
||||
M_TableAlias = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_table As String
|
||||
Property Table As String
|
||||
Get
|
||||
Return m_table
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_table = value
|
||||
db.dsDaten.Tables.Clear()
|
||||
Try
|
||||
Dim TableFound As Boolean = False
|
||||
For Each t As DataTable In IntTables.Inttables.Tables
|
||||
If Me.TableAlias <> "" Then
|
||||
If t.TableName = Me.TableAlias Then TableFound = True
|
||||
Else
|
||||
If t.TableName = value Then TableFound = True
|
||||
End If
|
||||
|
||||
Next
|
||||
If Not TableFound Then
|
||||
If Me.Dataselection <> "" Then
|
||||
db.Get_Tabledata(value, " ", Me.Dataselection)
|
||||
Else
|
||||
db.Get_Tabledata(value, " where aktiv=1")
|
||||
|
||||
End If
|
||||
|
||||
If Me.TableAlias <> "" Then
|
||||
db.dsDaten.Tables(0).TableName = Me.TableAlias
|
||||
Else
|
||||
db.dsDaten.Tables(0).TableName = value
|
||||
End If
|
||||
IntTables.Inttables.Tables.Add(db.dsDaten.Tables(0).Copy)
|
||||
End If
|
||||
If Me.TableAlias <> "" Then
|
||||
MyBase.DataSource = IntTables.Inttables.Tables(Me.TableAlias)
|
||||
Else
|
||||
MyBase.DataSource = IntTables.Inttables.Tables(value)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_displaymember As String
|
||||
Property Displaymember As String
|
||||
Get
|
||||
Return m_displaymember
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_displaymember = value
|
||||
MyBase.DisplayMember = m_displaymember
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_valuememeber As String
|
||||
Property Valuemember As String
|
||||
Get
|
||||
Return m_valuememeber
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_valuememeber = value
|
||||
MyBase.ValueMember = m_valuememeber
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_selectedvalue As String
|
||||
Property SelectedValue
|
||||
Get
|
||||
m_selectedvalue = MyBase.SelectedValue
|
||||
Return m_selectedvalue
|
||||
End Get
|
||||
Set(value)
|
||||
Try
|
||||
m_selectedvalue = value
|
||||
Catch
|
||||
m_selectedvalue = -1
|
||||
End Try
|
||||
|
||||
MyBase.SelectedValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_text As String
|
||||
Property Text As String
|
||||
Get
|
||||
m_text = MyBase.Text
|
||||
Return m_text
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_text = value
|
||||
MyBase.Text = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user