jj 24.10 delete value for dateedit when no date

This commit is contained in:
Jonathan Jenne 2017-10-24 16:45:41 +02:00
parent 96a9487130
commit 024d5222f7

View File

@ -543,12 +543,27 @@ Public Class ClassControlCommandsUI
End If
End If
Else ' Update Control
If Not IsNothing(CONTROL_VALUE) Then
Dim sw2 As New SW("UpdateControlValue")
UpdateControlValue(CONTROL_ID, RecordID, CONTROL_VALUE, CURRENT_ENTITY_ID)
sw2.Done()
If TypeOf ctrl Is DevExpress.XtraEditors.DateEdit And (IsNothing(CONTROL_VALUE) Or CONTROL_VALUE = String.Empty) Then
Dim sql As String = $"DELETE FROM TBPMO_CONTROL_VALUE WHERE RECORD_ID = {RecordID} AND CONTROL_ID = {CONTROL_ID}"
If ClassDatabase.Execute_non_Query(sql) = True Then
If LICENSE_PROXY = True Or clsDatabase.DB_PROXY_INITIALIZED = True Then
ClassDatabase.Execute_non_Query(sql, True)
End If
End If
Else
If Not IsNothing(CONTROL_VALUE) Then
Dim sw2 As New SW("UpdateControlValue")
UpdateControlValue(CONTROL_ID, RecordID, CONTROL_VALUE, CURRENT_ENTITY_ID)
sw2.Done()
End If
End If
End If
Next
sw.Done()
@ -624,7 +639,7 @@ Public Class ClassControlCommandsUI
Case "DateEdit"
Dim Value = DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).EditValue
If IsDBNull(Value) Then
If IsDBNull(Value) Or IsNothing(Value) Then
Return ""
Else
Return DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).DateTime.ToString("yyyy-MM-dd")