69 lines
2.0 KiB
VB.net
69 lines
2.0 KiB
VB.net
Imports DevExpress.XtraEditors
|
|
Imports DevExpress.XtraLayout
|
|
Imports DigitalData.Modules.Logging
|
|
Imports DigitalData.Modules.ZooFlow
|
|
Imports DigitalData.Modules.Database
|
|
Imports DigitalData.Controls.LookupGrid
|
|
|
|
Public Class PropertyControls
|
|
Private _LogConfig As LogConfig
|
|
Private _Logger As Logger
|
|
Private _Db As MSSQLServer
|
|
|
|
Public Sub New(LogConfig As LogConfig, Database As MSSQLServer)
|
|
_LogConfig = LogConfig
|
|
_Logger = LogConfig.GetLogger()
|
|
_Db = Database
|
|
End Sub
|
|
|
|
Public Function GetControlForAttribute(Attribute As Attribute) As BaseEdit
|
|
Select Case Attribute.TypeName
|
|
Case "BIT"
|
|
Dim oCheckboxEdit As New CheckEdit With {
|
|
.Name = Attribute.ID,
|
|
.Text = Attribute.Title
|
|
}
|
|
Return oCheckboxEdit
|
|
|
|
Case "DATE"
|
|
Dim oDateEdit As New DateEdit With {
|
|
.Name = Attribute.ID
|
|
}
|
|
Return oDateEdit
|
|
|
|
Case "BIG INTEGER"
|
|
Dim oTextEdit As New TextEdit With {
|
|
.Name = Attribute.ID
|
|
}
|
|
Return oTextEdit
|
|
|
|
Case "DECIMAL"
|
|
Dim oTextEdit As New TextEdit With {
|
|
.Name = Attribute.ID
|
|
}
|
|
Return oTextEdit
|
|
|
|
Case "FLOAT"
|
|
Dim oTextEdit As New TextEdit With {
|
|
.Name = Attribute.ID
|
|
}
|
|
Return oTextEdit
|
|
|
|
Case "VECTOR STRING"
|
|
Dim oLookupEdit As New LookupControl2 With {
|
|
.Name = Attribute.ID,
|
|
.MultiSelect = True,
|
|
.[ReadOnly] = True
|
|
}
|
|
Return oLookupEdit
|
|
|
|
Case Else
|
|
Dim oTextEdit As New TextEdit With {
|
|
.Name = Attribute.ID
|
|
}
|
|
Return oTextEdit
|
|
|
|
End Select
|
|
End Function
|
|
End Class
|