DAtabase integriert
This commit is contained in:
@@ -283,7 +283,7 @@ Public Class ClassControlBuilder
|
||||
For Each row As DataRow In TableResult.Rows
|
||||
Dim sqlcommand As String = row.Item("SQL_COMMAND_2")
|
||||
Dim msg = String.Format("Working on enabling control {0} - SQL: {1}", CONTROL_ID.ToString, sqlcommand)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
If IsNothing(sqlcommand) Then
|
||||
Continue For
|
||||
End If
|
||||
@@ -291,7 +291,7 @@ Public Class ClassControlBuilder
|
||||
' Versuchen, die RecordId zu ersetzen, falls eine existiert
|
||||
sqlcommand = sqlcommand.ToUpper.Replace("@RECORD_ID", CURRENT_RECORD_ID)
|
||||
msg = String.Format("sqlcommand-replaced1: {0}", sqlcommand)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
' ControlId Platzhalter suchen und ersetzen
|
||||
Dim regex As New System.Text.RegularExpressions.Regex("(@(\d+)@)")
|
||||
Dim match As System.Text.RegularExpressions.Match = regex.Match(sqlcommand)
|
||||
@@ -306,11 +306,11 @@ Public Class ClassControlBuilder
|
||||
End Function).SingleOrDefault()
|
||||
' Wir ersetzen den platzhalter im sql command mit dem übergebenen wert
|
||||
sqlcommand = sqlcommand.Replace(match.Groups(1).Value, value)
|
||||
LOGGER.Debug("" & String.Format("Executing SQL_COMMAND: {0} for controlID {1}", sqlcommand, dependingControlId), False)
|
||||
LOGGER.Debug("" & String.Format("Executing SQL_COMMAND: {0} for controlID {1}", sqlcommand, dependingControlId))
|
||||
|
||||
' Jetzt wird das SQL Command ausgeführt, es MUSS einen Boolschen Wert zurückgeben, True, False, 0, 1
|
||||
Dim dt_result As DataTable = Nothing
|
||||
dt_result = ClassDatabase.Return_Datatable(sqlcommand)
|
||||
dt_result = MYDB_ECM.GetDatatable(sqlcommand)
|
||||
|
||||
If dt_result.Rows.Count = 1 Then
|
||||
Dim enabled As Boolean = True
|
||||
@@ -324,14 +324,14 @@ Public Class ClassControlBuilder
|
||||
|
||||
If enabled = False Then
|
||||
msg = String.Format("Control {0} will be disabled." & vbNewLine, dependingControlId.ToString)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
Else
|
||||
msg = String.Format("Control {0} will be enabled." & vbNewLine, dependingControlId.ToString)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
End If
|
||||
dependingControl.Enabled = enabled
|
||||
Else
|
||||
LOGGER.Warn("Attention: RowCount for enabling control (" & dependingControlId.ToString & ") was '" & dt_result.Rows.Count.ToString & "' and not 1 as expected - Check SQL: '" & sqlcommand & "'", False)
|
||||
LOGGER.Warn("Attention: RowCount for enabling control (" & dependingControlId.ToString & ") was '" & dt_result.Rows.Count.ToString & "' and not 1 as expected - Check SQL: '" & sqlcommand & "'")
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -381,7 +381,7 @@ Public Class ClassControlBuilder
|
||||
|
||||
|
||||
End If
|
||||
LOGGER.Debug("DependingControls - For Each row As DataRow In TableResult.Rows", False, False)
|
||||
LOGGER.Debug("DependingControls - For Each row As DataRow In TableResult.Rows")
|
||||
For Each row As DataRow In TableResult.Rows
|
||||
Dim sqlcommand As String = row.Item("SQL_COMMAND_1")
|
||||
|
||||
@@ -394,7 +394,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, True)
|
||||
Dim ctrlvalID = MYDB_ECM.ExecuteNonQuery(sqlguid)
|
||||
|
||||
' Diese Abfrage verhindert, dass Werte, die aus z.B. CheckedListBoxen kommen,
|
||||
' nicht überschrieben werden. Diese Werte werden bereits mit UpdateMultipleValues gespeichert
|
||||
@@ -402,15 +402,15 @@ Public Class ClassControlBuilder
|
||||
If Not IsNothing(ctrlvalID) Then
|
||||
|
||||
If ClassControlCommandsUI.UpdateControlValue(CONTROL_ID, CURRENT_RECORD_ID, value.ToString, CURRENT_ENTITY_ID) = False Then
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.UpdateControlValue (1) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, value), False)
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.UpdateControlValue (1) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, value))
|
||||
Else
|
||||
ControlsChanged.Remove(CONTROL_ID)
|
||||
End If
|
||||
Else
|
||||
LOGGER.Debug("ctrlvalID is Nothing - Attention.....", False, False)
|
||||
LOGGER.Debug("ctrlvalID is Nothing - Attention.....")
|
||||
If CURRENT_RECORD_ID <> 0 Then
|
||||
If ClassControlCommandsUI.CreateControlProcedure(CONTROL_ID, CURRENT_RECORD_ID, value, CURRENT_ENTITY_ID) = 0 Then
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.CreateControlProcedure (1) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, value), False)
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.CreateControlProcedure (1) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, value))
|
||||
Else
|
||||
ControlsChanged.Remove(CONTROL_ID)
|
||||
End If
|
||||
@@ -421,7 +421,7 @@ Public Class ClassControlBuilder
|
||||
' DependingControlId bezeichnet das Control, das die Abhängigkeit enthält
|
||||
Dim dependingControlId As Integer = row.Item("GUID")
|
||||
If dependingControlId > 0 Then
|
||||
LOGGER.Debug("dependingControlId: " + dependingControlId.ToString, False, False)
|
||||
LOGGER.Debug("dependingControlId: " + dependingControlId.ToString)
|
||||
End If
|
||||
Dim panel As Panel = Me.MasterPanel
|
||||
'Dim panel As Panel = DirectCast(control.Parent, Panel)
|
||||
@@ -435,9 +435,9 @@ Public Class ClassControlBuilder
|
||||
End If
|
||||
|
||||
sqlcommand = sqlcommand.Replace(match.Groups(1).Value, value)
|
||||
LOGGER.Debug("" & String.Format("Executing SQL_COMMAND: '{0}' for controlID '{1}'", sqlcommand, dependingControlId), False)
|
||||
LOGGER.Debug("" & String.Format("Executing SQL_COMMAND: '{0}' for controlID '{1}'", sqlcommand, dependingControlId))
|
||||
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(sqlcommand, True)
|
||||
Dim dt As DataTable = MYDB_ECM.GetDatatable(sqlcommand)
|
||||
Dim type = dependingControl.GetType().Name
|
||||
|
||||
Select Case type
|
||||
@@ -457,23 +457,23 @@ 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, True)
|
||||
Dim id = MYDB_ECM.ExecuteNonQuery(sql1)
|
||||
|
||||
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 ClassControlCommandsUI.UpdateControlValue(dependingControlId, CURRENT_RECORD_ID, dateValue, CURRENT_ENTITY_ID) = True Then
|
||||
ControlsChanged.Remove(dependingControlId)
|
||||
LOGGER.Debug("Value was not nothing - Updated the ControlValue'", False) '" & upd)
|
||||
LOGGER.Debug("Value was not nothing - Updated the ControlValue'") '" & upd)
|
||||
Else
|
||||
LOGGER.Warn("Check Update depending control (DateEdit) value as it was nothing and Update was not successful - Update-Command '", False) ' & upd & "'")
|
||||
LOGGER.Warn("Check Update depending control (DateEdit) value as it was nothing and Update was not successful - Update-Command '") ' & upd & "'")
|
||||
End If
|
||||
|
||||
Else
|
||||
If ClassControlCommandsUI.CreateControlProcedure(dependingControlId, CURRENT_RECORD_ID, dateValue, CURRENT_ENTITY_ID) = 1 Then
|
||||
ControlsChanged.Remove(dependingControlId)
|
||||
LOGGER.Debug("Value was nothing - Inserted the ControlValue (DateEdit)!", False)
|
||||
LOGGER.Debug("Value was nothing - Inserted the ControlValue (DateEdit)!")
|
||||
Else
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.InsertControlValue (DateEdit) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, dateValue), False)
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.InsertControlValue (DateEdit) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, dateValue))
|
||||
|
||||
End If
|
||||
|
||||
@@ -488,10 +488,10 @@ Public Class ClassControlBuilder
|
||||
Case "CustomComboBox"
|
||||
ControlLoader.Combobox.SetDataSource(DirectCast(dependingControl, CustomComboBox), dt)
|
||||
Case "CheckedListBoxControl"
|
||||
LOGGER.Debug("DependingControls - CheckedListBoxControl", False, False)
|
||||
LOGGER.Debug("DependingControls - CheckedListBoxControl")
|
||||
Dim checkedlistbox = DirectCast(dependingControl, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
If IsNothing(checkedlistbox) Then
|
||||
LOGGER.Debug("checkedlistbox is Nothing - Attention.....", False, False)
|
||||
LOGGER.Debug("checkedlistbox is Nothing - Attention.....")
|
||||
End If
|
||||
ControlLoader.CheckedListBox.SetDataSource(checkedlistbox, dt)
|
||||
|
||||
@@ -520,17 +520,17 @@ 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, True)
|
||||
Dim id = MYDB_ECM.ExecuteNonQuery(sqltextbox)
|
||||
|
||||
If Not IsNothing(id) Then
|
||||
If ClassControlCommandsUI.UpdateControlValue(dependingControlId, CURRENT_RECORD_ID, value1, CURRENT_ENTITY_ID) = True Then
|
||||
LOGGER.Debug("Value was not nothing - Updated the ControlValue'", False) '" & upd)
|
||||
LOGGER.Debug("Value was not nothing - Updated the ControlValue'") '" & upd)
|
||||
ControlsChanged.Remove(dependingControlId)
|
||||
Else
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.UpdateControlValue (TextBox) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, value1), False)
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.UpdateControlValue (TextBox) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, value1))
|
||||
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 MYDB_ECM.ExecuteNonQuery(upd) = True Then
|
||||
' LOGGER.Debug("Value was not nothing - Updated the ControlValue '" & upd)
|
||||
'Else
|
||||
' Logger.Warn("Check Update depending control value as it was nothing and Update was not successful - Update-Command '" & upd & "'")
|
||||
@@ -539,9 +539,9 @@ Public Class ClassControlBuilder
|
||||
Else
|
||||
If ClassControlCommandsUI.CreateControlProcedure(dependingControlId, CURRENT_RECORD_ID, value1, CURRENT_ENTITY_ID) = 1 Then
|
||||
ControlsChanged.Remove(dependingControlId)
|
||||
LOGGER.Debug("Value was nothing - Inserted the ControlValue (TextBox)!", False)
|
||||
LOGGER.Debug("Value was nothing - Inserted the ControlValue (TextBox)!")
|
||||
Else
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.InsertControlValue (TextBox) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, value1), False)
|
||||
LOGGER.Warn(String.Format("ClassControlCommandsUI.InsertControlValue (TextBox) was not successfull - ControlID: {0},RecordID: {1},value: {2}'", CONTROL_ID, CURRENT_RECORD_ID, value1))
|
||||
End If
|
||||
|
||||
|
||||
@@ -593,8 +593,8 @@ Public Class ClassControlBuilder
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim datatable As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||
Dim datatable1 As DataTable = ClassDatabase.Return_Datatable(SQLenable)
|
||||
Dim datatable As DataTable = MYDB_ECM.GetDatatable(SQL)
|
||||
Dim datatable1 As DataTable = MYDB_ECM.GetDatatable(SQLenable)
|
||||
Depending_Controls(control, datatable, value)
|
||||
Enable_Controls(control, datatable1, value)
|
||||
|
||||
@@ -702,8 +702,8 @@ Public Class ClassControlBuilder
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim datatable As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||
Dim datatable1 As DataTable = ClassDatabase.Return_Datatable(SQLenable)
|
||||
Dim datatable As DataTable = MYDB_ECM.GetDatatable(SQL)
|
||||
Dim datatable1 As DataTable = MYDB_ECM.GetDatatable(SQLenable)
|
||||
Depending_Controls(control, datatable, value)
|
||||
Enable_Controls(control, datatable1, value)
|
||||
|
||||
@@ -785,11 +785,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, True)
|
||||
Dim DT_ControlValues As DataTable = MYDB_ECM.GetDatatable(SQL1)
|
||||
CURRENT_CONTROL_VALUES = DT_ControlValues
|
||||
|
||||
Dim datatable As DataTable = ClassDatabase.Return_Datatable(SQL, True)
|
||||
Dim datatable1 As DataTable = ClassDatabase.Return_Datatable(SQLenable, True)
|
||||
Dim datatable As DataTable = MYDB_ECM.GetDatatable(SQL)
|
||||
Dim datatable1 As DataTable = MYDB_ECM.GetDatatable(SQLenable)
|
||||
Depending_Controls(control, datatable, CONTROL_VALUE)
|
||||
If IsNothing(CONTROL_VALUE) Then
|
||||
Exit Sub
|
||||
@@ -874,11 +874,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, True)
|
||||
Dim DT_ControlValues As DataTable = MYDB_ECM.GetDatatable(SQL1)
|
||||
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 = MYDB_ECM.GetDatatable(SQL)
|
||||
Dim datatable1 As DataTable = MYDB_ECM.GetDatatable(SQLenable)
|
||||
Depending_Controls(control, datatable, CONTROL_VALUE)
|
||||
If IsNothing(CONTROL_VALUE) Then
|
||||
Exit Sub
|
||||
@@ -907,7 +907,7 @@ Public Class ClassControlBuilder
|
||||
If filter.IsEmpty Then
|
||||
Try
|
||||
Dim sql As String = $"SELECT VALUE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {controlId} AND RECORD_ID = {recordId}"
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(sql)
|
||||
Dim dt As DataTable = MYDB_ECM.GetDatatable(sql)
|
||||
Dim values As New List(Of Object)
|
||||
|
||||
For Each row As DataRow In dt.Rows
|
||||
@@ -952,39 +952,10 @@ Public Class ClassControlBuilder
|
||||
'End If
|
||||
|
||||
|
||||
Dim datatable1 As DataTable = ClassDatabase.Return_Datatable(SQLenable)
|
||||
Dim datatable1 As DataTable = MYDB_ECM.GetDatatable(SQLenable)
|
||||
Enable_Controls(control, datatable1, checkstate)
|
||||
|
||||
|
||||
'Dim sqlcommand As String = datatable.Rows(0).Item("SQL_COMMAND_1")
|
||||
|
||||
'If IsNothing(sqlcommand) Then
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
'If String.IsNullOrEmpty(value) Then
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
'Dim regex As New System.Text.RegularExpressions.Regex("(@(\d+)@)")
|
||||
'Dim match As System.Text.RegularExpressions.Match = regex.Match(sqlcommand)
|
||||
|
||||
'If match.Success Then
|
||||
' ' DependingControlId bezeichnet das Control, das die Abhängigkeit enthält
|
||||
' Dim dependingControlId As Integer = datatable.Rows(0).Item("GUID")
|
||||
' Dim panel As Panel = DirectCast(control.Parent, Panel)
|
||||
' ' Über die Id das Control finden
|
||||
' Dim dependingControl As CustomComboBox = panel.Controls.OfType(Of CustomComboBox)().Where(Function(c As CustomComboBox)
|
||||
' Return DirectCast(c.Tag, ClassControlMetadata).Id = dependingControlId
|
||||
' End Function).SingleOrDefault()
|
||||
|
||||
' sqlcommand = sqlcommand.Replace(match.Groups(1).Value, value)
|
||||
' Console.WriteLine("Executing SQL_COMMAND: {0}", sqlcommand)
|
||||
' Dim dt As DataTable = ClassDatabase.Return_Datatable(sqlcommand)
|
||||
' ControlLoader.Combobox.SetDataSource(dependingControl, dt)
|
||||
'End If
|
||||
|
||||
Console.WriteLine("value changed")
|
||||
Catch ex As Exception
|
||||
@@ -1503,7 +1474,7 @@ Public Class ClassControlBuilder
|
||||
If sqlcommand.Contains("@RECORD_ID") Or sqlcommand.Contains("@RECORDID") Or sqlcommand.Contains("@ENTITY_ID") Or sqlcommand.Contains("@PARENTRECORD_ID") Or sqlcommand.Contains("@PARENTRECORDID") Then
|
||||
result = Nothing
|
||||
Else
|
||||
result = ClassDatabase.Execute_Scalar(sqlcommand, True)
|
||||
result = MYDB_ECM.ExecuteNonQuery(sqlcommand)
|
||||
End If
|
||||
If Not IsNothing(result) Then
|
||||
If Not IsDBNull(result) Then
|
||||
@@ -1622,7 +1593,7 @@ Public Class ClassControlBuilder
|
||||
control.AutoCompleteSource = AutoCompleteSource.CustomSource
|
||||
|
||||
Dim suggestSource As New AutoCompleteStringCollection()
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable($"SELECT DISTINCT VALUE FROM VWPMO_VALUES WHERE CONTROL_ID = {id}")
|
||||
Dim dt As DataTable = MYDB_ECM.GetDatatable($"SELECT DISTINCT VALUE FROM VWPMO_VALUES WHERE CONTROL_ID = {id}")
|
||||
|
||||
For Each row As DataRow In dt.Rows
|
||||
suggestSource.Add(row.Item("VALUE"))
|
||||
@@ -2528,7 +2499,7 @@ Public Class ClassControlBuilder
|
||||
'Ja also überprüfen ob parametrisiert??
|
||||
If Not sqlcommand.ToString.Contains("@") Then
|
||||
'SQL-Command vorhanden also Ausführen des SQL
|
||||
Dim DT_ListBox As DataTable = ClassDatabase.Return_Datatable(sqlcommand)
|
||||
Dim DT_ListBox As DataTable = MYDB_ECM.GetDatatable(sqlcommand)
|
||||
If DT_ListBox Is Nothing = False Then
|
||||
If DT_ListBox.Rows.Count > 0 Then
|
||||
control.DataSource = DT_ListBox
|
||||
@@ -2638,7 +2609,7 @@ Public Class ClassControlBuilder
|
||||
If sqlcommand.Length > 1 Then
|
||||
If Not sqlcommand.ToString.Contains("@") Then
|
||||
'SQL-Command vorhanden also Ausführen des SQL
|
||||
Dim DT_ListBox As DataTable = ClassDatabase.Return_Datatable(sqlcommand)
|
||||
Dim DT_ListBox As DataTable = MYDB_ECM.GetDatatable(sqlcommand)
|
||||
If DT_ListBox Is Nothing = False Then
|
||||
If DT_ListBox.Rows.Count > 0 Then
|
||||
control.DataSource = DT_ListBox
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
Public Shared Function GetParentRecordId(RecordId As Integer) As Integer
|
||||
Try
|
||||
Dim parentId = ClassDatabase.Execute_Scalar("SELECT RECORD1_ID FROM TBPMO_RECORD_CONNECT WHERE RECORD2_ID = " & RecordId, True)
|
||||
Dim parentId = MYDB_ECM.ExecuteNonQuery("SELECT RECORD1_ID FROM TBPMO_RECORD_CONNECT WHERE RECORD2_ID = " & RecordId)
|
||||
If IsNothing(parentId) Then
|
||||
Return 0
|
||||
Else
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
Public Shared Function GetFormId(RecordId As Integer) As Integer
|
||||
Try
|
||||
Dim FormId = ClassDatabase.Execute_Scalar("SELECT FORM_ID FROM VWPMO_VALUES WHERE RECORD_ID = " & RecordId, True)
|
||||
Dim FormId = MYDB_ECM.ExecuteNonQuery("SELECT FORM_ID FROM VWPMO_VALUES WHERE RECORD_ID = " & RecordId)
|
||||
Return FormId
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in GetFormId:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
@@ -77,7 +77,7 @@
|
||||
Public Shared Function GetControlGuid(name As String)
|
||||
Try
|
||||
Dim sql = "SELECT GUID FROM TBPMO_CONTROL WHERE UPPER(NAME) = UPPER('" & name & "')"
|
||||
Return ClassDatabase.Execute_Scalar(sql, True)
|
||||
Return MYDB_ECM.ExecuteNonQuery(sql)
|
||||
Catch ex As Exception
|
||||
Return -1
|
||||
End Try
|
||||
@@ -107,9 +107,9 @@
|
||||
SQL = $"INSERT INTO TBPMO_CONTROL (FORM_ID, CONTROL_TYPE_ID, DEFAULT_VALUE, NAME, COL_NAME, PARENT_CONTROL_ID, SQL_COMMAND_1) VALUES ({CURRENT_ENTITY_ID}, {CONTROL_TYPE_ID}, '', '{NAME}', '{NAME}', {PARENT_CONTROL_ID}, '')"
|
||||
|
||||
'LOGGER.Debug(SQL)
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = True Then
|
||||
SQL = "SELECT MAX(GUID) FROM TBPMO_CONTROL"
|
||||
Dim GUID = ClassDatabase.Execute_Scalar(SQL)
|
||||
Dim GUID = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
Return InsertControlScreen(GUID, control, CURRENT_ENTITY_ID)
|
||||
Else
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
'Dim TAB_INDEX
|
||||
'SQL = "SELECT MAX(TAB_INDEX) FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID IN (SELECT GUID FROM TBPMO_CONTROL WHERE CURRENT_ENTITY_ID = " & CURRENT_ENTITY_ID & ")"
|
||||
'TAB_INDEX = ClassDatabase.Execute_Scalar(SQL)
|
||||
'TAB_INDEX = MYDB_ECM.GetScalarValue(SQL)
|
||||
'If Not TAB_INDEX Is Nothing Then
|
||||
' If IsDBNull(TAB_INDEX) Then
|
||||
' TAB_INDEX = 1
|
||||
@@ -152,16 +152,16 @@
|
||||
|
||||
SQL = "INSERT TBPMO_CONTROL_SCREEN (CONTROL_ID, SCREEN_ID, CONTROL_TEXT, X_LOC, Y_LOC, HEIGHT, WIDTH) VALUES (" & guid & ", 1, '" & CONTROL_TEXT & "', " & X_LOC & ", " & Y_LOC & ", " & HEIGHT & ", " & WIDTH & ")"
|
||||
|
||||
If ClassDatabase.Execute_non_Query(SQL) Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) Then
|
||||
' Die Guid in die Metadaten des Controls zurückschreiben
|
||||
Dim metadata = DirectCast(control.Tag, ClassControlMetadata)
|
||||
metadata.Id = guid
|
||||
control.Tag = metadata
|
||||
|
||||
SQL = "SELECT MAX(GUID) FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = " & guid & " AND SCREEN_ID = " & CURRENT_SCREEN_ID
|
||||
Dim ctrl_screen_Id = ClassDatabase.Execute_Scalar(SQL)
|
||||
Dim ctrl_screen_Id = MYDB_ECM.GetScalarValue(SQL)
|
||||
SQL = String.Format("INSERT INTO TBPMO_CONTROL_LANGUAGE (LANGUAGE_TYPE,CONTROL_SCREEN_ID,CAPTION,ADDED_WHO) VALUES ('{0}',{1},'{2}','{3}')", USER_LANGUAGE, ctrl_screen_Id, CONTROL_TEXT, USER_USERNAME)
|
||||
ClassDatabase.Execute_non_Query(SQL)
|
||||
MYDB_ECM.ExecuteNonQuery(SQL)
|
||||
Return True
|
||||
Else
|
||||
Throw New Exception()
|
||||
@@ -187,7 +187,7 @@
|
||||
|
||||
Dim SQL = "UPDATE TBPMO_CONTROL_SCREEN SET X_LOC = " & x & ", Y_LOC = " & y & ", CHANGED_WHO = '" & USER_USERNAME & "' WHERE CONTROL_ID = " & CONTROL_ID
|
||||
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = True Then
|
||||
Return True
|
||||
Else
|
||||
Throw New Exception()
|
||||
@@ -365,7 +365,7 @@
|
||||
AUTO_SUGGEST = {AUTO_SUGGEST}
|
||||
WHERE GUID = {CURRENT_CONTROL_ID}"
|
||||
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = True Then
|
||||
Return UpdateControlScreen(control, properties)
|
||||
Else
|
||||
Throw New Exception()
|
||||
@@ -444,11 +444,11 @@
|
||||
End If
|
||||
|
||||
SQL = "UPDATE TBPMO_CONTROL_SCREEN SET TAB_INDEX = " & TAB_INDEX & ", TAB_STOP = " & TAB_STOP & ", X_LOC = " & X_LOC & ", Y_LOC = " & Y_LOC & ", HEIGHT = " & HEIGHT & ", WIDTH = " & WIDTH & ", CONTROL_TEXT = '" & CONTROL_TEXT & "', CHANGED_WHO = '" & CHANGED_WHO & "', FONT_COLOR = " & FONT_COLOR & ", FONT_SIZE = " & FONT_SIZE & ", FONT_STYLE = " & FONT_STYLE & ", FONT_FAMILY = '" & FONT_FAMILY & "' , BACK_COLOR = " & BACK_COLOR & " WHERE CONTROL_ID = " & CURRENT_CONTROL_ID & " AND SCREEN_ID = " & CURRENT_SCREEN_ID
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
Dim upd = String.Format("UPDATE TBPMO_CONTROL_LANGUAGE SET CAPTION = '{0}', HINT = '{1}' WHERE LANGUAGE_TYPE = '{2}' AND " & _
|
||||
"CONTROL_SCREEN_ID = (SELECT GUID FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = " & _
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = True Then
|
||||
Dim upd = String.Format("UPDATE TBPMO_CONTROL_LANGUAGE SET CAPTION = '{0}', HINT = '{1}' WHERE LANGUAGE_TYPE = '{2}' AND " &
|
||||
"CONTROL_SCREEN_ID = (SELECT GUID FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = " &
|
||||
CURRENT_CONTROL_ID & " AND SCREEN_ID = " & CURRENT_SCREEN_ID & ")", CONTROL_TEXT, HINT, USER_LANGUAGE)
|
||||
ClassDatabase.Execute_non_Query(upd)
|
||||
MYDB_ECM.ExecuteNonQuery(upd)
|
||||
If CurrentType.Contains("Button") Then
|
||||
'If control.Tag = "ADDAPPOINTMENT" Then
|
||||
If control.Name.Contains("f_addappointment") Then
|
||||
@@ -528,7 +528,7 @@
|
||||
Public Shared Function DeleteControl(ID As Integer)
|
||||
Try
|
||||
Dim del = "EXEC [dbo].[PRPMO_DELETE_CONTROL] " & ID.ToString
|
||||
If ClassDatabase.Execute_non_Query(del) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(del) = True Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
@@ -542,9 +542,9 @@
|
||||
Public Shared Function DeleteControlScreen(id As Integer)
|
||||
Try
|
||||
Dim SQL = "DELETE FROM TBPMO_CONTROL_LANGUAGE WHERE CONTROL_SCREEN_ID IN (SELECT GUID FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = " & id & ")"
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = True Then
|
||||
SQL = "DELETE FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = " & id
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = True Then
|
||||
Return True
|
||||
Else
|
||||
Throw New Exception()
|
||||
@@ -564,7 +564,7 @@
|
||||
Try
|
||||
Dim SQL = "DELETE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = " & id
|
||||
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = True Then
|
||||
Return True
|
||||
Else
|
||||
Throw New Exception()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Imports DD_Record_Organizer.ClassDatabase
|
||||
|
||||
Imports DD_Record_Organizer.ClassControlBuilder
|
||||
Imports DD_LIB_Standards
|
||||
Imports System.Data.SqlClient
|
||||
@@ -53,7 +53,7 @@ Public Class ClassControlCommandsUI
|
||||
'Dim SQL As String = String.Format("SELECT T.*, dbo.FNPMO_GET_CONTROL_CAPTION ('{2}', {3},T.CONTROL_ID) AS 'CAPTION' FROM VWPMO_CONTROL_SCREEN T WHERE T.SCREEN_ID = {0} AND T.FORM_ID = {1} AND T.CONTROL_VISIBLE = 1", CURRENT_SCREEN_ID, FormId, USER_LANGUAGE, CURRENT_SCREEN_ID)
|
||||
Dim expression As String = String.Format("SCREEN_ID = {0} AND FORM_ID = {1} AND CONTROL_VISIBLE = 1", CURRENT_SCREEN_ID, FormId)
|
||||
|
||||
Dim DT As DataTable = ClassHelper.FILTER_DATATABLE(DT_VWPMO_CONTROL_SCREEN, expression, "") ' ClassDatabase.Return_Datatable(Sql, True)
|
||||
Dim DT As DataTable = ClassHelper.FILTER_DATATABLE(DT_VWPMO_CONTROL_SCREEN, expression, "")
|
||||
|
||||
For Each dr As DataRow In DT.Rows
|
||||
Dim parent As GroupBox = Nothing
|
||||
@@ -346,7 +346,7 @@ Public Class ClassControlCommandsUI
|
||||
Function SaveRecord(RecordID As Integer, FormID As Integer) As String
|
||||
Try
|
||||
Dim ADDED_WHO As String = USER_USERNAME
|
||||
LOGGER.Debug("(SaveRecord) Update RecordID: " & RecordID, False)
|
||||
LOGGER.Debug("(SaveRecord) Update RecordID: " & RecordID)
|
||||
If UpdateAllControls(FormID, RecordID, _CtrlBuilder.AllControls) = True Then
|
||||
Return "Datensatz aktualisiert - " & Now
|
||||
Else
|
||||
@@ -394,7 +394,7 @@ Public Class ClassControlCommandsUI
|
||||
|
||||
Private Sub UpsertImage(ControlID As Integer, RecordID As Integer, image As Bitmap)
|
||||
Dim existsSQL As String = "SELECT GUID FROM TBPMO_CONTROL_IMAGE WHERE CONTROL_ID = " & ControlID & " AND RECORD_ID = " & RecordID
|
||||
Dim exists = ClassDatabase.Execute_Scalar(existsSQL)
|
||||
Dim exists = MYDB_ECM.ExecuteNonQuery(existsSQL)
|
||||
|
||||
If IsNothing(exists) Then
|
||||
InsertImage(ControlID, RecordID, image)
|
||||
@@ -436,10 +436,10 @@ Public Class ClassControlCommandsUI
|
||||
Private Sub LinkImage(ControlID As Integer, RecordID As Integer)
|
||||
Try
|
||||
Dim SQL = String.Format("SELECT GUID FROM TBPMO_CONTROL_IMAGE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", ControlID, RecordID)
|
||||
Dim ImageID As Integer = ClassDatabase.Execute_Scalar(SQL)
|
||||
Dim ImageID As Integer = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
SQL = String.Format("SELECT GUID FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", ControlID, RecordID)
|
||||
Dim valueExists = ClassDatabase.Execute_Scalar(SQL)
|
||||
Dim valueExists = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
Dim VALUE = "%%" & ImageID.ToString & "%%"
|
||||
|
||||
@@ -448,7 +448,7 @@ Public Class ClassControlCommandsUI
|
||||
Else
|
||||
SQL = String.Format("INSERT INTO TBPMO_CONTROL_VALUE (RECORD_ID, CONTROL_ID, VALUE, ADDED_WHO) VALUES ({0}, {1}, '{2}', '{3}')", RecordID, ControlID, VALUE, USER_USERNAME)
|
||||
End If
|
||||
ClassDatabase.Execute_non_Query(SQL)
|
||||
MYDB_ECM.ExecuteNonQuery(SQL)
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in LinkImage: " & vbNewLine & ex.Message)
|
||||
End Try
|
||||
@@ -489,11 +489,11 @@ Public Class ClassControlCommandsUI
|
||||
Try
|
||||
' Delete Image
|
||||
Dim SQL = String.Format("DELETE FROM TBPMO_CONTROL_IMAGE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", ControlID, RecordID)
|
||||
Dim result = ClassDatabase.Execute_non_Query(SQL)
|
||||
Dim result = MYDB_ECM.ExecuteNonQuery(SQL)
|
||||
|
||||
' Delete Value
|
||||
SQL = String.Format("DELETE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", ControlID, RecordID)
|
||||
result = ClassDatabase.Execute_non_Query(SQL)
|
||||
result = MYDB_ECM.ExecuteNonQuery(SQL)
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler beim löschen des Bildes:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
@@ -504,16 +504,16 @@ Public Class ClassControlCommandsUI
|
||||
Dim _error As Boolean = False
|
||||
Dim sw As New SW("UpdateAllControls")
|
||||
Dim del = String.Format("DELETE FROM TBPMO_CONTROL_VALUE_CHANGE_HISTORY WHERE UPPER(ADDED_WHO) = '{0}'", USER_USERNAME.ToUpper)
|
||||
ClassDatabase.Execute_non_Query(del)
|
||||
MYDB_ECM.ExecuteNonQuery(del)
|
||||
CURRENT_CHANGE_STEP += 1
|
||||
Dim sel = String.Format("SELECT RECORD_ID, CONTROL_ID FROM VWPMO_VALUES WHERE RECORD_ID = {0}", RecordID)
|
||||
Dim VALUE_EXISTS_DT As DataTable = ClassDatabase.Return_Datatable(sel, True)
|
||||
Dim VALUE_EXISTS_DT As DataTable = MYDB_ECM.GetDatatable(sel)
|
||||
|
||||
For Each ctrl As Control In controls
|
||||
Console.WriteLine("Updating Control " + ctrl.Name)
|
||||
|
||||
Dim CONTROL_ID As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id 'GetControlID_for_RecordID(ctrl.Name, RecordID)
|
||||
LOGGER.Debug("CONTROL_ID: " & CONTROL_ID, False)
|
||||
LOGGER.Debug("CONTROL_ID: " & CONTROL_ID)
|
||||
Dim CONTROL_VALUE As String = GetControlValue(ctrl)
|
||||
Dim controltype = ctrl.GetType.ToString
|
||||
If TypeOf ctrl Is PictureBox Then
|
||||
@@ -542,7 +542,7 @@ Public Class ClassControlCommandsUI
|
||||
Continue For
|
||||
End If
|
||||
|
||||
'Dim ValueExists = ClassDatabase.Execute_Scalar(String.Format("SELECT RECORD_ID FROM VWPMO_VALUES WHERE RECORD_ID = {0} AND CONTROL_ID = {1}", RecordID, CONTROL_ID))
|
||||
|
||||
Dim ValueExists = VALUE_EXISTS_DT.Select(String.Format("CONTROL_ID = {0}", CONTROL_ID))
|
||||
Dim ValueChanged As Boolean = _CtrlBuilder.ControlsChanged.Contains(CONTROL_ID)
|
||||
|
||||
@@ -554,7 +554,7 @@ Public Class ClassControlCommandsUI
|
||||
'If CONTROL_ID = 995 Or CONTROL_ID = 996 Or CONTROL_ID = 997 Or CONTROL_ID = 810 Then
|
||||
' Console.WriteLine("sdasd")
|
||||
'End If
|
||||
LOGGER.Debug("InsertControlValue: " & CONTROL_ID & "|" & RecordID & "|" & CONTROL_VALUE, False)
|
||||
LOGGER.Debug("InsertControlValue: " & CONTROL_ID & "|" & RecordID & "|" & CONTROL_VALUE)
|
||||
If Not IsNothing(CONTROL_VALUE) Then
|
||||
If TypeOf ctrl Is CustomComboBox And CONTROL_VALUE = "" Then
|
||||
'Exit Sub - Zuviel des guten
|
||||
@@ -577,9 +577,9 @@ Public Class ClassControlCommandsUI
|
||||
If (isDateEdit Or isTextBox Or isComboBox) And isEmptyValue 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 MYDB_ECM.ExecuteNonQuery(sql) = True Then
|
||||
If LICENSE_PROXY = True Or clsDatabase.DB_PROXY_INITIALIZED = True Then
|
||||
ClassDatabase.Execute_non_Query(sql, True)
|
||||
MYDB_ECM.ExecuteNonQuery(sql, True)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -612,7 +612,7 @@ Public Class ClassControlCommandsUI
|
||||
Public Shared Sub UpdateMultipleValues(ControlId As Integer, RecordId As Integer, value As String)
|
||||
Try
|
||||
Dim val = String.Format("SELECT VALUE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", ControlId, RecordId)
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(val, True)
|
||||
Dim dt As DataTable = MYDB_ECM.GetDatatable(val)
|
||||
If IsNothing(dt) Then
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -644,7 +644,7 @@ Public Class ClassControlCommandsUI
|
||||
End If
|
||||
Next
|
||||
For Each v As String In RemoveValues
|
||||
ClassDatabase.Execute_non_Query(String.Format("DELETE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1} AND VALUE = '{2}'", ControlId, RecordId, v))
|
||||
MYDB_ECM.ExecuteNonQuery(String.Format("DELETE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {0} AND RECORD_ID = {1} AND VALUE = '{2}'", ControlId, RecordId, v))
|
||||
' ClassProxy.PRPROXY_CONTROL_DEL(RecordId, CURRENT_ENTITY_ID, ControlId)
|
||||
Next
|
||||
ClassProxy.PRPROXY_CONTROL_VALUE_UPD_INS(CURRENT_ENTITY_ID, ControlId, RecordId, "")
|
||||
@@ -657,14 +657,14 @@ Public Class ClassControlCommandsUI
|
||||
|
||||
Dim type = ctrl.GetType().Name
|
||||
Dim CONTROL_ID As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id ' GetControlID_for_RecordID(ctrl.Name, CURRENT_RECORD_ID)
|
||||
LOGGER.Debug("GetControlValue CONTROL_ID: " & CONTROL_ID, False)
|
||||
LOGGER.Debug("GetControlValue CONTROL_ID: " & CONTROL_ID)
|
||||
Dim CONTROL_VALUE As String = Nothing
|
||||
LOGGER.Debug("type = " & type.ToString, False)
|
||||
LOGGER.Debug("type = " & type.ToString)
|
||||
Select Case type
|
||||
Case "TextBox"
|
||||
Return DirectCast(ctrl, TextBox).Text
|
||||
Case "CustomComboBox"
|
||||
LOGGER.Debug("Return Value: " & DirectCast(ctrl, CustomComboBox).Text, False)
|
||||
LOGGER.Debug("Return Value: " & DirectCast(ctrl, CustomComboBox).Text)
|
||||
Return DirectCast(ctrl, CustomComboBox).Text
|
||||
Case "CheckBox"
|
||||
Return DirectCast(ctrl, CheckBox).Checked.ToString()
|
||||
@@ -689,7 +689,7 @@ Public Class ClassControlCommandsUI
|
||||
Case "CheckedListBoxControl"
|
||||
Dim chklbx As DevExpress.XtraEditors.CheckedListBoxControl
|
||||
chklbx = DirectCast(ctrl, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
Dim SQL_COMAMND = ClassDatabase.Execute_Scalar("SELECT UPPER(SQL_COMMAND_1) FROM TBPMO_CONTROL WHERE GUID = " & CONTROL_ID, True)
|
||||
Dim SQL_COMAMND = MYDB_ECM.ExecuteNonQuery("SELECT UPPER(SQL_COMMAND_1) FROM TBPMO_CONTROL WHERE GUID = " & CONTROL_ID)
|
||||
|
||||
'TODO: Wenn keine Datasource vorhanden, angecheckte einträge als string speichern
|
||||
If IsNothing(chklbx.DataSource) Then
|
||||
@@ -718,10 +718,10 @@ Public Class ClassControlCommandsUI
|
||||
If CInt(row(0)) > 0 Then
|
||||
'Überprüfen ob es den Record gibt
|
||||
Dim SQL = "SELECT COUNT(*) FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_Scalar(SQL, True) = 1 Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = 1 Then
|
||||
SQL = "DELETE FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_non_Query(SQL) = True Then
|
||||
LOGGER.Debug("TBPMO_RECORD_CONNECT-Entry after 'deselect CheckedListBox' deleted", False)
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL) = True Then
|
||||
LOGGER.Debug("TBPMO_RECORD_CONNECT-Entry after 'deselect CheckedListBox' deleted")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -744,12 +744,12 @@ Public Class ClassControlCommandsUI
|
||||
checked_result.Add(checked_value)
|
||||
checked_result_string = String.Join(";", checked_result)
|
||||
Dim SQL = "SELECT COUNT(*) FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
|
||||
If ClassDatabase.Execute_Scalar(SQL, True) = 0 Then
|
||||
If MYDB_ECM.ExecuteNonQuery(SQL, True) = 0 Then
|
||||
If CURRENT_RECORD_ID = 0 Then
|
||||
MsgBox("Attention: no current record Selected!", MsgBoxStyle.Exclamation)
|
||||
Else
|
||||
If ClassRecordCommands.ConnectRecord(CURRENT_RECORD_ID, CInt(row(0)), "CheckedListBox;" & ctrl.Name) = True Then
|
||||
LOGGER.Debug("Checked ListBox record '" & rid.ToString & "' was linked successfully.", False)
|
||||
LOGGER.Debug("Checked ListBox record '" & rid.ToString & "' was linked successfully.")
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -779,7 +779,7 @@ Public Class ClassControlCommandsUI
|
||||
' Überspringt den Rest der funktion
|
||||
If Not IsNothing(checked_result_string) Then
|
||||
'Dim sql = String.Format("select count(*) from TBPMO_CONTROL_VALUE where CONTROL_ID = {0} and RECORD_ID = {1}", CONTROL_ID, CURRENT_RECORD_ID)
|
||||
'If ClassDatabase.Execute_Scalar(sql) = 0 Then
|
||||
'If MYDB_ECM.GetScalarValue(SQL) = 0 Then
|
||||
' InsertControlValue(CONTROL_ID, CURRENT_RECORD_ID, "")
|
||||
'End If
|
||||
Return checked_result_string
|
||||
@@ -792,7 +792,7 @@ Public Class ClassControlCommandsUI
|
||||
Dim chk_grid As DevExpress.XtraGrid.GridControl
|
||||
chk_grid = DirectCast(ctrl, DevExpress.XtraGrid.GridControl)
|
||||
Dim gridview As DevExpress.XtraGrid.Views.Grid.GridView = chk_grid.MainView
|
||||
Dim SQL_COMAMND = ClassDatabase.Execute_Scalar("SELECT UPPER(SQL_COMMAND_1) FROM TBPMO_CONTROL WHERE GUID = " & CONTROL_ID, True)
|
||||
Dim SQL_COMAMND = MYDB_ECM.ExecuteNonQuery("SELECT UPPER(SQL_COMMAND_1) FROM TBPMO_CONTROL WHERE GUID = " & CONTROL_ID)
|
||||
|
||||
Dim result As New List(Of String)
|
||||
Dim result_string As String
|
||||
@@ -913,7 +913,7 @@ Public Class ClassControlCommandsUI
|
||||
_result = 0
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Dim name = clsDatabase.Execute_Scalar("SELECT NAME FROM TBPMO_CONTROL WHERE GUID = " & ControlID, True)
|
||||
Dim name = MYDB_ECM.GetScalarValue("SELECT NAME FROM TBPMO_CONTROL WHERE GUID = " & ControlID)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in CreateControlProcedure für Control: " & name)
|
||||
LOGGER.Warn("Error in CreateControlProcedure: " & ex.Message, True)
|
||||
Return 0
|
||||
@@ -927,13 +927,13 @@ Public Class ClassControlCommandsUI
|
||||
converted_value = converted_value.Replace("'", "´")
|
||||
Dim ins As String = String.Format("INSERT INTO TBPMO_CONTROL_VALUE (CONTROL_ID, RECORD_ID, VALUE, ADDED_WHO) VALUES ({0}, {1}, '{2}', '{3}')", ControlID, RecordID, converted_value, AddedWho)
|
||||
If LICENSE_PROXY = True Or clsDatabase.DB_PROXY_INITIALIZED = True Then
|
||||
If ClassDatabase.Execute_non_Query(ins) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(ins) = True Then
|
||||
Return ClassProxy.PRPROXY_CONTROL_VALUE_UPD_INS(ENTITY_ID, ControlID, RecordID, converted_value)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Return ClassDatabase.Execute_non_Query(ins)
|
||||
Return MYDB_ECM.ExecuteNonQuery(ins)
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
@@ -957,13 +957,13 @@ Public Class ClassControlCommandsUI
|
||||
LOGGER.Warn(upd)
|
||||
End If
|
||||
If LICENSE_PROXY = True Or clsDatabase.DB_PROXY_INITIALIZED = True Then
|
||||
If ClassDatabase.Execute_non_Query(upd) = True Then
|
||||
If MYDB_ECM.ExecuteNonQuery(upd) = True Then
|
||||
Return ClassProxy.PRPROXY_CONTROL_VALUE_UPD_INS(ENTITY_ID, ControlID, RecordID, converted_value)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Return ClassDatabase.Execute_non_Query(upd)
|
||||
Return MYDB_ECM.ExecuteNonQuery(upd)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unerwarteter Fehler in UpdateControlValue: " & ex.Message)
|
||||
|
||||
@@ -18,20 +18,20 @@
|
||||
Try
|
||||
Dim AutoValue As String = String.Empty
|
||||
Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
|
||||
Dim CONNID = ClassDatabase.Execute_Scalar(String.Format("SELECT CONNECTION_ID_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId))
|
||||
Dim SQL As String = ClassDatabase.Execute_Scalar(String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId))
|
||||
Dim CONNID = MYDB_ECM.GetScalarValue(String.Format("SELECT CONNECTION_ID_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId))
|
||||
Dim SQL As String = MYDB_ECM.GetScalarValue(String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId))
|
||||
SQL = ClassControlValues.ReplaceSqlCommandPlaceholders(SQL, RecordId, ParentRecordId, entity_ID)
|
||||
|
||||
If SQL = "" Or IsDBNull(SQL) Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
If Not IsNothing(CONNID) Then
|
||||
AutoValue = ClassDatabase.Execute_ScalarWithConnection(CONNID, SQL)
|
||||
Else
|
||||
AutoValue = ClassDatabase.Execute_Scalar(SQL, True)
|
||||
End If
|
||||
' AutoValue = ClassDatabase.Execute_Scalar(SQL)
|
||||
'If Not IsNothing(CONNID) Then
|
||||
' AutoValue = ClassDatabase.Execute_ScalarWithConnection(CONNID, SQL)
|
||||
'Else
|
||||
AutoValue = MYDB_ECM.GetScalarValue(SQL)
|
||||
' End If
|
||||
' AutoValue = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
If String.IsNullOrEmpty(AutoValue) Or IsDBNull(AutoValue) Then
|
||||
Return Nothing
|
||||
@@ -64,7 +64,7 @@
|
||||
' Der alte SQL Befehl hat nicht wirklich nach der StaticList geschaut o_O
|
||||
' Dim SQL As String = String.Format("SELECT VALUE FROM VWPMO_VALUES WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", controlId, recordId)
|
||||
Dim SQL As String = String.Format("SELECT STATIC_LIST FROM TBPMO_CONTROL WHERE GUID = {0}", controlId)
|
||||
Dim staticList As String = ClassDatabase.Execute_Scalar(SQL, True)
|
||||
Dim staticList As String = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
If IsNothing(staticList) Or String.IsNullOrWhiteSpace(staticList) Then
|
||||
Return Nothing
|
||||
@@ -87,11 +87,11 @@
|
||||
Dim final As DataTable
|
||||
|
||||
If cached Is Nothing Then
|
||||
If Not IsDBNull(connection_Id) Then
|
||||
final = ClassDatabase.MSSQL_ReturnDTWithConnection(connection_Id, sqlCommand)
|
||||
Else
|
||||
final = ClassDatabase.Return_Datatable(sqlCommand)
|
||||
End If
|
||||
'If Not IsDBNull(connection_Id) Then
|
||||
' final = ClassDatabase.MSSQL_ReturnDTWithConnection(connection_Id, sqlCommand)
|
||||
'Else
|
||||
final = MYDB_ECM.GetDatatable(sqlCommand)
|
||||
'End If
|
||||
ClassControlValueCache.SaveToCache(sqlCommand, final)
|
||||
Console.WriteLine("CACHE MISS")
|
||||
Else
|
||||
@@ -123,7 +123,7 @@
|
||||
'Jetzt noch den Columnname ändern
|
||||
Dim gridview = DirectCast(control.MainView, DevExpress.XtraGrid.Views.Grid.GridView)
|
||||
|
||||
Dim caption As String = ClassDatabase.Execute_Scalar(String.Format("SELECT COL_NAME FROM TBPMO_CONTROL WHERE GUID = {0}", DirectCast(control.Tag, ClassControlMetadata).Id), True)
|
||||
Dim caption As String = MYDB_ECM.GetScalarValue(String.Format("SELECT COL_NAME FROM TBPMO_CONTROL WHERE GUID = {0}", DirectCast(control.Tag, ClassControlMetadata).Id))
|
||||
gridview.Columns(0).Caption = caption
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in SetDataSource - GridControl: " & ex.Message, MsgBoxStyle.Critical)
|
||||
@@ -234,22 +234,22 @@
|
||||
ID = drarray(0)("CONNECTION_ID").ToString
|
||||
End Try
|
||||
|
||||
If Not IsNothing(ID) Then
|
||||
Sql = drarray(0)("SQL_COMMAND_1").ToString
|
||||
Sql = ClassControlValues.ReplaceSqlCommandPlaceholders(Sql, recordId, parentRecordId, entity_ID)
|
||||
autoValue = ClassDatabase.Execute_ScalarWithConnection(ID, Sql)
|
||||
Else
|
||||
autoValue = ClassDatabase.Execute_Scalar(Sql, True)
|
||||
End If
|
||||
'If Not IsNothing(ID) Then
|
||||
' Sql = drarray(0)("SQL_COMMAND_1").ToString
|
||||
' Sql = ClassControlValues.ReplaceSqlCommandPlaceholders(Sql, recordId, parentRecordId, entity_ID)
|
||||
' autoValue = ClassDatabase.Execute_ScalarWithConnection(ID, Sql)
|
||||
'Else
|
||||
autoValue = MYDB_ECM.GetScalarValue(Sql)
|
||||
'End If
|
||||
If IsNothing(autoValue) Then
|
||||
If VARIABLE_VALUE = True Then
|
||||
control.Text = value
|
||||
Else
|
||||
Sql = String.Format("SELECT GUID FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0} AND SCREEN_ID = {1}", ControlId, CURRENT_SCREEN_ID)
|
||||
Dim ctrl_screen_id = ClassDatabase.Execute_Scalar(Sql, True)
|
||||
Dim ctrl_screen_id = MYDB_ECM.GetScalarValue(Sql)
|
||||
If ctrl_screen_id > 0 Then
|
||||
Sql = String.Format("SELECT CAPTION FROM TBPMO_CONTROL_LANGUAGE WHERE CONTROL_SCREEN_ID = {0} AND LANGUAGE_TYPE = '{1}'", ctrl_screen_id, USER_LANGUAGE)
|
||||
Dim labelText As String = ClassDatabase.Execute_Scalar(Sql)
|
||||
Dim labelText As String = MYDB_ECM.GetScalarValue(SQL)
|
||||
control.Text = labelText
|
||||
End If
|
||||
End If
|
||||
@@ -265,7 +265,7 @@
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in LoadValueMain:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
LOGGER.Warn("Unexpected Error in LoadValueMain: " & ex.Message)
|
||||
LOGGER.Warn(String.Format("ControlID: {0}" & vbNewLine & "recordid: {1}" & vbNewLine & "parentRecordId: {2}" & vbNewLine & "value: {3}" & vbNewLine & "entity_ID: {4}" & vbNewLine & "VARIABLE_VALUE: {5}", ControlId, recordId, parentRecordId, value, entity_ID, VARIABLE_VALUE), False)
|
||||
LOGGER.Warn(String.Format("ControlID: {0}" & vbNewLine & "recordid: {1}" & vbNewLine & "parentRecordId: {2}" & vbNewLine & "value: {3}" & vbNewLine & "entity_ID: {4}" & vbNewLine & "VARIABLE_VALUE: {5}", ControlId, recordId, parentRecordId, value, entity_ID, VARIABLE_VALUE))
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
@@ -338,12 +338,12 @@
|
||||
|
||||
|
||||
Dim Sql = drarray(0)("SQL_COMMAND").ToString
|
||||
If Not IsNothing(ID) Then
|
||||
autoValue = ClassDatabase.Execute_ScalarWithConnection(ID, Sql)
|
||||
Else
|
||||
autoValue = ClassDatabase.Execute_Scalar(Sql, True)
|
||||
End If
|
||||
' AutoValue = ClassDatabase.Execute_Scalar(SQL)
|
||||
'If Not IsNothing(ID) Then
|
||||
' autoValue = ClassDatabase.Execute_ScalarWithConnection(ID, Sql)
|
||||
'Else
|
||||
autoValue = MYDB_ECM.GetScalarValue(Sql)
|
||||
'End If
|
||||
' AutoValue = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
If String.IsNullOrEmpty(autoValue) Or IsDBNull(autoValue) Then
|
||||
control.Text = value
|
||||
|
||||
@@ -157,7 +157,7 @@ Public Class ClassControlValues
|
||||
|
||||
'Dim SQL As String = String.Format("SELECT * FROM VWPMO_VALUES WHERE VALUE <> '' AND RECORD_ID = {0}", RecordId)
|
||||
Dim SQL As String = String.Format("SELECT * FROM VWPMO_VALUES WHERE RECORD_ID = {0}", RecordId)
|
||||
Dim DT_ControlValues As DataTable = ClassDatabase.Return_Datatable(SQL, True)
|
||||
Dim DT_ControlValues As DataTable = MYDB_ECM.GetDatatable(SQL)
|
||||
CURRENT_CONTROL_VALUES = DT_ControlValues
|
||||
sw.Done()
|
||||
|
||||
@@ -174,7 +174,7 @@ Public Class ClassControlValues
|
||||
sw = New SW("LoadControlValues2")
|
||||
' Load all Hints for controls
|
||||
Dim SQLHint = "SELECT * FROM VWPMO_CONTROL_HINT WHERE FORM_ID = " & FormId
|
||||
Dim DT_Hints As DataTable = ClassDatabase.Return_Datatable(SQLHint, True)
|
||||
Dim DT_Hints As DataTable = MYDB_ECM.GetDatatable(SQLHint)
|
||||
' ' Hint in DT_Hints suchen der zur aktuellen controlId passt
|
||||
For Each row As DataRow In DT_Hints.Rows
|
||||
ClassControlValueCache.SaveHint(row.Item(1), row.Item(2))
|
||||
@@ -214,7 +214,7 @@ Public Class ClassControlValues
|
||||
Try
|
||||
'Dim SQL As String = String.Format("SELECT * FROM VWPMO_VALUES WHERE VALUE <> '' AND RECORD_ID = {0}", RecordId)
|
||||
Dim SQL As String = String.Format("SELECT VALUE FROM VWPMO_VALUES WHERE RECORD_ID = {0} AND CONTROL_ID = {1}", RecordId, CONTROL_ID)
|
||||
Dim RESULT = ClassDatabase.Execute_Scalar(SQL, True)
|
||||
Dim RESULT = MYDB_ECM.ExecuteNonQuery(SQL)
|
||||
If IsNothing(RESULT) Then
|
||||
Return Nothing
|
||||
ElseIf RESULT = "" Then
|
||||
@@ -235,7 +235,7 @@ Public Class ClassControlValues
|
||||
Dim id As Integer = DirectCast(c.Tag, ClassControlMetadata).Id
|
||||
|
||||
Dim sql As String = String.Format("SELECT HINT FROM TBPMO_CONTROL_LANGUAGE WHERE CONTROL_SCREEN_ID = (SELECT GUID FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0} AND SCREEN_ID = 1) AND LANGUAGE_TYPE = '{1}' AND HINT IS NOT NULL", id, USER_LANGUAGE)
|
||||
Dim hint = ClassDatabase.Execute_Scalar(sql)
|
||||
Dim hint = MYDB_ECM.GetScalarValue(sql)
|
||||
|
||||
If IsNothing(hint) Then
|
||||
Continue For
|
||||
@@ -251,64 +251,64 @@ Public Class ClassControlValues
|
||||
' Für die meisten Controls wird nur das erste Element der Liste benötigt
|
||||
Dim value As String = Nothing
|
||||
|
||||
If values.Count > 0 Then
|
||||
value = values.Item(0)
|
||||
End If
|
||||
Select Case control.GetType()
|
||||
Case GetType(TextBox)
|
||||
If CURRENT_CONTROL_ID = 272 Then
|
||||
Console.WriteLine("272")
|
||||
End If
|
||||
Dim textbox As TextBox = DirectCast(control, TextBox)
|
||||
ControlLoader.TextBox.LoadValue(textbox, recordId, parentRecordId, value, entity_ID)
|
||||
If values.Count > 0 Then
|
||||
value = values.Item(0)
|
||||
End If
|
||||
Select Case control.GetType()
|
||||
Case GetType(TextBox)
|
||||
If CURRENT_CONTROL_ID = 272 Then
|
||||
Console.WriteLine("272")
|
||||
End If
|
||||
Dim textbox As TextBox = DirectCast(control, TextBox)
|
||||
ControlLoader.TextBox.LoadValue(textbox, recordId, parentRecordId, value, entity_ID)
|
||||
|
||||
Case GetType(Label)
|
||||
Dim label As Label = DirectCast(control, Label)
|
||||
ControlLoader.Label.LoadValue(label, recordId, parentRecordId, value, entity_ID)
|
||||
Case GetType(Label)
|
||||
Dim label As Label = DirectCast(control, Label)
|
||||
ControlLoader.Label.LoadValue(label, recordId, parentRecordId, value, entity_ID)
|
||||
|
||||
Case GetType(CustomComboBox)
|
||||
Case GetType(CustomComboBox)
|
||||
|
||||
Dim combobox As CustomComboBox = DirectCast(control, CustomComboBox)
|
||||
ControlLoader.Combobox.LoadValue(combobox, recordId, parentRecordId, value)
|
||||
Dim combobox As CustomComboBox = DirectCast(control, CustomComboBox)
|
||||
ControlLoader.Combobox.LoadValue(combobox, recordId, parentRecordId, value)
|
||||
|
||||
Case GetType(CheckBox)
|
||||
Dim checkbox As CheckBox = DirectCast(control, CheckBox)
|
||||
ControlLoader.Checkbox.LoadValue(checkbox, value)
|
||||
Case GetType(CheckBox)
|
||||
Dim checkbox As CheckBox = DirectCast(control, CheckBox)
|
||||
ControlLoader.Checkbox.LoadValue(checkbox, value)
|
||||
|
||||
Case GetType(RadioButton)
|
||||
LOGGER.Debug("Sub LoadControlValueNeu - GetType(RadioButton) ", False)
|
||||
Case GetType(RadioButton)
|
||||
LOGGER.Debug("Sub LoadControlValueNeu - GetType(RadioButton) ")
|
||||
Dim radiobutton As RadioButton = DirectCast(control, RadioButton)
|
||||
ControlLoader.RadioButton.LoadValue(radiobutton, value)
|
||||
ControlLoader.RadioButton.LoadValue(radiobutton, value)
|
||||
|
||||
Case GetType(DevExpress.XtraEditors.DateEdit)
|
||||
Dim datepicker As DevExpress.XtraEditors.DateEdit = DirectCast(control, DevExpress.XtraEditors.DateEdit)
|
||||
ControlLoader.DateTimePicker.LoadValue(datepicker, value)
|
||||
Case GetType(DevExpress.XtraEditors.DateEdit)
|
||||
Dim datepicker As DevExpress.XtraEditors.DateEdit = DirectCast(control, DevExpress.XtraEditors.DateEdit)
|
||||
ControlLoader.DateTimePicker.LoadValue(datepicker, value)
|
||||
|
||||
Case GetType(DevExpress.XtraEditors.ListBoxControl)
|
||||
Dim listbox As DevExpress.XtraEditors.ListBoxControl = DirectCast(control, DevExpress.XtraEditors.ListBoxControl)
|
||||
ControlLoader.ListBox.LoadValue(listbox, value)
|
||||
Case GetType(DevExpress.XtraEditors.ListBoxControl)
|
||||
Dim listbox As DevExpress.XtraEditors.ListBoxControl = DirectCast(control, DevExpress.XtraEditors.ListBoxControl)
|
||||
ControlLoader.ListBox.LoadValue(listbox, value)
|
||||
|
||||
Case GetType(DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
Dim checkedlistbox As DevExpress.XtraEditors.CheckedListBoxControl = DirectCast(control, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
ControlLoader.CheckedListBox.LoadValue(checkedlistbox, values)
|
||||
Case GetType(DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
Dim checkedlistbox As DevExpress.XtraEditors.CheckedListBoxControl = DirectCast(control, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
ControlLoader.CheckedListBox.LoadValue(checkedlistbox, values)
|
||||
|
||||
Case GetType(PictureBox)
|
||||
Dim picturebox = DirectCast(control, PictureBox)
|
||||
LoadImage(recordId, controlId, picturebox)
|
||||
Case GetType(PictureBox)
|
||||
Dim picturebox = DirectCast(control, PictureBox)
|
||||
LoadImage(recordId, controlId, picturebox)
|
||||
|
||||
Case GetType(DataGridView)
|
||||
Dim gridview = DirectCast(control, DataGridView)
|
||||
ControlLoader.DataGridView.LoadValue(gridview, values)
|
||||
Case GetType(DataGridView)
|
||||
Dim gridview = DirectCast(control, DataGridView)
|
||||
ControlLoader.DataGridView.LoadValue(gridview, values)
|
||||
|
||||
Case GetType(DevExpress.XtraGrid.GridControl)
|
||||
Dim gridcontrol As DevExpress.XtraGrid.GridControl = DirectCast(control, DevExpress.XtraGrid.GridControl)
|
||||
ControlLoader.DataGridViewCheckable.LoadValue(gridcontrol, values)
|
||||
Case Else
|
||||
If GetType(Control).ToString() <> "System.Windows.Forms.Control" Then
|
||||
LOGGER.Warn("Sub LoadControlValue - Control-Type nicht berücksichtigt: " & GetType(Control).ToString(), False)
|
||||
Case GetType(DevExpress.XtraGrid.GridControl)
|
||||
Dim gridcontrol As DevExpress.XtraGrid.GridControl = DirectCast(control, DevExpress.XtraGrid.GridControl)
|
||||
ControlLoader.DataGridViewCheckable.LoadValue(gridcontrol, values)
|
||||
Case Else
|
||||
If GetType(Control).ToString() <> "System.Windows.Forms.Control" Then
|
||||
LOGGER.Warn("Sub LoadControlValue - Control-Type nicht berücksichtigt: " & GetType(Control).ToString())
|
||||
End If
|
||||
|
||||
End Select
|
||||
End Select
|
||||
'Catch ex As Exception
|
||||
' Logger.Warn("Unexpected Error in LoadControlValue: " & ex.Message)
|
||||
' MsgBox("Error in LoadControlValue:" & vbNewLine & ex.Message)
|
||||
@@ -332,7 +332,7 @@ Public Class ClassControlValues
|
||||
'Dim SQL As String = String.Format("SELECT CONTROL_ID, CONTROL_CONNID_1,CONTROL_SQLCOMMAND_1 AS SQL FROM VWPMO_CONTROL_SCREEN WHERE FORM_ID = {0} AND CONTROL_SQLCOMMAND_1 NOT LIKE '%@%'", FormID)
|
||||
Dim Sql = String.Format("FORM_ID = {0} AND CONTROL_SQLCOMMAND_1 NOT LIKE '%@%'", FormID)
|
||||
|
||||
Dim dt As DataTable = ClassHelper.FILTER_DATATABLE(DT_VWPMO_CONTROL_SCREEN, Sql, "") 'ClassDatabase.Return_Datatable(SQL, True)
|
||||
Dim dt As DataTable = ClassHelper.FILTER_DATATABLE(DT_VWPMO_CONTROL_SCREEN, Sql, "")
|
||||
sw.Done()
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@ Public Class ClassControlValues
|
||||
Dim commands As New List(Of String)
|
||||
Dim expression As String = String.Format("FORM_ID = {0} AND CONTROL_SQLCOMMAND_1 <> '' AND CONTROL_SQLCOMMAND_1 LIKE '%@%'", FormId)
|
||||
|
||||
Dim dt As DataTable = ClassHelper.FILTER_DATATABLE(DT_VWPMO_CONTROL_SCREEN, expression, "") 'ClassDatabase.Return_Datatable(SQL, True)
|
||||
Dim dt As DataTable = ClassHelper.FILTER_DATATABLE(DT_VWPMO_CONTROL_SCREEN, expression, "")
|
||||
|
||||
If dt.Rows.Count = 0 Then
|
||||
Exit Sub
|
||||
@@ -421,7 +421,7 @@ Public Class ClassControlValues
|
||||
'eigentlich sollte eine Parent_RecordID da sein
|
||||
Try
|
||||
Dim _SQL = String.Format("SELECT RECORD1_ID FROM TBPMO_RECORD_CONNECT WHERE RECORD2_ID = {0}", RecordId)
|
||||
Dim ParentRec = ClassDatabase.Execute_Scalar(_SQL)
|
||||
Dim ParentRec = MYDB_ECM.ExecuteNonQuery(_SQL)
|
||||
If Not IsNothing(ParentRec) Then
|
||||
If ParentRec > 0 Then
|
||||
ParentRecordId = ParentRec
|
||||
@@ -482,7 +482,7 @@ Public Class ClassControlValues
|
||||
& "AND LEN(SQL_COMMAND_2) > 10 AND SQL_COMMAND_2 LIKE '%@%@%'", FormId)
|
||||
Dim sw As New SW("Enable_Depending_Controls")
|
||||
Dim commands As New List(Of String)
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||
Dim dt As DataTable = MYDB_ECM.GetDatatable(SQL)
|
||||
|
||||
If dt.Rows.Count = 0 Then
|
||||
Exit Sub
|
||||
@@ -491,11 +491,11 @@ Public Class ClassControlValues
|
||||
' Durchlaufe alle Controls, die eine Abhängigheit haben
|
||||
For Each row As DataRow In dt.Rows
|
||||
Dim msg = String.Format("Working on Depending Control-ID: {0}", row.Item("GUID").ToString)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
Dim DependingControlId As Integer = row.Item("GUID")
|
||||
Dim DependingControlSQL As String = row.Item("SQL_COMMAND_2")
|
||||
msg = String.Format("SQL: {0}", DependingControlSQL)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
Dim DependingControl As Control = controls.OfType(Of Control)().Where(Function(c As Control)
|
||||
Return DirectCast(c.Tag, ClassControlMetadata).Id = DependingControlId
|
||||
End Function).SingleOrDefault()
|
||||
@@ -526,27 +526,27 @@ Public Class ClassControlValues
|
||||
Select Case otherControlType
|
||||
Case "CheckBox"
|
||||
msg = String.Format("CheckBox-CtrlID: {0}", otherControlId)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
value = DirectCast(otherControl, CheckBox).Checked
|
||||
Case "TextBox"
|
||||
msg = String.Format("TextBox-CtrlID: {0}", otherControlId)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
value = DirectCast(otherControl, TextBox).Text
|
||||
Case "CustomComboBox"
|
||||
msg = String.Format("CustomComboBox-CtrlID: {0}", otherControlId)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
value = DirectCast(otherControl, CustomComboBox).Text
|
||||
Case "DateEdit"
|
||||
msg = String.Format("DateEdit-CtrlID: {0}", otherControlId)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
value = DirectCast(otherControl, DevExpress.XtraEditors.DateEdit).EditValue
|
||||
End Select
|
||||
|
||||
' Jetzt ersetzen wir den Platzhalter im SQL Command
|
||||
DependingControlSQL = regex.Replace(DependingControlSQL, value)
|
||||
msg = String.Format("DependingControlSQL: {0}", DependingControlSQL)
|
||||
LOGGER.Debug(msg, False)
|
||||
Dim enableDT As DataTable = ClassDatabase.Return_Datatable(DependingControlSQL)
|
||||
LOGGER.Debug(msg)
|
||||
Dim enableDT As DataTable = MYDB_ECM.GetDatatable(DependingControlSQL)
|
||||
If IsNothing(enableDT) Then
|
||||
msg = String.Format("enableDT is nothing!! CHECK SQL {0}." & vbNewLine, DependingControlSQL)
|
||||
LOGGER.Warn(msg)
|
||||
@@ -564,10 +564,10 @@ Public Class ClassControlValues
|
||||
DependingControl.Enabled = enabled
|
||||
If enabled = False Then
|
||||
msg = String.Format("Control {0} will be disabled." & vbNewLine, DependingControlId.ToString)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
Else
|
||||
msg = String.Format("Control {0} will be enabled." & vbNewLine, DependingControlId.ToString)
|
||||
LOGGER.Debug(msg, False)
|
||||
LOGGER.Debug(msg)
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -576,7 +576,7 @@ Public Class ClassControlValues
|
||||
End If
|
||||
Next
|
||||
|
||||
sw.done
|
||||
sw.Done()
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in Enable_Depending_Controls: " & ex.Message, True)
|
||||
MsgBox("Unexpected Error in Enable_Depending_Controls:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
@@ -612,7 +612,7 @@ Public Class ClassControlValues
|
||||
Public Shared Sub LoadImage(RecordID As Integer, ControlID As Integer, control As Control)
|
||||
Dim picbox As PictureBox = DirectCast(control, PictureBox)
|
||||
Dim SQL As String = String.Format("SELECT IMG FROM TBPMO_CONTROL_IMAGE WHERE RECORD_ID = {0} AND CONTROL_ID = {1}", RecordID, ControlID)
|
||||
Dim bimage As Byte() = ClassDatabase.Execute_Scalar(SQL)
|
||||
Dim bimage As Byte() = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
If Not IsNothing(bimage) Then
|
||||
picbox.BackgroundImage = ByteArrayToBitmap(bimage)
|
||||
@@ -713,9 +713,9 @@ Public Class ClassControlValues
|
||||
ClearControlValues(controls)
|
||||
|
||||
' Alle Controls laden, die einen Default Value haben
|
||||
Dim SQL As String = String.Format("SELECT CONTROL_ID, CONTROL_DEF_VALUE, CONTROL_NAME FROM VWPMO_CONTROL_SCREEN WHERE FORM_ID = {0} AND CONTROL_DEF_VALUE <> '' " & _
|
||||
Dim SQL As String = String.Format("SELECT CONTROL_ID, CONTROL_DEF_VALUE, CONTROL_NAME FROM VWPMO_CONTROL_SCREEN WHERE FORM_ID = {0} AND CONTROL_DEF_VALUE <> '' " &
|
||||
"UNION SELECT CONTROL_ID, CONTROL_SQLCOMMAND_1 AS CONTROL_DEF_VALUE, CONTROL_NAME FROM VWPMO_CONTROL_SCREEN where FORM_ID = {0} and CONTROL_SQLCOMMAND_1 <> '' AND CONTROL_SQLCOMMAND_1 NOT LIKE '%@%@%' AND CONTROL_SQLCOMMAND_1 LIKE '%@RECORD_ID%'", FormID)
|
||||
Dim DEFAULT_VALUE_DT As DataTable = ClassDatabase.Return_Datatable(SQL, True)
|
||||
Dim DEFAULT_VALUE_DT As DataTable = MYDB_ECM.GetDatatable(SQL)
|
||||
|
||||
For Each row As DataRow In DEFAULT_VALUE_DT.Rows
|
||||
|
||||
@@ -726,7 +726,7 @@ Public Class ClassControlValues
|
||||
|
||||
Try
|
||||
Dim control As Control = controls.Find(controlName, False)(0)
|
||||
LoadDefaultValue(controlId, RecordID, Control, parentRecordID, EntityID, defaultValue)
|
||||
LoadDefaultValue(controlId, RecordID, control, parentRecordID, EntityID, defaultValue)
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in getting default value for control '" & controlName & " - " & ex.Message, True)
|
||||
End Try
|
||||
@@ -777,10 +777,10 @@ Public Class ClassControlValues
|
||||
Public Shared Sub LoadDefaultValue(ControlID As Integer, RecordID As Integer, control As Control, ParentRecordId As Integer, entity_ID As Integer, defaultValue As Object)
|
||||
Try
|
||||
'Dim SQL = String.Format("SELECT CONTROL_DEF_VALUE FROM VWPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0} and CONTROL_DEF_VALUE <> ''", ControlID)
|
||||
'Dim defaultValue = ClassDatabase.Execute_Scalar(SQL)
|
||||
'Dim defaultValue = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
'Dim SQL = "SELECT * FROM VWPMO_CONTROL_SCREEN WHERE CONTROL_ID = " & ControlID
|
||||
'Dim DT As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||
'Dim DT As DataTable = MYDB_ECM.GetDatatable(SQL)
|
||||
'Dim result = DT.Rows(0).Item("CONTROL_DEF_VALUE")
|
||||
|
||||
Select Case control.GetType()
|
||||
@@ -799,7 +799,7 @@ Public Class ClassControlValues
|
||||
vorgabe = vorgabe.Replace("@RECORD_ID", CURRENT_RECORD_ID)
|
||||
vorgabe = vorgabe.Replace("@RECORDID", CURRENT_RECORD_ID)
|
||||
vorgabe = vorgabe.Replace("@PARENTRECORD_ID", CURRENT_PARENT_RECORD_ID)
|
||||
defaultValue = ClassDatabase.Execute_Scalar(vorgabe.ToString, True)
|
||||
defaultValue = MYDB_ECM.ExecuteNonQuery(vorgabe.ToString)
|
||||
If IsNothing(vorgabe) Then
|
||||
textbox.Text = ""
|
||||
End If
|
||||
@@ -850,8 +850,8 @@ Public Class ClassControlValues
|
||||
datepicker.EditValue = defaultValue
|
||||
Case GetType(Label)
|
||||
Dim lbl As Label = DirectCast(control, Label)
|
||||
Dim CONNID = ClassDatabase.Execute_Scalar(String.Format("SELECT CONNECTION_ID_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlID))
|
||||
'Dim SQL_AUTOVALUE As String = ClassDatabase.Execute_Scalar(String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlID))
|
||||
Dim CONNID = MYDB_ECM.ExecuteNonQuery(String.Format("SELECT CONNECTION_ID_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlID))
|
||||
|
||||
defaultValue = ClassControlValues.ReplaceSqlCommandPlaceholders(defaultValue, RecordID, ParentRecordId, entity_ID)
|
||||
|
||||
|
||||
@@ -859,12 +859,12 @@ Public Class ClassControlValues
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not IsNothing(CONNID) Then
|
||||
defaultValue = ClassDatabase.Execute_ScalarWithConnection(CONNID, defaultValue)
|
||||
Else
|
||||
defaultValue = ClassDatabase.Execute_Scalar(defaultValue, True)
|
||||
End If
|
||||
' AutoValue = ClassDatabase.Execute_Scalar(SQL)
|
||||
'If Not IsNothing(CONNID) Then
|
||||
' defaultValue = ClassDatabase.Execute_ScalarWithConnection(CONNID, defaultValue)
|
||||
'Else
|
||||
defaultValue = MYDB_ECM.ExecuteNonQuery(defaultValue)
|
||||
'End If
|
||||
' AutoValue = MYDB_ECM.GetScalarValue(SQL)
|
||||
|
||||
If Not IsNothing(defaultValue) And Not IsDBNull(defaultValue) Then
|
||||
lbl.Text = defaultValue
|
||||
@@ -882,7 +882,7 @@ Public Class ClassControlValues
|
||||
Try
|
||||
Dim sql = "SELECT VALUE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = " & Control_ID & " AND RECORD_ID = " & Record_ID
|
||||
CURRENT_LAST_SQL = sql
|
||||
Return ClassDatabase.Execute_Scalar(sql)
|
||||
Return MYDB_ECM.GetScalarValue(sql)
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in GetControlValueForControlID: " & ex.Message)
|
||||
MsgBox("Error in GetControlValueForControlID:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
|
||||
Reference in New Issue
Block a user