jj 24.10 delete value for dateedit when no date
This commit is contained in:
@@ -543,12 +543,27 @@ Public Class ClassControlCommandsUI
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Else ' Update Control
|
Else ' Update Control
|
||||||
If Not IsNothing(CONTROL_VALUE) Then
|
If TypeOf ctrl Is DevExpress.XtraEditors.DateEdit And (IsNothing(CONTROL_VALUE) Or CONTROL_VALUE = String.Empty) Then
|
||||||
Dim sw2 As New SW("UpdateControlValue")
|
|
||||||
UpdateControlValue(CONTROL_ID, RecordID, CONTROL_VALUE, CURRENT_ENTITY_ID)
|
Dim sql As String = $"DELETE FROM TBPMO_CONTROL_VALUE WHERE RECORD_ID = {RecordID} AND CONTROL_ID = {CONTROL_ID}"
|
||||||
sw2.Done()
|
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
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
sw.Done()
|
sw.Done()
|
||||||
@@ -624,7 +639,7 @@ Public Class ClassControlCommandsUI
|
|||||||
Case "DateEdit"
|
Case "DateEdit"
|
||||||
Dim Value = DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).EditValue
|
Dim Value = DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).EditValue
|
||||||
|
|
||||||
If IsDBNull(Value) Then
|
If IsDBNull(Value) Or IsNothing(Value) Then
|
||||||
Return ""
|
Return ""
|
||||||
Else
|
Else
|
||||||
Return DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).DateTime.ToString("yyyy-MM-dd")
|
Return DirectCast(ctrl, DevExpress.XtraEditors.DateEdit).DateTime.ToString("yyyy-MM-dd")
|
||||||
|
|||||||
Reference in New Issue
Block a user