diff --git a/app/TaskFlow/My Project/AssemblyInfo.vb b/app/TaskFlow/My Project/AssemblyInfo.vb index 350d697..2c19423 100644 --- a/app/TaskFlow/My Project/AssemblyInfo.vb +++ b/app/TaskFlow/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/app/TaskFlow/frmAdministration.vb b/app/TaskFlow/frmAdministration.vb index ea1695f..a7eff35 100644 --- a/app/TaskFlow/frmAdministration.vb +++ b/app/TaskFlow/frmAdministration.vb @@ -25,6 +25,7 @@ Public Class frmAdministration Private Property profile_guid As Integer = 0 Private Property DT_CHART_CONFIG As DataTable Private Property PROF_ORIGIN As DataTable + Private focusedRowHandle As Integer = 199 Private Sub frmAdministration_Load(sender As Object, e As System.EventArgs) Handles Me.Load _Logger.Debug("Loading Administration") @@ -429,6 +430,7 @@ Public Class frmAdministration pgFinalIndexes.SelectedObject = Nothing End If + Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Refresh_Final_indexe:") Finally @@ -657,9 +659,12 @@ Public Class frmAdministration Try Dim view As GridView = sender Dim focusedRow As DataRow = view.GetFocusedDataRow() + pgFinalIndexes.SelectedObject = Nothing If IsNothing(focusedRow) Then Exit Sub + ElseIf INSERT_ACTIVE = True Then + 'Exit Sub End If Dim oShouldRefreshGrid = False @@ -668,7 +673,6 @@ Public Class frmAdministration End If - Dim guid As Integer = focusedRow.Item("GUID") Dim index As String = NotNull(focusedRow.Item("INDEXNAME"), Nothing) Dim sqlCommand As String = NotNull(focusedRow.Item("SQL_COMMAND"), "") @@ -1038,11 +1042,15 @@ Public Class frmAdministration Private Sub BarButtonItem18_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem18.ItemClick Save_Final_Indexes() - Refresh_Final_Indexes() + 'Refresh_Final_Indexes() + If focusedRowHandle <> 199 Then + viewFinalIndex.SelectRow(focusedRowHandle) + End If End Sub Private Sub Save_Final_Indexes() Try 'Dim obj As FinalIndexProperties = PropertyGrid1.SelectedObject + pgFinalIndexes.EndUpdate() Dim obj As FinalIndexProperties = pgFinalIndexes.SelectedObject If Not IsNothing(obj) Then @@ -1058,7 +1066,8 @@ Public Class frmAdministration Dim guid = obj.GUID Dim oProfileId As Integer = PROFILGUIDTextBox.Text - + focusedRowHandle = 199 + focusedRowHandle = viewFinalIndex.FocusedRowHandle '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("'", "''") @@ -1104,15 +1113,20 @@ Public Class frmAdministration If DatabaseFallback.ExecuteNonQueryECM(sql) Then tsbStaticInfo.Caption = $"Final index added - {Now.ToLongTimeString}" INSERT_ACTIVE = False + 'Refresh_Final_Indexes() End If Else Dim sql As String = $"UPDATE TBPM_PROFILE_FINAL_INDEXING SET CONNECTION_ID = 0, SQL_COMMAND = '{sqlCommand}', INDEXNAME = '{indexName}', CHANGED_WHO = '{addedWho}', DESCRIPTION = '{oDescription}', - VALUE = '{value}', ACTIVE = {active}, ALLOW_NEW_VALUES = {AllowAddNewValues}, PREVENT_DUPLICATES = {preventDuplicates},IF_VEKTOR_BEHAVIOUR = '{IF_VEKTOR_BEHAVIOUR}', [SEQUENCE] = {oSequence}, CONTINUE_INDETERMINED = {oContinueOIdS} + VALUE = '{value}', ACTIVE = {active}, ALLOW_NEW_VALUES = {AllowAddNewValues}, PREVENT_DUPLICATES = {preventDuplicates}, + IF_VEKTOR_BEHAVIOUR = '{IF_VEKTOR_BEHAVIOUR}', + [SEQUENCE] = {oSequence}, CONTINUE_INDETERMINED = {oContinueOIdS} WHERE GUID = {guid}" If DatabaseFallback.ExecuteNonQueryECM(sql) Then tsbStaticInfo.Caption = $"Final index saved - {Now.ToLongTimeString} - RESTART NECESSARY" + Else + End If End If @@ -1127,7 +1141,10 @@ Public Class frmAdministration Finally BarButtonItem19.Visibility = DevExpress.XtraBars.BarItemVisibility.Never BarButtonItem16.Visibility = DevExpress.XtraBars.BarItemVisibility.Always - INSERT_ACTIVE = False + If INSERT_ACTIVE Then + INSERT_ACTIVE = False + End If + UNSAVED_CHANGES_FI = False End Try End Sub diff --git a/app/TaskFlow/frmFormDesigner.vb b/app/TaskFlow/frmFormDesigner.vb index 34704ad..eacd275 100644 --- a/app/TaskFlow/frmFormDesigner.vb +++ b/app/TaskFlow/frmFormDesigner.vb @@ -1099,20 +1099,19 @@ Public Class frmFormDesigner End Sub - Private Sub frmFormDesigner_KeyUp(sender As Object, e As KeyEventArgs) Handles MyBase.KeyUp - If e.Control Then + Private Sub frmFormDesigner_down(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown + If e.Control AndAlso e.KeyCode = e.KeyCode.Add Then + Height_plus() + ElseIf e.Control AndAlso e.KeyCode = e.KeyCode.Subtract Then + Height_minus() + Else + If e.KeyCode = e.KeyCode.Delete Then Control_Delete() ElseIf e.KeyCode = e.KeyCode.F5 Then LoadControls() tslblAenderungen.Caption = "Controls loaded - " + Now.ToString - ElseIf e.KeyCode = e.KeyCode.Add Then - Height_plus() - ElseIf e.KeyCode = e.KeyCode.Subtract Then - Height_minus() - End If - Else - If e.KeyCode = Keys.Escape Then + ElseIf e.KeyCode = Keys.Escape Then If Me.Cursor = Cursors.Cross Then Mouse_IsPressed = False Me.Cursor = Cursors.Default diff --git a/app/TaskFlow/frmMain.resx b/app/TaskFlow/frmMain.resx index d49f8b8..4e8735e 100644 --- a/app/TaskFlow/frmMain.resx +++ b/app/TaskFlow/frmMain.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADw - CAAAAk1TRnQBSQFMAgEBAgEAASgBCwEoAQsBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAATgBCwE4AQsBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/app/TaskFlow/frmMain.vb b/app/TaskFlow/frmMain.vb index 34d1c7a..dafd9db 100644 --- a/app/TaskFlow/frmMain.vb +++ b/app/TaskFlow/frmMain.vb @@ -3220,6 +3220,7 @@ FROM VWPM_PROFILE_ACTIVE T WHERE T.GUID IN (SELECT PROFILE_ID FROM [dbo].[FNPM_G LOGGER.Debug($"oTargetPath: {oTargetPath}") LOGGER.Debug($"oSourcePath: {oSourcePath}") If oTargetPath = String.Empty Or oSourcePath = String.Empty Then + LOGGER.Warn($"oTargetPath is nothing - PRofile can not be startet . Check TARGET_PATH_BLIND_FILE Column in Profile") Exit Sub End If oTargetPath = $"{oTargetPath}\{Now.Year}\{Now.Month}\{Now.Day}" diff --git a/app/TaskFlow/frmValidator.resx b/app/TaskFlow/frmValidator.resx index b7fab94..6887d47 100644 --- a/app/TaskFlow/frmValidator.resx +++ b/app/TaskFlow/frmValidator.resx @@ -637,7 +637,7 @@ DocumentViewerValidator - DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=1.9.7.0, Culture=neutral, PublicKeyToken=null + DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=1.9.8.0, Culture=neutral, PublicKeyToken=null SplitContainer1.Panel2 diff --git a/app/TaskFlow/frmValidator.vb b/app/TaskFlow/frmValidator.vb index 279ce05..927d5e7 100644 --- a/app/TaskFlow/frmValidator.vb +++ b/app/TaskFlow/frmValidator.vb @@ -1,4 +1,5 @@ Imports DevExpress.DataAccess.Native.Sql +Imports DevExpress.DataProcessing.InMemoryDataProcessor Imports DevExpress.Utils Imports DevExpress.XtraBars Imports DevExpress.XtraEditors @@ -4225,9 +4226,11 @@ Public Class frmValidator }) If oDTFinalIndexing?.Rows.Count > 0 Then + Dim oDT_FIResult As DataTable 'Jetzt finale Indexe setzen Logger.Debug("FINAL INDEXING STARTING...") For Each oFinalIndexRow As DataRow In oDTFinalIndexing.Rows + oDT_FIResult = Nothing Dim oValue As String = oFinalIndexRow.Item("VALUE").ToString Dim oFinalIndex = oFinalIndexRow.Item("INDEXNAME") Logger.Debug($"Working on final index [{oFinalIndex}]...") @@ -4250,24 +4253,17 @@ Public Class frmValidator _ItemWorked = False End If If Not IsNothing(oSQLCommand) Then - Dim oResultfromSQL As Object = DatabaseFallback.GetScalarValueWithConnection(oSQLCommand, oConnectionID) - If Not IsNothing(oResultfromSQL) Then - Logger.Debug($"oResultfromSQL is [{oResultfromSQL.ToString}]") - If IsDBNull(oResultfromSQL) Then - If oContinueOnIndifferentState = False Then - errormessage = "Result from SQL is DBNull - Check the SQL and the log" - My.Settings.Save() - frmError.ShowDialog() - oErrorOcurred = True - _ItemWorked = False - Else - Logger.Warn($"FinalIndexResult from SQL is DBNull - AttributeName [{oFinalIndexRow.Item("INDEXNAME")}] - oContinueOnIndifferentState = true, Continuing with next Attribute and Replacing with empty String") - oResultfromSQL = "" - Continue For - End If - End If - If Len(oResultfromSQL) = 0 Then + If oConnectionID <> 0 Then + oDT_FIResult = DatabaseFallback.GetDatatableWithConnection(oSQLCommand, oConnectionID) + Else + oDT_FIResult = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSQLCommand, DatabaseType.ECM)) + End If + + If Not IsNothing(oDT_FIResult) Then + Logger.Debug($"oResultfromSQL is [{oDT_FIResult.ToString}]") + + If oDT_FIResult.Rows.Count = 0 Then If oContinueOnIndifferentState = False Then errormessage = "Result from SQL is EmptyValue - Check the SQL and the log" My.Settings.Save() @@ -4279,9 +4275,9 @@ Public Class frmValidator Continue For End If End If - oValue = oResultfromSQL + 'oValue = oResultDT Else - Logger.Warn("ATTENTION: DYNAMIC VALUE IS NOTHING!") + Logger.Warn("ATTENTION: oResultDT for Automatic Index IS NOTHING!") Continue For End If End If @@ -4297,6 +4293,14 @@ Public Class frmValidator oValue = oFinalIndexRow.Item("VALUE") End Select End If + oDT_FIResult = New DataTable() + ' Spalte hinzufügen – z.B. "Ergebnis" vom Typ String + oDT_FIResult.Columns.Add("Ergebnis", GetType(String)) + + ' Zeile hinzufügen – mit festem Wert z.B. "OK" + Dim newRow As DataRow = oDT_FIResult.NewRow() + newRow("Ergebnis") = oValue + oDT_FIResult.Rows.Add(newRow) End If If oErrorOcurred Then Exit For @@ -4305,14 +4309,36 @@ Public Class frmValidator Dim oResult() As String ReDim Preserve oResult(0) oResult(0) = oValue - + Logger.Debug("Now the final indexing...") Logger.Debug($"oIndexType {oIndexType.ToString}") - If oIndexType > 4000 And oIndexType < 5000 Then - 'If dr.Item("INDEXNAME").ToString.StartsWith("[%VKT") Then - ' Dim PM_String = Return_PM_VEKTOR(value, dr.Item("INDEXNAME")) - 'Hier muss nun separat as Vektorfeld indexiert werden - If WMIndexVectofield(oValue, oFinalIndexRow.Item("INDEXNAME"), oFinalIndexRow.Item("PREVENT_DUPLICATES"), oFinalIndexRow.Item("ALLOW_NEW_VALUES")) = False Then - Logger.Debug("Final Vektorindex '" & oFinalIndexRow.Item("INDEXNAME").ToString & "' has beens et suxxessfully!") + + If oIndexType > 4000 And oIndexType < 5000 And oDT_FIResult.Rows.Count > 0 Then + Dim oOldValue As Object = CURRENT_WMFILE.GetVariableValue(oFinalIndex) + Dim oValueList As New List(Of Object) + Dim oNewValue As Object() + Dim oMissing As Boolean = False + + If oOldValue IsNot Nothing AndAlso TypeOf oOldValue Is Object Then + + ' If new values are allowed, add the old values first + If CBool(oFinalIndexRow.Item("ALLOW_NEW_VALUES")) = True Then + oValueList = DirectCast(oOldValue, Object()).ToList() + End If + + ' Add the new value(S) + oValueList = WMVectorResult_add_Items_From_DT(oDT_FIResult, oValueList) + Else + oValueList = WMVectorResult_add_Items_From_DT(oDT_FIResult, oValueList) + End If + + If CBool(oFinalIndexRow.Item("PREVENT_DUPLICATES")) = True Then + oValueList = oValueList.Distinct().ToList() + End If + + oNewValue = oValueList.ToArray() + + If Indexiere_File(CURRENT_WMFILE, oFinalIndexRow.Item("INDEXNAME"), oNewValue) = True Then + Logger.Debug("Final Vektorindex '" & oFinalIndexRow.Item("INDEXNAME").ToString & "' has been set successfully!") Else errormessage = "Error in final indexing:" & vbNewLine & idxerr_message My.Settings.Save() @@ -4320,12 +4346,31 @@ Public Class frmValidator oErrorOcurred = True _ItemWorked = False End If + + ''Hier muss nun separat as Vektorfeld indexiert werden + 'If WMIndexVectofield(oValue, oFinalIndex, oFinalIndexRow.Item("PREVENT_DUPLICATES"), oFinalIndexRow.Item("ALLOW_NEW_VALUES")) = False Then + ' Logger.Debug("Final Vektorindex '" & oFinalIndexRow.Item("INDEXNAME").ToString & "' has beens et suxxessfully!") + 'Else + ' errormessage = "Error in final indexing:" & vbNewLine & idxerr_message + ' My.Settings.Save() + ' frmError.ShowDialog() + ' oErrorOcurred = True + ' _ItemWorked = False + 'End If Else - Logger.Debug("Now the final indexing...") + If oValue.ToUpper = "SQL-Command".ToUpper Then - MsgBox("Something went wrong while final-indexing. Check Your log and inform the admin-team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE) - Logger.Warn("Something went wrong while final-indexing") - Exit For + If oDT_FIResult.Rows.Count = 1 Then + oValue = oDT_FIResult.Rows(0).Item(0).ToString + oResult = Nothing + ReDim Preserve oResult(0) + oResult(0) = oValue + ElseIf isnothing(oResult) Then + MsgBox("Something went wrong while final-indexing. Check Your log and inform the admin-team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE) + Logger.Warn("Something went wrong while final-indexing") + Exit For + End If + End If Dim oFIResult As Boolean = False If IDB_ACTIVE = False Then @@ -4574,6 +4619,12 @@ Public Class frmValidator btnSave.Enabled = True End Sub + Private Function WMVectorResult_add_Items_From_DT(oDT As DataTable, oValueList As List(Of Object)) As List(Of Object) + For Each oRow As DataRow In oDT.Rows + oValueList.Add(oRow.Item(0)) + Next + Return oValueList + End Function Sub Focus_FirstControl() If first_control Is Nothing = False Then Dim otype = first_control.GetType @@ -5662,6 +5713,9 @@ Public Class frmValidator Dim File_indexiert As Boolean = False idxerr_message = "" Try + If pIndexName = "Vektor_Text2" Then + Logger.Info("Achtung") + End If 'Die Arrays vorbereiten Dim arrIndex() As String = Nothing Dim arrValue() As String = Nothing