DAtabase integriert
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user