MS-KW39 Änderungen UpdateClass und VersionChecker
This commit is contained in:
@@ -314,33 +314,40 @@ Public Class ClassControlBuilder
|
||||
If TableResult.Rows.Count = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If IsNothing(value) Then 'Kein Value also abhängige Controls auf "Leer" setzen
|
||||
For Each row As DataRow In TableResult.Rows
|
||||
|
||||
' DependingControlId bezeichnet das Control, das die Abhängigkeit enthält
|
||||
Dim dependingControlId As Integer = row.Item("GUID")
|
||||
Dim panel As Panel = DirectCast(control.Parent, Panel)
|
||||
' Über die Id das Control finden
|
||||
Dim dependingControl As Control = panel.Controls.OfType(Of Control)().Where(Function(c As Control)
|
||||
Return DirectCast(c.Tag, ClassControlMetadata).Id = dependingControlId
|
||||
End Function).SingleOrDefault()
|
||||
Dim type = dependingControl.GetType().Name
|
||||
Select Case type
|
||||
Case "CustomComboBox"
|
||||
DirectCast(dependingControl, CustomComboBox).DataSource = Nothing
|
||||
Case "CheckedListBoxControl"
|
||||
DirectCast(dependingControl, DevExpress.XtraEditors.CheckedListBoxControl).DataSource = Nothing
|
||||
Case "Label"
|
||||
DirectCast(dependingControl, Label).Text = ""
|
||||
Case "TextBox"
|
||||
DirectCast(dependingControl, TextBox).Text = ""
|
||||
Case "GridControl"
|
||||
DirectCast(dependingControl, DevExpress.XtraGrid.GridControl).DataSource = Nothing
|
||||
End Select
|
||||
|
||||
Next
|
||||
If CURRENT_RECORD_ID = 0 Or CONTROL_ID = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
If IsNothing(value) Then 'Kein Value also abhängige Controls auf "Leer" setzen
|
||||
Try
|
||||
For Each row As DataRow In TableResult.Rows
|
||||
' DependingControlId bezeichnet das Control, das die Abhängigkeit enthält
|
||||
Dim dependingControlId As Integer = row.Item("GUID")
|
||||
Dim panel As Panel = DirectCast(control.Parent, Panel)
|
||||
' Über die Id das Control finden
|
||||
Dim dependingControl As Control = panel.Controls.OfType(Of Control)().Where(Function(c As Control)
|
||||
Return DirectCast(c.Tag, ClassControlMetadata).Id = dependingControlId
|
||||
End Function).SingleOrDefault()
|
||||
Dim type = dependingControl.GetType().Name
|
||||
Select Case type
|
||||
Case "CustomComboBox"
|
||||
DirectCast(dependingControl, CustomComboBox).DataSource = Nothing
|
||||
Case "CheckedListBoxControl"
|
||||
DirectCast(dependingControl, DevExpress.XtraEditors.CheckedListBoxControl).DataSource = Nothing
|
||||
Case "Label"
|
||||
DirectCast(dependingControl, Label).Text = ""
|
||||
Case "TextBox"
|
||||
DirectCast(dependingControl, TextBox).Text = ""
|
||||
Case "GridControl"
|
||||
DirectCast(dependingControl, DevExpress.XtraGrid.GridControl).DataSource = Nothing
|
||||
End Select
|
||||
|
||||
Next
|
||||
Exit Sub
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected error in DependingControls (For Each row As DataRow In TableResult.Rows)- " & CONTROL_ID.ToString & ": " & ex.Message, MsgBoxStyle.Critical)
|
||||
Exit Sub
|
||||
End Try
|
||||
|
||||
|
||||
End If
|
||||
For Each row As DataRow In TableResult.Rows
|
||||
@@ -356,20 +363,7 @@ Public Class ClassControlBuilder
|
||||
If match.Success Then
|
||||
Dim sqlguid = String.Format("SELECT GUID FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", CONTROL_ID, CURRENT_RECORD_ID)
|
||||
Dim ctrlvalID = ClassDatabase.Execute_Scalar(sqlguid, True)
|
||||
'Select Case row.Item("FORMAT_TYPE")
|
||||
' Case "Currency"
|
||||
' value = Decimal.Parse(value, Globalization.NumberStyles.Currency).ToString
|
||||
' Case "Decimal"
|
||||
' value = Decimal.Parse(value, Globalization.NumberStyles.Integer)
|
||||
'End Select
|
||||
'Select Case row.Item("CONTROL_TYPE_ID")
|
||||
' Case 4 'DatePicker
|
||||
' Try
|
||||
' value = CStr(CDate(value)) 'Format(value, "dd-MM-yyyy"))
|
||||
' Catch ex As Exception
|
||||
' ClassLogger.Add("Unexpected Error in converting Value '" & value & "' to date - Control-ID: " & CONTROL_ID.ToString & "- Error: " & ex.Message)
|
||||
' End Try
|
||||
'End Select
|
||||
|
||||
' Diese Abfrage verhindert, dass Werte, die aus z.B. CheckedListBoxen kommen,
|
||||
' nicht überschrieben werden. Diese Werte werden bereits mit UpdateMultipleValues gespeichert
|
||||
If (Not value.Contains(";")) Then
|
||||
|
||||
Reference in New Issue
Block a user