SQL Connection cleanup

This commit is contained in:
Jonathan Jenne 2022-08-09 15:18:47 +02:00
parent 8c76b53273
commit 7c9160a270
14 changed files with 144 additions and 140 deletions

View File

@ -117,21 +117,14 @@ Public Class ClassInit
INDEX_DMS_ERSTELLT = CONFIG.Config.IndexDmsErstellt INDEX_DMS_ERSTELLT = CONFIG.Config.IndexDmsErstellt
INDEX_DMS_ERSTELLT_ZEIT = CONFIG.Config.IndexDmsErstelltZeit INDEX_DMS_ERSTELLT_ZEIT = CONFIG.Config.IndexDmsErstelltZeit
USER_MANAGER_PATH = CONFIG.Config.UserManagerPath
USER_CONFIG_DEBUG = CONFIG.Config.DEBUG USER_CONFIG_DEBUG = CONFIG.Config.DEBUG
If USER_CONFIG_DEBUG = True Then If USER_CONFIG_DEBUG = True Then
DEBUG = True DEBUG = True
LOGCONFIG.Debug = True LOGCONFIG.Debug = True
End If End If
TEST_MODE = CONFIG.Config.TestMode
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
End Try End Try
'Settings_Load()
End Sub End Sub
Private Function DecryptConnectionString(EncryptedConnectionString As String) As String Private Function DecryptConnectionString(EncryptedConnectionString As String) As String

View File

@ -12,22 +12,27 @@ Public Class ClassSQLEditor
End Function End Function
Public Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object Public Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object
Dim svc As IWindowsFormsEditorService = TryCast(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService) Dim oService As IWindowsFormsEditorService = TryCast(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
Dim SQLSTring As String = DirectCast(value, SQLValue).Value
If svc IsNot Nothing AndAlso SQLSTring IsNot Nothing Then Dim oValueObject = DirectCast(value, SQLValue)
Dim oSQLString As String = oValueObject.Value
Dim oSQLConnection As Integer = oValueObject.ConnectionId
If oService IsNot Nothing AndAlso oSQLString IsNot Nothing Then
'CURRENT_DESIGN_TYPE = "INPUT_INDEX" 'CURRENT_DESIGN_TYPE = "INPUT_INDEX"
Using oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM) Using oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM)
oForm.SQLCommand = SQLSTring oForm.SQLCommand = oSQLString
oForm.SQLConnection = oSQLConnection
oForm.PlaceholdersManualPrefix = "CTRL" oForm.PlaceholdersManualPrefix = "CTRL"
oForm.PlaceholdersManualTitle = "Controls" oForm.PlaceholdersManualTitle = "Controls"
oForm.PlaceholdersManual = CURRENT_CONTROL_NAME_LIST.ToDictionary(Function(name) name, Function(name) name) oForm.PlaceholdersManual = CURRENT_CONTROL_NAME_LIST.
ToDictionary(Function(name) name, Function(name) name)
If svc.ShowDialog(oForm) = DialogResult.OK Then If oService.ShowDialog(oForm) = DialogResult.OK Then
Dim sql As New SQLValue(oForm.SQLCommand) Dim sql As New SQLValue(oForm.SQLCommand, oForm.SQLConnection)
CURRENT_SQL_CON = oForm.SQLConnection ' CURRENT_CONN_ID_FINAL_INDEX = oForm.SQLConnection
CURRENT_CONN_ID = oForm.SQLConnection ' CURRENT_CONN_ID = oForm.SQLConnection
value = sql value = sql
End If End If
End Using End Using

View File

@ -7,12 +7,18 @@ Imports System.Drawing.Design
<TypeConverter(GetType(SQLTypeConverter))> <TypeConverter(GetType(SQLTypeConverter))>
Public Class SQLValue Public Class SQLValue
Public Property Value As String Public Property Value As String
Public Property ConnectionId As Integer
Public Sub New() Public Sub New()
Me.Value = "" Value = ""
End Sub End Sub
Public Sub New(value As String) Public Sub New(value As String)
Me.Value = value Me.Value = value
End Sub End Sub
Public Sub New(pValue As String, pConnectionId As Integer)
Value = pValue
ConnectionId = pConnectionId
End Sub
End Class End Class

View File

@ -84,10 +84,12 @@ Public Module ModuleControlProperties
Private _index_type As String Private _index_type As String
Private _sql_command As String Private _sql_command As String
Friend _sql_connection As Integer = 0
Private _Override_SQL As String Private _Override_SQL As String
Private _Enable_SQL As String Private _Enable_SQL As String
Private _Enable_SQL_ONLOAD As String Private _Enable_SQL_ONLOAD As String
Private _default_value Private _default_value
Friend _set_control_data As String
<Category(ClassConstants.CAT_BEHAVIOUR)> <Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property Active() As Boolean Public Property Active() As Boolean
@ -122,10 +124,23 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_DATA)> <Category(ClassConstants.CAT_DATA)>
Public Property SQLCommand() As SQLValue Public Property SQLCommand() As SQLValue
Get Get
Return New SQLValue(NotNull(_sql_command, "")) Return New SQLValue(NotNull(_sql_command, ""), _sql_connection)
End Get End Get
Set(ByVal value As SQLValue) Set(ByVal value As SQLValue)
_sql_command = value.Value _sql_command = value.Value
SQLConnection = value.ConnectionId
End Set
End Property
<DisplayName("SQL Connection")>
<Category(ClassConstants.CAT_INFORMATION)>
<[ReadOnly](True)>
Public Property SQLConnection() As Integer
Get
Return _sql_connection
End Get
Set(value As Integer)
_sql_connection = value
End Set End Set
End Property End Property
@ -133,10 +148,11 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_VALIDATION)> <Category(ClassConstants.CAT_VALIDATION)>
Public Property Override_SQL() As SQLValue Public Property Override_SQL() As SQLValue
Get Get
Return New SQLValue(NotNull(_Override_SQL, "")) Return New SQLValue(NotNull(_Override_SQL, ""), _sql_connection)
End Get End Get
Set(ByVal value As SQLValue) Set(ByVal value As SQLValue)
_Override_SQL = value.Value _Override_SQL = value.Value
SQLConnection = value.ConnectionId
End Set End Set
End Property End Property
@ -144,10 +160,11 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_BEHAVIOUR)> <Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property Enable_SQL() As SQLValue Public Property Enable_SQL() As SQLValue
Get Get
Return New SQLValue(NotNull(_Enable_SQL, "")) Return New SQLValue(NotNull(_Enable_SQL, ""), _sql_connection)
End Get End Get
Set(ByVal value As SQLValue) Set(ByVal value As SQLValue)
_Enable_SQL = value.Value _Enable_SQL = value.Value
SQLConnection = value.ConnectionId
End Set End Set
End Property End Property
@ -155,10 +172,11 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_BEHAVIOUR)> <Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property Enable_SQL_OnLoad() As SQLValue Public Property Enable_SQL_OnLoad() As SQLValue
Get Get
Return New SQLValue(NotNull(_Enable_SQL_ONLOAD, "")) Return New SQLValue(NotNull(_Enable_SQL_ONLOAD, ""), _sql_connection)
End Get End Get
Set(ByVal value As SQLValue) Set(ByVal value As SQLValue)
_Enable_SQL_ONLOAD = value.Value _Enable_SQL_ONLOAD = value.Value
SQLConnection = value.ConnectionId
End Set End Set
End Property End Property
@ -174,12 +192,24 @@ Public Module ModuleControlProperties
End Property End Property
End Class End Class
Public Class TextboxProperties Public Class InputPropertiesWithControlData
Inherits InputProperties Inherits InputProperties
<DisplayName("Set Control Data SQL")> <DisplayName("Set Control Data SQL")>
<Category(ClassConstants.CAT_BEHAVIOUR)> <Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property SetControlData As SQLValue Public Property SetControlData As SQLValue
Get
Return New SQLValue(_set_control_data, _sql_connection)
End Get
Set(value As SQLValue)
_set_control_data = value.Value
SQLConnection = value.ConnectionId
End Set
End Property
End Class
Public Class TextboxProperties
Inherits InputPropertiesWithControlData
<DisplayName("Regex Pattern")> <DisplayName("Regex Pattern")>
<Category(ClassConstants.CAT_VALIDATION)> <Category(ClassConstants.CAT_VALIDATION)>
@ -200,26 +230,19 @@ Public Module ModuleControlProperties
End Class End Class
Public Class CheckboxProperties Public Class CheckboxProperties
Inherits InputProperties Inherits InputPropertiesWithControlData
<Category(ClassConstants.CAT_DISPLAY)> <Category(ClassConstants.CAT_DISPLAY)>
Public Property Text() As String Public Property Text() As String
<DisplayName("Set Control Data SQL")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property SetControlData As SQLValue
End Class End Class
Public Class ComboboxProperties Public Class ComboboxProperties
Inherits InputProperties Inherits InputPropertiesWithControlData
<Category(ClassConstants.CAT_DISPLAY)> <Category(ClassConstants.CAT_DISPLAY)>
Public Property Text() As String Public Property Text() As String
<DisplayName("Set Control Data SQL")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property SetControlData As SQLValue
<Browsable(False)> <Browsable(False)>
Public Property ChoiceLists() As List(Of String) Public Property ChoiceLists() As List(Of String)
@ -270,6 +293,7 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_BEHAVIOUR)> <Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property AllowAddNewValues As Boolean Public Property AllowAddNewValues As Boolean
End Class End Class
Public Class ButtonProperties Public Class ButtonProperties
Inherits InputProperties Inherits InputProperties
@ -290,8 +314,9 @@ Public Module ModuleControlProperties
End Set End Set
End Property End Property
End Class End Class
Public Class LookupControlProperties Public Class LookupControlProperties
Inherits InputProperties Inherits InputPropertiesWithControlData
<DisplayName("Multi Select")> <DisplayName("Multi Select")>
<Category(ClassConstants.CAT_BEHAVIOUR)> <Category(ClassConstants.CAT_BEHAVIOUR)>
@ -312,11 +337,6 @@ Public Module ModuleControlProperties
<DisplayName("Display As Combobox Control")> <DisplayName("Display As Combobox Control")>
<Category(ClassConstants.CAT_BEHAVIOUR)> <Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property DisplayAsComboBox As Boolean Public Property DisplayAsComboBox As Boolean
<DisplayName("Set Control Data SQL")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property SetControlData As SQLValue
End Class End Class
Public Class LineLabelProperties Public Class LineLabelProperties

View File

@ -1,37 +1,25 @@
Module ModuleMySettings Module ModuleMySettings
' Connection String ' Connection String
Public SOURCE_INIT As Boolean = False Public Property SOURCE_INIT As Boolean = False
Public CONNECTION_STRING_ECM As String = "" Public Property CONNECTION_STRING_ECM As String = ""
Public CONNECTION_STRING_IDB As String = "" Public Property CONNECTION_STRING_IDB As String = ""
Public IDB_ACTIVE As Boolean = False Public Property IDB_ACTIVE As Boolean = False
Public EDMIAppServerActive As Boolean = False Public Property EDMIAppServerActive As Boolean = False
Public OPERATION_MODE_FS As String = "PURE_WM" Public Property OPERATION_MODE_FS As String = "PURE_WM"
Public IDB_USES_WMFILESTORE As Boolean = False Public Property IDB_USES_WMFILESTORE As Boolean = False
Public BASIC_CONF_VISIBLE As Boolean = True Public Property BASIC_CONF_VISIBLE As Boolean = True
Public IDB_DOC_DATA_SQL As String Public Property IDB_DOC_DATA_SQL As String
Public IDB_DT_DOC_DATA As DataTable Public Property IDB_DT_DOC_DATA As DataTable
Public TEST_MODE As String = False Public Property NO_DETAIL_PROFILES As Boolean = False
Public NO_DETAIL_PROFILES As Boolean = False
Public DT_CONNECTIONS As DataTable
' Debug Settings ' Debug Settings
Public DEBUG As Boolean = False Public Property DEBUG As Boolean = False
' Viewer Settings Public Property INDEX_DMS_ERSTELLT = "DMS erstellt"
'Public VIEWER_UNIVERSAL As String = "" Public Property INDEX_DMS_ERSTELLT_ZEIT = "DMS erstellt (Zeit)"
'Public VIEWER_XCHANGE As String = ""
'Public VIEWER_SUMATRA As String = ""
'Public VIEWER_ZOOM_LEVEL As Integer = 3
'Public VIEWER_PDF As String = "internal"
'Public VIEWER_ALL As String = "docview"
Public INDEX_DMS_ERSTELLT = "DMS erstellt"
Public INDEX_DMS_ERSTELLT_ZEIT = "DMS erstellt (Zeit)"
Public USER_MANAGER_PATH = ""
' These settings are loaded from the database ' These settings are loaded from the database
Public VERSION_DELIMITER As String = "~" Public Property VERSION_DELIMITER As String = "~"
Public FILE_DELIMITER As String = "_" Public Property FILE_DELIMITER As String = "_"
Public WMSESSION_STARTSTOP_STARTUP As Boolean = False Public Property WMSESSION_STARTSTOP_STARTUP As Boolean = False
End Module End Module

View File

@ -7,7 +7,6 @@ Imports DigitalData.Modules.ZooFlow
Module ModuleRuntimeVariables Module ModuleRuntimeVariables
Public Property Database As DatabaseWithFallback
Public Property DatabaseECM As MSSQLServer Public Property DatabaseECM As MSSQLServer
Public Property DatabaseIDB As MSSQLServer Public Property DatabaseIDB As MSSQLServer
Public Property EDMIService As New State.ServiceState Public Property EDMIService As New State.ServiceState
@ -29,7 +28,6 @@ Module ModuleRuntimeVariables
Public Property CURRENT_ProfilGUID As Integer Public Property CURRENT_ProfilGUID As Integer
Public Property CURRENT_ProfilName As String Public Property CURRENT_ProfilName As String
Public Property CURRENT_PROFILE_LOG_INDEX As String Public Property CURRENT_PROFILE_LOG_INDEX As String
Public Property CURRENT_HTML_DOC As String
Public Property CURRENT_DOC_GUID As Integer Public Property CURRENT_DOC_GUID As Integer
Public Property CURRENT_DOC_ID As Integer Public Property CURRENT_DOC_ID As Integer
@ -38,8 +36,6 @@ Module ModuleRuntimeVariables
Public Property CURRENT_CONVERSATION_NEW As Long Public Property CURRENT_CONVERSATION_NEW As Long
Public Property CURRENT_CONN_ID As Integer
Public Property CURRENT_JUMP_DOC_GUID As Integer Public Property CURRENT_JUMP_DOC_GUID As Integer
Public Property CURRENT_WMFILE As WMObject Public Property CURRENT_WMFILE As WMObject
@ -47,7 +43,6 @@ Module ModuleRuntimeVariables
Public Property ERROR_STATE = "" Public Property ERROR_STATE = ""
Public Property USER_USERNAME As String Public Property USER_USERNAME As String
Public Property DT_USER2MODULE As DataTable
Public Property CHANGES_FORM_DESIGN As Boolean = False Public Property CHANGES_FORM_DESIGN As Boolean = False
@ -107,9 +102,6 @@ Module ModuleRuntimeVariables
Public Property CURRENT_INDEX_ID As Integer Public Property CURRENT_INDEX_ID As Integer
Public Property CURRENT_OBJECTTYPE As String Public Property CURRENT_OBJECTTYPE As String
Public Property CURRENT_DESIGN_TYPE As String = "FINAL_INDEX" Public Property CURRENT_DESIGN_TYPE As String = "FINAL_INDEX"
Public Property CURRENT_SQL_CON As Integer
Public Property CURRENT_SQL_COMAMND As String
Public Property CURRENT_DT_SQL_CONFIG_TABLE As DataTable
Public Property CURRENT_CLICKED_PROFILE_ID As Integer = 0 Public Property CURRENT_CLICKED_PROFILE_ID As Integer = 0
Public Property CURRENT_CLICKED_PROFILE_TITLE As String Public Property CURRENT_CLICKED_PROFILE_TITLE As String
@ -130,12 +122,8 @@ Module ModuleRuntimeVariables
Public Property CURRENT_DT_PROFILES As DataTable Public Property CURRENT_DT_PROFILES As DataTable
Public Property CURRENT_DT_PROFILE As DataTable Public Property CURRENT_DT_PROFILE As DataTable
Public Property CURRENT_CONTROL_LIST As New List(Of Control)
Public Property CURRENT_CONTROL_NAME_LIST As New List(Of String) Public Property CURRENT_CONTROL_NAME_LIST As New List(Of String)
Public CURRENT_INDEX_ARRAY(100, 250) As String
Public Property DTVWCONTROLS_INDEX As DataTable Public Property DTVWCONTROLS_INDEX As DataTable
Public Property DTVWCONTROL_INDEX As DataTable Public Property DTVWCONTROL_INDEX As DataTable

View File

@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")> <Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("TaskFlow")> <Assembly: AssemblyProduct("TaskFlow")>
<Assembly: AssemblyCopyright("Copyright © Digital Data 2022")> <Assembly: AssemblyCopyright("Copyright © Digital Data 2022")>
<Assembly: AssemblyTrademark("2.3.7.11")> <Assembly: AssemblyTrademark("2.3.7.12")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.3.7.11")> <Assembly: AssemblyVersion("2.3.7.12")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -247,7 +247,7 @@
<value>58</value> <value>58</value>
</data> </data>
<data name="gridAssignedUsers.Size" type="System.Drawing.Size, System.Drawing"> <data name="gridAssignedUsers.Size" type="System.Drawing.Size, System.Drawing">
<value>740, 221</value> <value>740, 220</value>
</data> </data>
<data name="gridAssignedUsers.TabIndex" type="System.Int32, mscorlib"> <data name="gridAssignedUsers.TabIndex" type="System.Int32, mscorlib">
<value>3</value> <value>3</value>
@ -415,7 +415,7 @@
<value>58</value> <value>58</value>
</data> </data>
<data name="gridAvailableUsers.Size" type="System.Drawing.Size, System.Drawing"> <data name="gridAvailableUsers.Size" type="System.Drawing.Size, System.Drawing">
<value>740, 196</value> <value>740, 197</value>
</data> </data>
<data name="gridAvailableUsers.TabIndex" type="System.Int32, mscorlib"> <data name="gridAvailableUsers.TabIndex" type="System.Int32, mscorlib">
<value>5</value> <value>5</value>
@ -502,7 +502,7 @@
<value>740, 471</value> <value>740, 471</value>
</data> </data>
<data name="SplitContainer_Profilzuordnung2.SplitterDistance" type="System.Int32, mscorlib"> <data name="SplitContainer_Profilzuordnung2.SplitterDistance" type="System.Int32, mscorlib">
<value>246</value> <value>245</value>
</data> </data>
<data name="SplitContainer_Profilzuordnung2.TabIndex" type="System.Int32, mscorlib"> <data name="SplitContainer_Profilzuordnung2.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@ -565,7 +565,7 @@
<value>58</value> <value>58</value>
</data> </data>
<data name="gridAssignedGroups.Size" type="System.Drawing.Size, System.Drawing"> <data name="gridAssignedGroups.Size" type="System.Drawing.Size, System.Drawing">
<value>740, 192</value> <value>740, 191</value>
</data> </data>
<data name="gridAssignedGroups.TabIndex" type="System.Int32, mscorlib"> <data name="gridAssignedGroups.TabIndex" type="System.Int32, mscorlib">
<value>3</value> <value>3</value>
@ -688,7 +688,7 @@
<value>58</value> <value>58</value>
</data> </data>
<data name="gridAvailableGroups.Size" type="System.Drawing.Size, System.Drawing"> <data name="gridAvailableGroups.Size" type="System.Drawing.Size, System.Drawing">
<value>740, 225</value> <value>740, 226</value>
</data> </data>
<data name="gridAvailableGroups.TabIndex" type="System.Int32, mscorlib"> <data name="gridAvailableGroups.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@ -778,7 +778,7 @@
<value>740, 471</value> <value>740, 471</value>
</data> </data>
<data name="SplitContainer1.SplitterDistance" type="System.Int32, mscorlib"> <data name="SplitContainer1.SplitterDistance" type="System.Int32, mscorlib">
<value>217</value> <value>216</value>
</data> </data>
<data name="SplitContainer1.TabIndex" type="System.Int32, mscorlib"> <data name="SplitContainer1.TabIndex" type="System.Int32, mscorlib">
<value>1</value> <value>1</value>

View File

@ -229,8 +229,13 @@ Public Class frmAdministration
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles btnWMSuche.Click Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles btnWMSuche.Click
If IDB_ACTIVE = True Then If IDB_ACTIVE = True Then
CURRENT_DESIGN_TYPE = "IDB_SEARCH" CURRENT_DESIGN_TYPE = "IDB_SEARCH"
Dim oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM) With {.SQLCommand = Me.WD_SEARCHTextBox.Text, .SQLConnection = 1} Dim oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM) With {
.SQLCommand = Me.WD_SEARCHTextBox.Text,
.SQLConnection = 1,
.AllowSQLConnectionSelection = False
}
oForm.ShowDialog() oForm.ShowDialog()
If oForm.DialogResult = DialogResult.OK Then If oForm.DialogResult = DialogResult.OK Then
Me.WD_SEARCHTextBox.Text = oForm.SQLCommand Me.WD_SEARCHTextBox.Text = oForm.SQLCommand
End If End If
@ -960,20 +965,20 @@ Public Class frmAdministration
Dim oSequence As Int16 = NotNull(focusedRow.Item("SEQUENCE"), 0) Dim oSequence As Int16 = NotNull(focusedRow.Item("SEQUENCE"), 0)
Dim oIndetermined As Boolean = NotNull(focusedRow.Item("CONTINUE_INDETERMINED"), False) Dim oIndetermined As Boolean = NotNull(focusedRow.Item("CONTINUE_INDETERMINED"), False)
CURRENT_INDEX_ID = guid CURRENT_INDEX_ID = guid
CURRENT_SQL_CON = connectionId
Dim obj As New FinalIndexProperties() Dim obj As New FinalIndexProperties With {
obj.GUID = guid .GUID = guid,
obj.IndexName = index .IndexName = index,
obj.SQLCommand = New SQLValue(sqlCommand) .SQLCommand = New SQLValue(sqlCommand, connectionId),
obj.ConnectionId = connectionId .ConnectionId = connectionId,
obj.Description = description .Description = description,
obj.Active = active .Active = active,
obj.AllowAddNewValues = allowNewValues .AllowAddNewValues = allowNewValues,
obj.PreventDuplicates = preventDuplicates .PreventDuplicates = preventDuplicates,
obj.VectorBehaviour = VectorBehaviour .VectorBehaviour = VectorBehaviour,
obj.Sequence = oSequence .Sequence = oSequence,
obj.ContinueOnIndifferentState = oIndetermined .ContinueOnIndifferentState = oIndetermined
}
' Wenn eine neue Zeile hinzugefügt wird, auf StringValue setzen ' Wenn eine neue Zeile hinzugefügt wird, auf StringValue setzen
If e.FocusedRowHandle <> GridControl.NewItemRowHandle Then If e.FocusedRowHandle <> GridControl.NewItemRowHandle Then
obj = FINALINDICES.SetValue(value, obj, index, MyIndicies, MyIndicies_Types) obj = FINALINDICES.SetValue(value, obj, index, MyIndicies, MyIndicies_Types)
@ -992,7 +997,7 @@ Public Class frmAdministration
"Overwrite" "Overwrite"
} }
If Not index Is Nothing Then If index IsNot Nothing Then
Dim indexType As Integer = FINALINDICES.GetIndexType(index, MyIndicies, MyIndicies_Types) Dim indexType As Integer = FINALINDICES.GetIndexType(index, MyIndicies, MyIndicies_Types)
obj.VectorIndex = FINALINDICES.IsVectorIndex(indexType) obj.VectorIndex = FINALINDICES.IsVectorIndex(indexType)
End If End If
@ -1018,8 +1023,10 @@ Public Class frmAdministration
Dim value As SQLValue = e.ChangedItem.Value Dim value As SQLValue = e.ChangedItem.Value
If value.Value <> String.Empty Then If value.Value <> String.Empty Then
obj.ConnectionId = CURRENT_SQL_CON 'obj.ConnectionId = CURRENT_CONN_ID_FINAL_INDEX
obj.StringValue = "SQL-Command" obj.StringValue = "SQL-Command"
obj.ConnectionId = value.ConnectionId
'obj.FloatValue = 0 'obj.FloatValue = 0
' obj.IntegerValue = 0 ' obj.IntegerValue = 0
End If End If
@ -1268,8 +1275,11 @@ Public Class frmAdministration
Dim guid = obj.GUID Dim guid = obj.GUID
Dim oProfileId As Integer = PROFILGUIDTextBox.Text Dim oProfileId As Integer = PROFILGUIDTextBox.Text
Dim connectionId As Integer = obj.ConnectionId
'Dim connectionId As Integer = obj.ConnectionId
Dim connectionId As Integer = NotNull(obj.SQLCommand.ConnectionId, 1)
Dim sqlCommand As String = NotNull(obj.SQLCommand.Value, String.Empty).Replace("'", "''") Dim sqlCommand As String = NotNull(obj.SQLCommand.Value, String.Empty).Replace("'", "''")
Dim indexName As String = NotNull(obj.IndexName, String.Empty) Dim indexName As String = NotNull(obj.IndexName, String.Empty)
Dim isVectorIndex As Boolean = obj.VectorIndex Dim isVectorIndex As Boolean = obj.VectorIndex
Dim addedWho As String = USER_USERNAME Dim addedWho As String = USER_USERNAME

View File

@ -6,6 +6,7 @@ Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports DigitalData.Controls.LookupGrid Imports DigitalData.Controls.LookupGrid
Imports DigitalData.Modules.Language.Utils Imports DigitalData.Modules.Language.Utils
Imports DigitalData.Modules.Language
Imports System.Drawing Imports System.Drawing
Imports DigitalData.GUIs.Common Imports DigitalData.GUIs.Common
@ -292,8 +293,6 @@ Public Class frmFormDesigner
SetMovementHandlers(oButton) SetMovementHandlers(oButton)
End Select End Select
Next Next
CURRENT_CONTROL_LIST = pnldesigner.Controls.Cast(Of Control).ToList()
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
MsgBox("Fehler bei LoadControls " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") MsgBox("Fehler bei LoadControls " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
@ -786,7 +785,11 @@ Public Class frmFormDesigner
obj.Active = StrToBool(row.Item("CONTROL_ACTIVE")) obj.Active = StrToBool(row.Item("CONTROL_ACTIVE"))
obj.Index = NotNull(row.Item("INDEX_NAME"), "") obj.Index = NotNull(row.Item("INDEX_NAME"), "")
obj.DefaultValue = NotNull(row.Item("DEFAULT_VALUE"), Nothing) obj.DefaultValue = NotNull(row.Item("DEFAULT_VALUE"), Nothing)
obj.SQLCommand = New SQLValue(row.Item("SQL_UEBERPRUEFUNG"))
' Default value for ConnectionID
Dim oConnectionId = row.ItemEx("CONNECTION_ID", 0)
obj.SQLCommand = New SQLValue(row.Item("SQL_UEBERPRUEFUNG"), oConnectionId)
obj.SQLConnection = oConnectionId
Return obj Return obj
End Function End Function
@ -936,7 +939,10 @@ Public Class frmFormDesigner
Private Sub pgControls_PropertyValueChanged(s As Object, e As PropertyValueChangedEventArgs) Handles pgControls.PropertyValueChanged Private Sub pgControls_PropertyValueChanged(s As Object, e As PropertyValueChangedEventArgs) Handles pgControls.PropertyValueChanged
Dim oldValue As Object = e.OldValue Dim oldValue As Object = e.OldValue
Dim newValue = e.ChangedItem.Value Dim newValue = e.ChangedItem.Value
Dim prop As String = e.ChangedItem.Label
'Dim prop As String = e.ChangedItem.Label
Dim prop As String = e.ChangedItem.PropertyDescriptor.Name
Select Case prop Select Case prop
Case "DisplayAsLookUpControl" Case "DisplayAsLookUpControl"
@ -1016,29 +1022,27 @@ Public Class frmFormDesigner
CurrentControl.ForeColor = color CurrentControl.ForeColor = color
Case "SQLCommand" Case "SQLCommand"
UpdateSingleValue("SQL_UEBERPRUEFUNG", newValue) UpdateSingleValue("SQL_UEBERPRUEFUNG", newValue)
UpdateSingleValue("CONNECTION_ID", CURRENT_CONN_ID)
UpdateSingleValue("CHOICE_LIST", "") UpdateSingleValue("CHOICE_LIST", "")
Case "Enable_SQL" Case "Enable_SQL"
UpdateSingleValue("SQL_ENABLE", newValue) UpdateSingleValue("SQL_ENABLE", newValue)
UpdateSingleValue("CONNECTION_ID", CURRENT_CONN_ID)
UpdateSingleValue("CHOICE_LIST", "") UpdateSingleValue("CHOICE_LIST", "")
Case "Enable_SQL_OnLoad" Case "Enable_SQL_OnLoad"
UpdateSingleValue("SQL_ENABLE_ON_LOAD", newValue) UpdateSingleValue("SQL_ENABLE_ON_LOAD", newValue)
UpdateSingleValue("SQL_ENABLE_ON_LOAD_CONID", CURRENT_CONN_ID)
UpdateSingleValue("CHOICE_LIST", "") UpdateSingleValue("CHOICE_LIST", "")
Case "Override_SQL" Case "Override_SQL"
UpdateSingleValue("SQL2", newValue) UpdateSingleValue("SQL2", newValue)
UpdateSingleValue("CONNECTION_ID", CURRENT_CONN_ID)
UpdateSingleValue("CHOICE_LIST", "") UpdateSingleValue("CHOICE_LIST", "")
Case "SetControlData" Case "SetControlData"
UpdateSingleValue("SET_CONTROL_DATA", newValue) UpdateSingleValue("SET_CONTROL_DATA", newValue)
UpdateSingleValue("CONNECTION_ID", CURRENT_CONN_ID)
UpdateSingleValue("CHOICE_LIST", "") UpdateSingleValue("CHOICE_LIST", "")
Case "ChoiceList" Case "ChoiceList"
UpdateSingleValue("CHOICE_LIST", newValue) UpdateSingleValue("CHOICE_LIST", newValue)
UpdateSingleValue("SQL_UEBERPRUEFUNG", "") UpdateSingleValue("SQL_UEBERPRUEFUNG", "")
UpdateSingleValue("CONNECTION_ID", "NULL")
Case "MultiSelect" Case "MultiSelect"
UpdateSingleValue("MULTISELECT", IIf(newValue = True, 1, 0)) UpdateSingleValue("MULTISELECT", IIf(newValue = True, 1, 0))
@ -1103,6 +1107,8 @@ Public Class frmFormDesigner
ElseIf TypeOf value Is SQLValue Then ElseIf TypeOf value Is SQLValue Then
Dim v As SQLValue = value Dim v As SQLValue = value
escapedValue = $"'{v.Value.Replace("'", "''")}'" escapedValue = $"'{v.Value.Replace("'", "''")}'"
UpdateSingleValue("CONNECTION_ID", v.ConnectionId)
End If End If
Try Try

View File

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADw ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADw
CAAAAk1TRnQBSQFMAgEBAgEAARQBCQEUAQkBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo CAAAAk1TRnQBSQFMAgEBAgEAASQBCQEkAQkBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -1755,9 +1755,21 @@ Public Class frmMain
Dim oindex As Integer = 0 Dim oindex As Integer = 0
If Not IsNothing(BASEDATA_DTGRID_GROUPS) Then If Not IsNothing(BASEDATA_DTGRID_GROUPS) Then
For Each oGridGroup As DataRow In BASEDATA_DTGRID_GROUPS.Rows For Each oGridGroup As DataRow In BASEDATA_DTGRID_GROUPS.Rows
LOGGER.Debug($"Adding group [{oGridGroup.Item("GROUPNAME")}] for Grid...")
Dim oGroupName = oGridGroup.Item("GROUPNAME")
LOGGER.Debug($"Adding group [{oGroupName}] for Grid...")
Try Try
GridViewWFItems.Columns.Item(oGridGroup.Item("GROUPNAME")).GroupIndex = oindex Dim oGroupColumn As GridColumn = GridViewWFItems.Columns.Item(oGroupName)
If oGroupColumn IsNot Nothing Then
oGroupColumn.GroupIndex = oindex
oGroupColumn.Group()
oGroupColumn.OptionsColumn.AllowGroup = DefaultBoolean.False
oGroupColumn.OptionsColumn.AllowMove = DefaultBoolean.False
oGroupColumn.OptionsColumn.AllowShowHide = DefaultBoolean.False
oGroupColumn.Visible = False
End If
Catch ex As Exception Catch ex As Exception
End Try End Try

View File

@ -700,7 +700,6 @@ Public Class frmMassValidator
Dim oArrlist As New List(Of String) Dim oArrlist As New List(Of String)
oArrlist.Add(oWindreamValue.ToString) oArrlist.Add(oWindreamValue.ToString)
oLookup.Properties.SelectedValues = oArrlist oLookup.Properties.SelectedValues = oArrlist
'_CURRENT_INDEX_ARRAY(oCount, 1) = oWindreamValue.ToString
End If End If
Else Else
If Not IsNothing(oLookup.Properties.SelectedValues) Then If Not IsNothing(oLookup.Properties.SelectedValues) Then

View File

@ -73,7 +73,6 @@ Public Class frmValidator
Private Property _Indexe_Loaded As Boolean = False Private Property _Indexe_Loaded As Boolean = False
Public Shared Property idxerr_message As String = "" Public Shared Property idxerr_message As String = ""
Private _CURRENT_INDEX_ARRAY(100, 250) As String
Private Property _frmValidatorSearch As frmValidatorSearch 'You need a reference to Form1 Private Property _frmValidatorSearch As frmValidatorSearch 'You need a reference to Form1
Private Property _dependingControl_in_action As Boolean = False Private Property _dependingControl_in_action As Boolean = False
@ -2495,7 +2494,6 @@ Public Class frmValidator
WMDocPathWindows = "" WMDocPathWindows = ""
WMDocFileString = "" WMDocFileString = ""
CURRENT_HTML_DOC = ""
'Me.lblerror.Visible = False 'Me.lblerror.Visible = False
_Indexe_Loaded = False _Indexe_Loaded = False
@ -3028,7 +3026,6 @@ Public Class frmValidator
LOGGER.Debug("INDEX: " & oSourceIndexName & " - CONTROLNAME: " & oControl.Name & " - LOAD IDXVALUES: " & oLoadIndex.ToString) LOGGER.Debug("INDEX: " & oSourceIndexName & " - CONTROLNAME: " & oControl.Name & " - LOAD IDXVALUES: " & oLoadIndex.ToString)
_CURRENT_INDEX_ARRAY(oCount, 0) = oSourceIndexName
Select Case oType Select Case oType
Case "System.Windows.Forms.TextBox" Case "System.Windows.Forms.TextBox"
Try Try
@ -3041,7 +3038,6 @@ Public Class frmValidator
If oLoadIndex = False Or oSourceIndexName = "DD PM-ONLY FOR DISPLAY" Then If oLoadIndex = False Or oSourceIndexName = "DD PM-ONLY FOR DISPLAY" Then
' Wenn kein Index exisitiert, defaultValue laden ' Wenn kein Index exisitiert, defaultValue laden
oControl.Text = oDefaultValue oControl.Text = oDefaultValue
_CURRENT_INDEX_ARRAY(oCount, 1) = oDefaultValue
LOGGER.Debug("Indexwert soll nicht geladen werden.") LOGGER.Debug("Indexwert soll nicht geladen werden.")
Exit Select Exit Select
End If End If
@ -3082,11 +3078,9 @@ Public Class frmValidator
ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
_CURRENT_INDEX_ARRAY(oCount, 1) = NotNull(oValueFromSource, oDefaultValue)
Catch ex As Exception Catch ex As Exception
LOGGER.Info("ERROR while converting defaultValue [" & oDefaultValue & "]: " & ex.Message) LOGGER.Info("ERROR while converting defaultValue [" & oDefaultValue & "]: " & ex.Message)
oControl.Text = "" oControl.Text = ""
_CURRENT_INDEX_ARRAY(oCount, 1) = ""
End Try End Try
@ -3116,7 +3110,6 @@ Public Class frmValidator
oMyCombobox.SelectedIndex = -1 oMyCombobox.SelectedIndex = -1
Else Else
oMyCombobox.Text = oDefaultValue oMyCombobox.Text = oDefaultValue
_CURRENT_INDEX_ARRAY(oCount, 1) = oDefaultValue
End If End If
LOGGER.Debug($" oMyComboBox {oMyCombobox.Name}: Indexwert soll nicht geladen werden.") LOGGER.Debug($" oMyComboBox {oMyCombobox.Name}: Indexwert soll nicht geladen werden.")
Exit Select Exit Select
@ -3137,7 +3130,6 @@ Public Class frmValidator
Else Else
LOGGER.Debug($"oMyComboBox {oMyCombobox.Name}-defaultValue wird geladen") LOGGER.Debug($"oMyComboBox {oMyCombobox.Name}-defaultValue wird geladen")
oMyCombobox.Text = oDefaultValue oMyCombobox.Text = oDefaultValue
_CURRENT_INDEX_ARRAY(oCount, 1) = oDefaultValue
'cmb.SelectedIndex = cmb.FindStringExact(defaultValue) 'cmb.SelectedIndex = cmb.FindStringExact(defaultValue)
End If End If
Else Else
@ -3161,8 +3153,6 @@ Public Class frmValidator
LOGGER.Debug($"Indexwert from Index {oSourceIndexName}: {oValueFromSource}") LOGGER.Debug($"Indexwert from Index {oSourceIndexName}: {oValueFromSource}")
LOGGER.Debug($"Items in Combobox: {oMyCombobox.Items.Count}") LOGGER.Debug($"Items in Combobox: {oMyCombobox.Items.Count}")
_CURRENT_INDEX_ARRAY(oCount, 1) = oValueFromSource
LOGGER.Debug($"_CURRENT_INDEX_ARRAY set...")
If oMyCombobox.Items.Count = 0 Then If oMyCombobox.Items.Count = 0 Then
' If LogErrorsOnly = False Then LOGGER.Info($"Index Wert wurde gesetzt") ' If LogErrorsOnly = False Then LOGGER.Info($"Index Wert wurde gesetzt")
oMyCombobox.Text = oValueFromSource oMyCombobox.Text = oValueFromSource
@ -3396,7 +3386,6 @@ Public Class frmValidator
LOGGER.Info(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & oIndexName & "' ist nothing. Checking defaultvalue") LOGGER.Info(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & oIndexName & "' ist nothing. Checking defaultvalue")
LOGGER.Debug(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & oIndexName & "' ist nothing. Checking defaultvalue") LOGGER.Debug(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & oIndexName & "' ist nothing. Checking defaultvalue")
If oDefaultValue <> String.Empty Then If oDefaultValue <> String.Empty Then
_CURRENT_INDEX_ARRAY(oCount, 1) = oDefaultValue
LOGGER.Info($"Using Default value [{oDefaultValue}]") LOGGER.Info($"Using Default value [{oDefaultValue}]")
LOGGER.Debug($"Using Default value [{oDefaultValue}]") LOGGER.Debug($"Using Default value [{oDefaultValue}]")
myCheckBox.Checked = CBool(oDefaultValue) myCheckBox.Checked = CBool(oDefaultValue)
@ -3409,7 +3398,6 @@ Public Class frmValidator
Else Else
LOGGER.Debug("oValueFromSource: " & oValueFromSource.ToString) LOGGER.Debug("oValueFromSource: " & oValueFromSource.ToString)
_CURRENT_INDEX_ARRAY(oCount, 1) = oValueFromSource.ToString
If oValueFromSource.ToString = "" Then If oValueFromSource.ToString = "" Then
LOGGER.Info(">> Versuch, default Value zu laden") LOGGER.Info(">> Versuch, default Value zu laden")
If oDefaultValue <> String.Empty Then If oDefaultValue <> String.Empty Then
@ -3496,12 +3484,10 @@ Public Class frmValidator
End If End If
oLookup.Properties.SelectedValues = oArrlist oLookup.Properties.SelectedValues = oArrlist
_CURRENT_INDEX_ARRAY(oCount, 1) = oValueFromSource.ToString
Else Else
Dim oArrlist As New List(Of String) Dim oArrlist As New List(Of String)
oArrlist.Add(oValueFromSource.ToString) oArrlist.Add(oValueFromSource.ToString)
oLookup.Properties.SelectedValues = oArrlist oLookup.Properties.SelectedValues = oArrlist
_CURRENT_INDEX_ARRAY(oCount, 1) = oValueFromSource.ToString
End If End If
Else Else
If Not IsNothing(oLookup.Properties.SelectedValues) Then If Not IsNothing(oLookup.Properties.SelectedValues) Then
@ -3555,9 +3541,6 @@ Public Class frmValidator
ValueDTP = tempdate ValueDTP = tempdate
DTP.Text = tempdate DTP.Text = tempdate
End If End If
_CURRENT_INDEX_ARRAY(oCount, 1) = oValueFromSource.ToString
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
errormessage = "Unvorhergesehener Fehler bei DTP: " & vbNewLine & ex.Message errormessage = "Unvorhergesehener Fehler bei DTP: " & vbNewLine & ex.Message
@ -3566,13 +3549,7 @@ Public Class frmValidator
frmError.ShowDialog() frmError.ShowDialog()
LOGGER.Info("Unexpected error in FillIndex DTP: " & ex.Message, True) LOGGER.Info("Unexpected error in FillIndex DTP: " & ex.Message, True)
End Try End Try
End If End If
'Case Else
' MsgBox(Type)
End Select End Select
oCount += 1 oCount += 1
Next Next