Merge branch 'master' of http://scmadmin@172.24.11.74:90/scm/git/RecordOrganizer
This commit is contained in:
@@ -165,7 +165,7 @@
|
|||||||
Public Shared Function UpdateControl(control As Control, properties As Object)
|
Public Shared Function UpdateControl(control As Control, properties As Object)
|
||||||
Try
|
Try
|
||||||
' Nach Typ den Update Befehl anpassen
|
' Nach Typ den Update Befehl anpassen
|
||||||
Dim CurrentType As String = control.GetType.Name
|
Dim type As String = control.GetType.Name
|
||||||
|
|
||||||
Dim SQL As String
|
Dim SQL As String
|
||||||
Dim NAME As String
|
Dim NAME As String
|
||||||
@@ -181,6 +181,21 @@
|
|||||||
Dim SHOW_COLUMN As Integer
|
Dim SHOW_COLUMN As Integer
|
||||||
Dim STATIC_LIST As String
|
Dim STATIC_LIST As String
|
||||||
|
|
||||||
|
' So sollte diese Funktion später mal aussehen :(
|
||||||
|
'Select Case type
|
||||||
|
' Case "TextBox"
|
||||||
|
' NAME = properties.Name
|
||||||
|
' MULTILINE = ClassConverter.BoolToInt(properties.Multiline)
|
||||||
|
' COL_NAME = ClassConverter.ToStringOrDefault(properties.ColumnTitle)
|
||||||
|
' DEFAULTVALUE = ClassConverter.ToStringOrDefault(properties.DefaultValue)
|
||||||
|
' SHOW_COLUMN = ClassConverter.BoolToInt(properties.ShowColumn)
|
||||||
|
' FORMAT_TYPE = properties.Format.ToString()
|
||||||
|
' REQUIRED = ClassConverter.BoolToInt(properties.IsRequired)
|
||||||
|
' READ_ONLY = ClassConverter.BoolToInt(properties.IsReadOnly)
|
||||||
|
' SQLCommand = ClassConverter.SQLValueToString(properties.SQLCommand)
|
||||||
|
'End Select
|
||||||
|
|
||||||
|
|
||||||
NAME = properties.Name
|
NAME = properties.Name
|
||||||
|
|
||||||
If propExists(properties, "Multiline") Then
|
If propExists(properties, "Multiline") Then
|
||||||
@@ -195,34 +210,36 @@
|
|||||||
COL_NAME = String.Empty
|
COL_NAME = String.Empty
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CurrentType = "RadioButton" AndAlso propExistsWithType(properties, "DefaultValue", GetType(Boolean)) Then
|
If type = "RadioButton" Then
|
||||||
DEFAULTVALUE = properties.DefaultValue
|
DEFAULTVALUE = properties.DefaultValue
|
||||||
ElseIf CurrentType = "CheckBox" AndAlso propExistsWithType(properties, "DefaultValue", GetType(Boolean)) Then
|
ElseIf type = "CheckBox" Then
|
||||||
DEFAULTVALUE = properties.DefaultValue
|
DEFAULTVALUE = properties.DefaultValue
|
||||||
ElseIf propExists(properties, "DefaultValue") Then
|
ElseIf type = "CheckBox" Then
|
||||||
DEFAULTVALUE = properties.DefaultValue
|
DEFAULTVALUE = properties.DefaultValue
|
||||||
Else
|
ElseIf type = "ComboBox" Then
|
||||||
DEFAULTVALUE = ""
|
DEFAULTVALUE = properties.DefaultValue
|
||||||
|
ElseIf type = "DateEdit" Then
|
||||||
|
DEFAULTVALUE = ClassConverter.ToDateTimePickerOptionsOrDefault(properties.DefaultValue)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CurrentType = "TextBox" OrElse
|
If type = "TextBox" OrElse
|
||||||
CurrentType = "ComboBox" OrElse
|
type = "ComboBox" OrElse
|
||||||
CurrentType = "CheckBox" OrElse
|
type = "CheckBox" OrElse
|
||||||
CurrentType = "RadioButton" OrElse
|
type = "RadioButton" OrElse
|
||||||
CurrentType = "CheckedListBoxControl" OrElse
|
type = "CheckedListBoxControl" OrElse
|
||||||
CurrentType = "ListBoxControl" Then
|
type = "ListBoxControl" Then
|
||||||
|
|
||||||
SHOW_COLUMN = BoolToInt(properties.ShowColumn)
|
SHOW_COLUMN = BoolToInt(properties.ShowColumn)
|
||||||
Else
|
Else
|
||||||
SHOW_COLUMN = BoolToInt(True)
|
SHOW_COLUMN = BoolToInt(True)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CurrentType = "TextBox" AndAlso propExists(properties, "Format") Then
|
If type = "TextBox" AndAlso propExists(properties, "Format") Then
|
||||||
FORMAT_TYPE = properties.Format.ToString
|
FORMAT_TYPE = properties.Format.ToString
|
||||||
ElseIf CurrentType = "ComboBox" AndAlso propExists(properties, "Format") Then
|
ElseIf type = "ComboBox" AndAlso propExists(properties, "Format") Then
|
||||||
FORMAT_TYPE = properties.Format.ToString
|
FORMAT_TYPE = properties.Format.ToString
|
||||||
Else
|
Else
|
||||||
FORMAT_TYPE = EnumFormat.String.ToString
|
FORMAT_TYPE = EnumFormatOptions.String.ToString
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If propExists(properties, "IsRequired") Then
|
If propExists(properties, "IsRequired") Then
|
||||||
|
|||||||
@@ -337,9 +337,9 @@ Public Class ClassControlCommandsUI
|
|||||||
If CONTROL_ID <> -1 Then
|
If CONTROL_ID <> -1 Then
|
||||||
CONTROL_VALUE = GetControlValue(ctrl)
|
CONTROL_VALUE = GetControlValue(ctrl)
|
||||||
End If
|
End If
|
||||||
If TypeName(ctrl).ToString = "DateEdit" Then
|
'If TypeName(ctrl).ToString = "DateEdit" Then
|
||||||
CONTROL_VALUE = CDate(CONTROL_VALUE)
|
' CONTROL_VALUE = CDate(CONTROL_VALUE)
|
||||||
End If
|
'End If
|
||||||
'If CONTROL_ID = 489 Then
|
'If CONTROL_ID = 489 Then
|
||||||
' Console.WriteLine(TypeName(ctrl))
|
' Console.WriteLine(TypeName(ctrl))
|
||||||
'End If
|
'End If
|
||||||
@@ -514,7 +514,13 @@ Public Class ClassControlCommandsUI
|
|||||||
Case "RadioButton"
|
Case "RadioButton"
|
||||||
Return DirectCast(ctrl, RadioButton).Checked.ToString()
|
Return DirectCast(ctrl, RadioButton).Checked.ToString()
|
||||||
Case "DateEdit"
|
Case "DateEdit"
|
||||||
Return DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).DateTime.ToString("yyyy-MM-dd")
|
Dim Value = DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).EditValue
|
||||||
|
|
||||||
|
If IsDBNull(Value) Then
|
||||||
|
Return ""
|
||||||
|
Else
|
||||||
|
Return DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).DateTime.ToString("yyyy-MM-dd")
|
||||||
|
End If
|
||||||
Case "PictureBox"
|
Case "PictureBox"
|
||||||
'Return "PictureBox" 'Es ist egal was für ein String hier zurückgegeben wird, hauptsache nicht Nothing
|
'Return "PictureBox" 'Es ist egal was für ein String hier zurückgegeben wird, hauptsache nicht Nothing
|
||||||
Case "CheckedListBoxControl"
|
Case "CheckedListBoxControl"
|
||||||
@@ -612,22 +618,19 @@ Public Class ClassControlCommandsUI
|
|||||||
Try
|
Try
|
||||||
Dim AddedWho = Environment.UserName
|
Dim AddedWho = Environment.UserName
|
||||||
Dim FORMAT_TYPE As String = ClassDatabase.Execute_Scalar("SELECT FORMAT_TYPE FROM TBPMO_CONTROL WHERE GUID = " & ControlID)
|
Dim FORMAT_TYPE As String = ClassDatabase.Execute_Scalar("SELECT FORMAT_TYPE FROM TBPMO_CONTROL WHERE GUID = " & ControlID)
|
||||||
Try
|
|
||||||
Select Case FORMAT_TYPE
|
|
||||||
Case "Currency"
|
|
||||||
If Not Value = String.Empty Then
|
|
||||||
Value = Decimal.Parse(Value, Globalization.NumberStyles.Currency).ToString
|
|
||||||
End If
|
|
||||||
|
|
||||||
Case "Decimal"
|
Select Case FORMAT_TYPE
|
||||||
If Not Value = String.Empty Then
|
Case "Currency"
|
||||||
Value = Decimal.Parse(Value, Globalization.NumberStyles.Integer)
|
If Not Value = String.Empty Then
|
||||||
End If
|
Value = Decimal.Parse(Value, Globalization.NumberStyles.Currency).ToString
|
||||||
|
End If
|
||||||
|
|
||||||
End Select
|
Case "Decimal"
|
||||||
Catch ex As Exception
|
If Not Value = String.Empty Then
|
||||||
ClassLogger.Add("Unerwarteter Fehler in Insert ConvertValue to Format'" & FORMAT_TYPE & "': " & ex.Message, True)
|
Value = Decimal.Parse(Value, Globalization.NumberStyles.Integer)
|
||||||
End Try
|
End If
|
||||||
|
|
||||||
|
End Select
|
||||||
|
|
||||||
Using conn As New SqlClient.SqlConnection(MyConnectionString)
|
Using conn As New SqlClient.SqlConnection(MyConnectionString)
|
||||||
Dim cmd As New SqlClient.SqlCommand("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID, RECORD_ID, VALUE, ADDED_WHO) VALUES (@CONTROL_ID, @RECORD_ID, @VALUE, @ADDED_WHO)", conn)
|
Dim cmd As New SqlClient.SqlCommand("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID, RECORD_ID, VALUE, ADDED_WHO) VALUES (@CONTROL_ID, @RECORD_ID, @VALUE, @ADDED_WHO)", conn)
|
||||||
@@ -653,19 +656,15 @@ Public Class ClassControlCommandsUI
|
|||||||
Try
|
Try
|
||||||
Dim CHANGED_WHO = Environment.UserName
|
Dim CHANGED_WHO = Environment.UserName
|
||||||
Dim FORMAT_TYPE As String = ClassDatabase.Execute_Scalar("SELECT FORMAT_TYPE FROM TBPMO_CONTROL WHERE GUID = " & ControlID)
|
Dim FORMAT_TYPE As String = ClassDatabase.Execute_Scalar("SELECT FORMAT_TYPE FROM TBPMO_CONTROL WHERE GUID = " & ControlID)
|
||||||
Try
|
|
||||||
If Not Value = String.Empty Then
|
|
||||||
Select Case FORMAT_TYPE
|
|
||||||
Case "Currency"
|
|
||||||
Value = Decimal.Parse(Value, Globalization.NumberStyles.Currency).ToString
|
|
||||||
Case "Decimal"
|
|
||||||
Value = Decimal.Parse(Value, Globalization.NumberStyles.Integer)
|
|
||||||
End Select
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As Exception
|
If Not Value = String.Empty Then
|
||||||
ClassLogger.Add("Unerwarteter Fehler in Update ConvertValue to Format'" & FORMAT_TYPE & "': " & ex.Message, True)
|
Select Case FORMAT_TYPE
|
||||||
End Try
|
Case "Currency"
|
||||||
|
Value = Decimal.Parse(Value, Globalization.NumberStyles.Currency).ToString
|
||||||
|
Case "Decimal"
|
||||||
|
Value = Decimal.Parse(Value, Globalization.NumberStyles.Integer)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
Using conn As New SqlClient.SqlConnection(MyConnectionString)
|
Using conn As New SqlClient.SqlConnection(MyConnectionString)
|
||||||
Dim cmd As New SqlClient.SqlCommand("UPDATE TBPMO_CONTROL_VALUE SET VALUE = @VALUE, CHANGED_WHO = @CHANGED_WHO WHERE CONTROL_ID = @CONTROL_ID AND RECORD_ID = @RECORD_ID", conn)
|
Dim cmd As New SqlClient.SqlCommand("UPDATE TBPMO_CONTROL_VALUE SET VALUE = @VALUE, CHANGED_WHO = @CHANGED_WHO WHERE CONTROL_ID = @CONTROL_ID AND RECORD_ID = @RECORD_ID", conn)
|
||||||
@@ -679,9 +678,6 @@ Public Class ClassControlCommandsUI
|
|||||||
Return True
|
Return True
|
||||||
End Using
|
End Using
|
||||||
|
|
||||||
'Dim SQL As String = "UPDATE TBPMO_CONTROL_VALUE SET VALUE = '" & Value & "', CHANGED_WHO = '" & CHANGED_WHO & "' WHERE CONTROL_ID = " & ControlID & " AND RECORD_ID = " & RecordID
|
|
||||||
'Return ClassDatabase.Execute_non_Query(Sql, True)
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ClassLogger.Add("Unerwarteter Fehler in UpdateControlValue: " & ex.Message, True)
|
ClassLogger.Add("Unerwarteter Fehler in UpdateControlValue: " & ex.Message, True)
|
||||||
Return False
|
Return False
|
||||||
|
|||||||
@@ -242,11 +242,11 @@ Module ClassControlProperties
|
|||||||
|
|
||||||
<CategoryAttribute("Ansichtseinstellungen")>
|
<CategoryAttribute("Ansichtseinstellungen")>
|
||||||
<DescriptionAttribute("Gibt das Format des Textes an.")>
|
<DescriptionAttribute("Gibt das Format des Textes an.")>
|
||||||
Public Property Format() As EnumFormat
|
Public Property Format() As EnumFormatOptions
|
||||||
Get
|
Get
|
||||||
Return _format
|
Return _format
|
||||||
End Get
|
End Get
|
||||||
Set(value As EnumFormat)
|
Set(value As EnumFormatOptions)
|
||||||
_format = value
|
_format = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -267,15 +267,15 @@ Module ClassControlProperties
|
|||||||
|
|
||||||
Private _master_data_id As Integer
|
Private _master_data_id As Integer
|
||||||
Private _static_list As String
|
Private _static_list As String
|
||||||
Private _format As EnumFormat
|
Private _format As EnumFormatOptions
|
||||||
|
|
||||||
<CategoryAttribute("Ansichtseinstellungen")>
|
<CategoryAttribute("Ansichtseinstellungen")>
|
||||||
<DescriptionAttribute("Gibt das Format des Textes an.")>
|
<DescriptionAttribute("Gibt das Format des Textes an.")>
|
||||||
Public Property Format() As EnumFormat
|
Public Property Format() As EnumFormatOptions
|
||||||
Get
|
Get
|
||||||
Return _format
|
Return _format
|
||||||
End Get
|
End Get
|
||||||
Set(value As EnumFormat)
|
Set(value As EnumFormatOptions)
|
||||||
_format = value
|
_format = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -304,6 +304,20 @@ Module ClassControlProperties
|
|||||||
End Class
|
End Class
|
||||||
Public Class DateTimePickerProperties
|
Public Class DateTimePickerProperties
|
||||||
Inherits InputControlProperties
|
Inherits InputControlProperties
|
||||||
|
|
||||||
|
Private _default_value As EnumDateTimePickerDefaultValueOptions = EnumDateTimePickerDefaultValueOptions.Empty
|
||||||
|
|
||||||
|
<CategoryAttribute("Sonstige Einstellungen")>
|
||||||
|
<DescriptionAttribute("Gibt den Standardwert dieses Elements an.")>
|
||||||
|
Public Overloads Property DefaultValue() As EnumDateTimePickerDefaultValueOptions
|
||||||
|
Get
|
||||||
|
Return _default_value
|
||||||
|
End Get
|
||||||
|
Set(value As EnumDateTimePickerDefaultValueOptions)
|
||||||
|
_default_value = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
Public Class CheckBoxProperties
|
Public Class CheckBoxProperties
|
||||||
Inherits InputControlProperties
|
Inherits InputControlProperties
|
||||||
|
|||||||
@@ -345,11 +345,25 @@ Public Class ClassControlValues
|
|||||||
End If
|
End If
|
||||||
Case GetType(DevExpress.XtraEditors.DateEdit)
|
Case GetType(DevExpress.XtraEditors.DateEdit)
|
||||||
Dim datepicker As DevExpress.XtraEditors.DateEdit = DirectCast(control, DevExpress.XtraEditors.DateEdit)
|
Dim datepicker As DevExpress.XtraEditors.DateEdit = DirectCast(control, DevExpress.XtraEditors.DateEdit)
|
||||||
If IsDBNull(autoValue) OrElse autoValue = "" OrElse autoValue = "False" Then
|
|
||||||
autoValue = Now
|
Dim result As EnumDateTimePickerDefaultValueOptions = EnumDateTimePickerDefaultValueOptions.Empty
|
||||||
|
Dim success = [Enum].TryParse(Of EnumDateTimePickerDefaultValueOptions)(autoValue, result)
|
||||||
|
|
||||||
|
If success Then
|
||||||
|
If result = EnumDateTimePickerDefaultValueOptions.Empty Then
|
||||||
|
' DBNull.Value leert das DateEdit control.
|
||||||
|
autoValue = DBNull.Value
|
||||||
|
ElseIf result = EnumDateTimePickerDefaultValueOptions.CurrentDate Then
|
||||||
|
autoValue = Now
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
'Wenn der DefaultWert nicht gelesen werden konnte, DateEdit leeren
|
||||||
|
autoValue = DBNull.Value
|
||||||
End If
|
End If
|
||||||
|
|
||||||
datepicker.DateTime = autoValue
|
' Mit EditValue kann man auch den angezeigten Wert leeren
|
||||||
|
'datepicker.DateTime = autoValue
|
||||||
|
datepicker.EditValue = autoValue
|
||||||
End Select
|
End Select
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Unexpected Error in LoadDefaultValue:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Unexpected Error in LoadDefaultValue:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
Public Class ClassControlValuesConverter
|
|
||||||
Public Shared Function ToBooleanOrDefault(value As Object, Optional defaultValue As Boolean = False)
|
|
||||||
Try
|
|
||||||
If IsDBNull(value) OrElse value = "" Then
|
|
||||||
Return defaultValue
|
|
||||||
Else
|
|
||||||
Return Convert.ToBoolean(value)
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
|
||||||
Return defaultValue
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Shared Function ToStringOrDefault(value As Object, Optional defaultValue As String = "")
|
|
||||||
Try
|
|
||||||
If IsDBNull(value) OrElse String.IsNullOrEmpty(value) Then
|
|
||||||
Return defaultValue
|
|
||||||
Else
|
|
||||||
Return Convert.ToString(value)
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
|
||||||
Return defaultValue
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
|
||||||
Public Shared Function ToIntOrDefault(value As Object, Optional defaultValue As Integer = 0)
|
|
||||||
Try
|
|
||||||
If IsDBNull(value) Then
|
|
||||||
Return defaultValue
|
|
||||||
Else
|
|
||||||
Return Convert.ToInt16(value)
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
|
||||||
Return defaultValue
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
88
app/DD-Record-Organiser/ClassConverter.vb
Normal file
88
app/DD-Record-Organiser/ClassConverter.vb
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
Public Class ClassConverter
|
||||||
|
|
||||||
|
' ------------- STRING TO TYPE -------------
|
||||||
|
|
||||||
|
Public Shared Function ToBooleanOrDefault(value As Object, Optional defaultValue As Boolean = False)
|
||||||
|
Try
|
||||||
|
If IsDBNull(value) OrElse value = "" Then
|
||||||
|
Return defaultValue
|
||||||
|
Else
|
||||||
|
Return Convert.ToBoolean(value)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Return defaultValue
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function ToStringOrDefault(value As Object, Optional defaultValue As String = "")
|
||||||
|
Try
|
||||||
|
If IsDBNull(value) OrElse String.IsNullOrEmpty(value) Then
|
||||||
|
Return defaultValue
|
||||||
|
Else
|
||||||
|
Return Convert.ToString(value)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Return defaultValue
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Shared Function ToIntOrDefault(value As Object, Optional defaultValue As Integer = 0)
|
||||||
|
Try
|
||||||
|
If IsDBNull(value) Then
|
||||||
|
Return defaultValue
|
||||||
|
Else
|
||||||
|
Return Convert.ToInt16(value)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Return defaultValue
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' ------------- TYPE TO TYPE -------------
|
||||||
|
|
||||||
|
Public Shared Function BoolToInt(bool As Boolean)
|
||||||
|
Return IIf(bool, 1, 0)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function IntToBoolOrDefault(int As Integer, Optional defaultValue As Boolean = False)
|
||||||
|
If int = 0 Then
|
||||||
|
Return False
|
||||||
|
ElseIf int = 1 Then
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
Return defaultValue
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' ------------- STRING TO ENUM -------------
|
||||||
|
|
||||||
|
Public Shared Function ToDateTimePickerOptionsOrDefault(value As String)
|
||||||
|
Try
|
||||||
|
If IsDBNull(value) OrElse String.IsNullOrEmpty(value) Then
|
||||||
|
Return EnumDateTimePickerDefaultValueOptions.Empty
|
||||||
|
Else
|
||||||
|
Dim result As EnumDateTimePickerDefaultValueOptions
|
||||||
|
Dim success = [Enum].TryParse(Of EnumDateTimePickerDefaultValueOptions)(value, result)
|
||||||
|
|
||||||
|
If success Then
|
||||||
|
Return result
|
||||||
|
Else
|
||||||
|
Return EnumDateTimePickerDefaultValueOptions.Empty
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Return EnumDateTimePickerDefaultValueOptions.Empty
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' ------------- TYPE TO STRING -------------
|
||||||
|
|
||||||
|
Public Shared Function SQLValueToString(value As SQLValue) As String
|
||||||
|
Dim cmd As String = value.Value
|
||||||
|
If cmd.Contains("'") Then
|
||||||
|
cmd = cmd.Replace("'", "''")
|
||||||
|
End If
|
||||||
|
Return cmd
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="ClassControlLoader.vb" />
|
<Compile Include="ClassControlLoader.vb" />
|
||||||
<Compile Include="ClassControlValueCache.vb" />
|
<Compile Include="ClassControlValueCache.vb" />
|
||||||
<Compile Include="ClassControlValuesConverter.vb" />
|
<Compile Include="ClassConverter.vb" />
|
||||||
<Compile Include="ClassFolderWatcher.vb" />
|
<Compile Include="ClassFolderWatcher.vb" />
|
||||||
<Compile Include="ClassJumpRecord.vb" />
|
<Compile Include="ClassJumpRecord.vb" />
|
||||||
<Compile Include="ClassLicence.vb" />
|
<Compile Include="ClassLicence.vb" />
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
Module ModuleHelperMethods
|
Module ModuleHelperMethods
|
||||||
|
|
||||||
Public Enum EnumFormat
|
Public Enum EnumFormatOptions
|
||||||
[String] = 0
|
[String] = 0
|
||||||
Currency = 1
|
Currency = 1
|
||||||
[Decimal] = 2
|
[Decimal] = 2
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Public Enum EnumDateTimePickerDefaultValueOptions
|
||||||
|
CurrentDate = 0
|
||||||
|
Empty = 1
|
||||||
|
End Enum
|
||||||
|
|
||||||
Public Function BoolToInt(bool As Boolean) As Integer
|
Public Function BoolToInt(bool As Boolean) As Integer
|
||||||
' Wandelt einen Boolean Wert in einen Int um
|
' Wandelt einen Boolean Wert in einen Int um
|
||||||
Return IIf(bool, 1, 0)
|
Return IIf(bool, 1, 0)
|
||||||
|
|||||||
@@ -23,6 +23,26 @@
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub LoadControlPropertiesNeu(ctrl As Control)
|
||||||
|
Try
|
||||||
|
'TODO: LoadControlProperties Neuschreiben!!!
|
||||||
|
Dim sql As String = String.Format("SELECT * FROM VWPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0}", ctrl.Tag)
|
||||||
|
Dim dt As DataTable = ClassDatabase.Execute_Scalar(sql)
|
||||||
|
Dim props As Object = Nothing
|
||||||
|
Dim row As DataRow = Nothing
|
||||||
|
|
||||||
|
If dt.Rows.Count <> 1 Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
row = dt.Rows(0)
|
||||||
|
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Error in loadcontrolproperties" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
' ADDED 25.11
|
' ADDED 25.11
|
||||||
' Lade Control Eigenschaften und zeige diese an
|
' Lade Control Eigenschaften und zeige diese an
|
||||||
' Wird von frmLevelDesigner aufgerufen
|
' Wird von frmLevelDesigner aufgerufen
|
||||||
@@ -52,48 +72,32 @@
|
|||||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||||
Case "Textbox"
|
Case "Textbox"
|
||||||
props = New TextBoxProperties()
|
props = New TextBoxProperties()
|
||||||
If Not IsDBNull(row.Item("CONTROL_DEF_VALUE")) Then
|
props.DefaultValue = ClassConverter.ToStringOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||||
props.DefaultValue = row.Item("CONTROL_DEF_VALUE")
|
|
||||||
Else
|
|
||||||
props.DefaultValue = ""
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not IsDBNull(row.Item("CONTROL_FORMAT_TYPE")) Then
|
If Not IsDBNull(row.Item("CONTROL_FORMAT_TYPE")) Then
|
||||||
props.Format = DirectCast([Enum].Parse(GetType(EnumFormat), row.Item("CONTROL_FORMAT_TYPE")), Integer)
|
props.Format = DirectCast([Enum].Parse(GetType(EnumFormatOptions), row.Item("CONTROL_FORMAT_TYPE")), Integer)
|
||||||
Else
|
Else
|
||||||
props.Format = "String"
|
props.Format = "String"
|
||||||
End If
|
End If
|
||||||
Case "Combobox"
|
Case "Combobox"
|
||||||
props = New ComboBoxProperties()
|
props = New ComboBoxProperties()
|
||||||
props.MasterDataId = row.Item("CTRLSCR_MASTER_DATA_ID")
|
props.MasterDataId = row.Item("CTRLSCR_MASTER_DATA_ID")
|
||||||
If Not IsDBNull(row.Item("CONTROL_DEF_VALUE")) Then
|
props.DefaultValue = ClassConverter.ToStringOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||||
props.DefaultValue = row.Item("CONTROL_DEF_VALUE")
|
|
||||||
Else
|
|
||||||
props.DefaultValue = ""
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not IsDBNull(row.Item("CONTROL_FORMAT_TYPE")) Then
|
If Not IsDBNull(row.Item("CONTROL_FORMAT_TYPE")) Then
|
||||||
props.Format = DirectCast([Enum].Parse(GetType(EnumFormat), row.Item("CONTROL_FORMAT_TYPE")), Integer)
|
props.Format = DirectCast([Enum].Parse(GetType(EnumFormatOptions), row.Item("CONTROL_FORMAT_TYPE")), Integer)
|
||||||
Else
|
Else
|
||||||
props.Format = "String"
|
props.Format = "String"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not IsDBNull(row.Item("CONTROL_STATIC_LIST")) Then
|
props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||||
props.StaticList = row.Item("CONTROL_STATIC_LIST")
|
|
||||||
Else
|
|
||||||
props.StaticList = ""
|
|
||||||
End If
|
|
||||||
Case "Checkbox"
|
Case "Checkbox"
|
||||||
props = New CheckBoxProperties()
|
props = New CheckBoxProperties()
|
||||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||||
|
props.DefaultValue = ClassConverter.ToBooleanOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||||
If IsDBNull(row.Item("CONTROL_DEF_VALUE")) Or row.Item("CONTROL_DEF_VALUE") = String.Empty Then
|
|
||||||
props.DefaultValue = False
|
|
||||||
Else
|
|
||||||
props.DefaultValue = row.Item("CONTROL_DEF_VALUE")
|
|
||||||
End If
|
|
||||||
Case "Datepicker"
|
Case "Datepicker"
|
||||||
props = New DateTimePickerProperties()
|
props = New DateTimePickerProperties()
|
||||||
|
props.DefaultValue = ClassConverter.ToDateTimePickerOptionsOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||||
Case "Datagridview"
|
Case "Datagridview"
|
||||||
props = New DataGridViewProperties()
|
props = New DataGridViewProperties()
|
||||||
Case "Groupbox"
|
Case "Groupbox"
|
||||||
@@ -105,33 +109,17 @@
|
|||||||
Case "RadioButton"
|
Case "RadioButton"
|
||||||
props = New RadioButtonProperties()
|
props = New RadioButtonProperties()
|
||||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||||
|
props.DefaultValue = ClassConverter.ToBooleanOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||||
props.DefaultValue = ClassControlValuesConverter.ToBooleanOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
|
||||||
'If Not IsDBNull(row.Item("CONTROL_DEF_VALUE")) Then
|
|
||||||
' props.DefaultValue = row.Item("CONTROL_DEF_VALUE")
|
|
||||||
'Else
|
|
||||||
' props.DefaultValue = False
|
|
||||||
'End If
|
|
||||||
Case "F_AddAppointment"
|
Case "F_AddAppointment"
|
||||||
props = New FunctionAddAppointment()
|
props = New FunctionAddAppointment()
|
||||||
Case "F_AddFormData"
|
Case "F_AddFormData"
|
||||||
props = New FunctionAddFormData()
|
props = New FunctionAddFormData()
|
||||||
Case "CheckedListBox"
|
Case "CheckedListBox"
|
||||||
props = New ComboBoxProperties()
|
props = New ComboBoxProperties()
|
||||||
|
props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||||
If Not IsDBNull(row.Item("CONTROL_STATIC_LIST")) Then
|
|
||||||
props.StaticList = row.Item("CONTROL_STATIC_LIST")
|
|
||||||
Else
|
|
||||||
props.StaticList = ""
|
|
||||||
End If
|
|
||||||
Case "ListBox"
|
Case "ListBox"
|
||||||
props = New ComboBoxProperties()
|
props = New ComboBoxProperties()
|
||||||
|
props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||||
If Not IsDBNull(row.Item("CONTROL_STATIC_LIST")) Then
|
|
||||||
props.StaticList = row.Item("CONTROL_STATIC_LIST")
|
|
||||||
Else
|
|
||||||
props.StaticList = ""
|
|
||||||
End If
|
|
||||||
Case Else
|
Case Else
|
||||||
MsgBox("Unknown control type " & type, MsgBoxStyle.Exclamation, "Error in LoadControlProperties:")
|
MsgBox("Unknown control type " & type, MsgBoxStyle.Exclamation, "Error in LoadControlProperties:")
|
||||||
End Select
|
End Select
|
||||||
|
|||||||
Reference in New Issue
Block a user