MS_04.01
This commit is contained in:
@@ -355,7 +355,7 @@ Public Class ClassControlBuilder
|
||||
Dim match As System.Text.RegularExpressions.Match = regex.Match(sqlcommand)
|
||||
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)
|
||||
Dim ctrlvalID = ClassDatabase.Execute_Scalar(sqlguid, True)
|
||||
Select Case row.Item("FORMAT_TYPE")
|
||||
Case "Currency"
|
||||
value = Decimal.Parse(value, Globalization.NumberStyles.Currency).ToString
|
||||
@@ -374,15 +374,24 @@ Public Class ClassControlBuilder
|
||||
' nicht überschrieben werden. Diese Werte werden bereits mit UpdateMultipleValues gespeichert
|
||||
If (Not value.Contains(";")) Then
|
||||
If Not IsNothing(ctrlvalID) Then
|
||||
Dim upd1 = String.Format("UPDATE TBPMO_CONTROL_VALUE SET VALUE = '{0}',CHANGE_STEP = {1},CHANGED_WHO = '{2}' WHERE CONTROL_ID = {3} AND RECORD_ID = {4}", _
|
||||
value.ToString, CURRENT_CHANGE_STEP, USER_USERNAME, CONTROL_ID, CURRENT_RECORD_ID)
|
||||
If ClassDatabase.Execute_non_Query(upd1, True) = False Then
|
||||
|
||||
If ClassControlCommandsUI.UpdateControlValue(CONTROL_ID, CURRENT_RECORD_ID, value.ToString) = False Then
|
||||
ClassLogger.Add(" >> Check Update depending control (XX) value as Update was not successful'", False)
|
||||
Else
|
||||
' & upd & "'")
|
||||
End If
|
||||
'Dim upd1 = String.Format("UPDATE TBPMO_CONTROL_VALUE SET VALUE = '{0}',CHANGE_STEP = {1},CHANGED_WHO = '{2}' WHERE CONTROL_ID = {3} AND RECORD_ID = {4}", _
|
||||
' value.ToString, CURRENT_CHANGE_STEP, USER_USERNAME, CONTROL_ID, CURRENT_RECORD_ID)
|
||||
'If ClassDatabase.Execute_non_Query(upd1) = False Then
|
||||
|
||||
'End If
|
||||
Else
|
||||
If CURRENT_RECORD_ID <> 0 Then
|
||||
Dim ins = String.Format("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID,RECORD_ID,VALUE,ADDED_WHO) VALUES ({0},{1},'{2}','{3}')", CONTROL_ID, CURRENT_RECORD_ID, value, USER_USERNAME)
|
||||
ClassDatabase.Execute_non_Query(ins)
|
||||
If ClassControlCommandsUI.InsertControlValue(CONTROL_ID, CURRENT_RECORD_ID, value) = False Then
|
||||
ClassLogger.Add(" >> Check Insert depending control (XXX) value as it was nothing and Insert was not successful", False)
|
||||
Else
|
||||
ClassProxy.Refresh_Control_Data()
|
||||
End If
|
||||
End If
|
||||
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was nothing - Inserted the ControlValue '" & ins & "'")
|
||||
@@ -400,9 +409,9 @@ Public Class ClassControlBuilder
|
||||
End Function).SingleOrDefault()
|
||||
|
||||
sqlcommand = sqlcommand.Replace(match.Groups(1).Value, value)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> " & String.Format("Executing SQL_COMMAND: '{0}' for controlID '{1}'", sqlcommand, dependingControlId))
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> " & String.Format("Executing SQL_COMMAND: '{0}' for controlID '{1}'", sqlcommand, dependingControlId), False)
|
||||
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(sqlcommand)
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(sqlcommand, True)
|
||||
Dim type = dependingControl.GetType().Name
|
||||
|
||||
Select Case type
|
||||
@@ -422,27 +431,32 @@ Public Class ClassControlBuilder
|
||||
|
||||
ControlLoader.DateTimePicker.LoadValue(dependingControl, dateValue)
|
||||
Dim sql1 = String.Format("SELECT GUID FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", dependingControlId, CURRENT_RECORD_ID)
|
||||
Dim id = ClassDatabase.Execute_Scalar(sql1)
|
||||
Dim id = ClassDatabase.Execute_Scalar(sql1, True)
|
||||
|
||||
If Not IsNothing(id) Then
|
||||
Dim upd = String.Format("UPDATE TBPMO_CONTROL_VALUE SET VALUE = '{0}', CHANGED_WHO = '{1}' WHERE GUID = {2}", dateValue, USER_USERNAME, id)
|
||||
If ClassDatabase.Execute_non_Query(upd, True) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was not nothing - Updated the ControlValue '" & upd)
|
||||
'Dim upd = String.Format("UPDATE TBPMO_CONTROL_VALUE SET VALUE = '{0}', CHANGED_WHO = '{1}' WHERE GUID = {2}", dateValue, USER_USERNAME, id)
|
||||
If ClassControlCommandsUI.UpdateControlValue(dependingControlId, CURRENT_RECORD_ID, dateValue) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was not nothing - Updated the ControlValue'", False) '" & upd)
|
||||
Else
|
||||
ClassLogger.Add(" >> Check Update depending control value as it was nothing and Update was not successful - Update-Command '" & upd & "'")
|
||||
ClassLogger.Add(" >> Check Update depending control (DateEdit) value as it was nothing and Update was not successful - Update-Command '", False) ' & upd & "'")
|
||||
End If
|
||||
|
||||
Else
|
||||
Dim ins = String.Format("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID,RECORD_ID,VALUE,ADDED_WHO) VALUES ({0},{1},'{2}','{3}')", dependingControlId, CURRENT_RECORD_ID, dateValue, USER_USERNAME)
|
||||
If ClassDatabase.Execute_non_Query(ins) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was nothing - Inserted the ControlValue '" & ins & "'")
|
||||
If ClassControlCommandsUI.InsertControlValue(dependingControlId, CURRENT_RECORD_ID, dateValue) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was nothing - Inserted the ControlValue (DateEdit)!", False)
|
||||
Else
|
||||
ClassLogger.Add(" >> Check Insert depending control value as it was nothing and Insert was not successful- Insert-Command '" & ins & "'")
|
||||
ClassLogger.Add(" >> Check Insert depending control (DateEdit)value as it was nothing and Insert was not successful", False)
|
||||
End If
|
||||
'Dim ins = String.Format("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID,RECORD_ID,VALUE,ADDED_WHO) VALUES ({0},{1},'{2}','{3}')", dependingControlId, CURRENT_RECORD_ID, dateValue, USER_USERNAME)
|
||||
'If ClassDatabase.Execute_non_Query(ins) = True Then
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was nothing - Inserted the ControlValue '" & ins & "'")
|
||||
'Else
|
||||
' ClassLogger.Add(" >> Check Insert depending control value as it was nothing and Insert was not successful- Insert-Command '" & ins & "'")
|
||||
'End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpectet Error in OnComboBoxValueChanged - TextBox: " & ex.Message, True)
|
||||
ClassLogger.Add("Unexpected Error in OnComboBoxValueChanged - TextBox: " & ex.Message, True)
|
||||
End Try
|
||||
Else
|
||||
ClassLogger.Add(" >> Attention: RowCount for depending control was '" & dt.Rows.Count.ToString & "' and not 1 as expected - Check SQL: '" & sqlcommand & "'")
|
||||
@@ -461,7 +475,7 @@ Public Class ClassControlBuilder
|
||||
|
||||
|
||||
'ClassControlValues.LoadControlValue(CURRENT_RECORD_ID, CURRENT_PARENT_RECORD_ID, dependingControlId, dependingControl, values, CURRENT_ENTITY_ID)
|
||||
|
||||
|
||||
ControlLoader.CheckedListBox.LoadValue(checkedlistbox, values)
|
||||
If IsEdit Or IsInsert Then
|
||||
CURRENT_RECORD_ENABLED = True
|
||||
@@ -481,23 +495,33 @@ Public Class ClassControlBuilder
|
||||
Dim value1 As String = dt.Rows(0).Item(0)
|
||||
ControlLoader.TextBox.LoadValue(DirectCast(dependingControl, TextBox), 9999, 9999, value1, 999, True)
|
||||
Dim sqltextbox = String.Format("SELECT GUID FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", dependingControlId, CURRENT_RECORD_ID)
|
||||
Dim id = ClassDatabase.Execute_Scalar(sqltextbox)
|
||||
Dim id = ClassDatabase.Execute_Scalar(sqltextbox, True)
|
||||
|
||||
If Not IsNothing(id) Then
|
||||
Dim upd = String.Format("UPDATE TBPMO_CONTROL_VALUE SET VALUE = '{0}', CHANGED_WHO = '{1}' WHERE GUID = {2}", value1, USER_USERNAME, id)
|
||||
If ClassDatabase.Execute_non_Query(upd, True) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was not nothing - Updated the ControlValue '" & upd)
|
||||
If ClassControlCommandsUI.UpdateControlValue(dependingControlId, CURRENT_RECORD_ID, value1) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was not nothing - Updated the ControlValue'", False) '" & upd)
|
||||
Else
|
||||
ClassLogger.Add(" >> Check Update depending control value as it was nothing and Update was not successful - Update-Command '" & upd & "'")
|
||||
ClassLogger.Add(" >> Check Update depending control (TextBox) value as it was nothing and Update was not successful - Update-Command '", False) ' & upd & "'")
|
||||
End If
|
||||
'Dim upd = String.Format("UPDATE TBPMO_CONTROL_VALUE SET VALUE = '{0}', CHANGED_WHO = '{1}' WHERE GUID = {2}", value1, USER_USERNAME, id)
|
||||
'If ClassDatabase.Execute_non_Query(upd) = True Then
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was not nothing - Updated the ControlValue '" & upd)
|
||||
'Else
|
||||
' ClassLogger.Add(" >> Check Update depending control value as it was nothing and Update was not successful - Update-Command '" & upd & "'")
|
||||
'End If
|
||||
|
||||
Else
|
||||
Dim ins = String.Format("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID,RECORD_ID,VALUE,ADDED_WHO) VALUES ({0},{1},'{2}','{3}')", dependingControlId, CURRENT_RECORD_ID, value1, USER_USERNAME)
|
||||
If ClassDatabase.Execute_non_Query(ins) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was nothing - Inserted the ControlValue '" & ins & "'")
|
||||
If ClassControlCommandsUI.InsertControlValue(dependingControlId, CURRENT_RECORD_ID, value1) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was nothing - Inserted the ControlValue (TextBox)!", False)
|
||||
Else
|
||||
ClassLogger.Add(" >> Check Insert depending control value as it was nothing and Insert was not successful- Insert-Command '" & ins & "'")
|
||||
ClassLogger.Add(" >> Check Insert depending control (TextBox) value as it was nothing and Insert was not successful", False)
|
||||
End If
|
||||
'Dim ins = String.Format("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID,RECORD_ID,VALUE,ADDED_WHO) VALUES ({0},{1},'{2}','{3}')", dependingControlId, CURRENT_RECORD_ID, value1, USER_USERNAME)
|
||||
'If ClassDatabase.Execute_non_Query(ins) = True Then
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Value was nothing - Inserted the ControlValue '" & ins & "'")
|
||||
'Else
|
||||
' ClassLogger.Add(" >> Check Insert depending control value as it was nothing and Insert was not successful- Insert-Command '" & ins & "'")
|
||||
'End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -520,6 +544,7 @@ Public Class ClassControlBuilder
|
||||
|
||||
End If
|
||||
Next
|
||||
ClassProxy.Refresh_Control_Data()
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected error in DependingControls - " & CONTROL_ID.ToString & ": " & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
@@ -735,11 +760,11 @@ Public Class ClassControlBuilder
|
||||
'End If
|
||||
|
||||
Dim SQL1 As String = String.Format("SELECT * FROM VWPMO_VALUES WHERE RECORD_ID = {0}", CURRENT_RECORD_ID)
|
||||
Dim DT_ControlValues As DataTable = ClassDatabase.Return_Datatable(SQL1, "LoadControlValues")
|
||||
Dim DT_ControlValues As DataTable = ClassDatabase.Return_Datatable(SQL1, True)
|
||||
CURRENT_CONTROL_VALUES = DT_ControlValues
|
||||
|
||||
Dim datatable As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||
Dim datatable1 As DataTable = ClassDatabase.Return_Datatable(SQLenable)
|
||||
Dim datatable As DataTable = ClassDatabase.Return_Datatable(SQL, True)
|
||||
Dim datatable1 As DataTable = ClassDatabase.Return_Datatable(SQLenable, True)
|
||||
Depending_Controls(control, datatable, CONTROL_VALUE)
|
||||
If IsNothing(CONTROL_VALUE) Then
|
||||
Exit Sub
|
||||
@@ -790,7 +815,7 @@ Public Class ClassControlBuilder
|
||||
'End If
|
||||
|
||||
Dim SQL1 As String = String.Format("SELECT * FROM VWPMO_VALUES WHERE RECORD_ID = {0}", CURRENT_RECORD_ID)
|
||||
Dim DT_ControlValues As DataTable = ClassDatabase.Return_Datatable(SQL1, "LoadControlValues")
|
||||
Dim DT_ControlValues As DataTable = ClassDatabase.Return_Datatable(SQL1, True)
|
||||
CURRENT_CONTROL_VALUES = DT_ControlValues
|
||||
|
||||
Dim datatable As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||
|
||||
Reference in New Issue
Block a user