diff --git a/Global_Indexer/ModuleCURRENT.vb b/Global_Indexer/ModuleCURRENT.vb index 79e1051..b4cd359 100644 --- a/Global_Indexer/ModuleCURRENT.vb +++ b/Global_Indexer/ModuleCURRENT.vb @@ -46,8 +46,6 @@ Public CURRENT_HTML_DOC As String - Public CURRENT_ABBRUCH As Integer = 0 - Public MULTIINDEXING_ACTIVE As Boolean = False Public ABORT_INDEXING As Boolean = False diff --git a/Global_Indexer/frmIndex.vb b/Global_Indexer/frmIndex.vb index 131b892..5a50bed 100644 --- a/Global_Indexer/frmIndex.vb +++ b/Global_Indexer/frmIndex.vb @@ -26,6 +26,8 @@ Public Class frmIndex Dim sql_history_Index_Values As String Dim NewFileString As String + Private CancelAttempts As Integer = 0 + Private Property viewer_string As String 'Dim DocView @@ -3013,13 +3015,70 @@ Public Class frmIndex End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click - Select Case CURRENT_ABBRUCH - Case 0 - CURRENT_ABBRUCH = 1 - Case 1 - CURRENT_ABBRUCH = 2 - End Select - Me.Close() + If File.Exists(CURRENT_FILENAME) Then + Select Case CancelAttempts + Case 0 + If USER_LANGUAGE = "de-DE" Then + MsgBox("Bitte indexieren Sie die Datei vollständig!" & vbNewLine & "(Abbruch 1 des Indexierungsvorgangs)", MsgBoxStyle.Information) + Else + MsgBox("Please Index file completely" & vbNewLine & "(Abort 1 of Indexdialog)", MsgBoxStyle.Information) + End If + CancelAttempts = CancelAttempts + 1 + Case 1 + Dim result As MsgBoxResult + If USER_LANGUAGE = "de-DE" Then + result = MessageBox.Show("Sie brechen nun zum zweiten Mal den Indexierungsvorgang ab!" & vbNewLine & "Wollen Sie die Indexierung aller Dateien abbrechen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + Else + result = MessageBox.Show("You abort the indexdialog for the 2nd time!" & vbNewLine & "Do You want to abort indexing?", "Confirmation needed:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + End If + + If result = MsgBoxResult.Yes Then + Dim containsfw_file As Boolean = False + Try + ABORT_INDEXING = True + Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')" + + Dim DT As DataTable = ClassDatabase.Return_Datatable(sql, True) + + + Dim anz = DT.Rows.Count + For Each Filerow As DataRow In DT.Rows + Dim filestring As String = Filerow.Item("FILENAME2WORK") + Dim handletype As String = Filerow.Item("HANDLE_TYPE") + + If handletype = "|MSGONLY|" Or handletype = "|ATTMNTEXTRACTED|" Then + Try + System.IO.File.Delete(filestring) + Catch ex As Exception + + End Try + + ElseIf handletype.StartsWith("|FW") Then + containsfw_file = True + End If + Next + 'Zuerst die Daten des Ablaufs löschen + If ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')", True) = True Then + If containsfw_file = True Then + If USER_LANGUAGE = "de-DE" Then + MsgBox("Der Indexierungsprozess beinhaltete (auch) Dateien per Folderwatch!" & vbNewLine & "Diese Dateien wurden nicht gelöscht und verbleiben im Folderwatch-Verzeichnis!" & vbNewLine & "Bitte verschieben Sie die Dateien ggfls.", MsgBoxStyle.Information, "Achtung - Hinweis:") + Else + MsgBox("The Indexingprocess contained (also) files from folderwatch!" & vbNewLine & "These files weren't deleted and will stay in the folderwatch-folder!" & vbNewLine & "Please move these files manually.", MsgBoxStyle.Information, "Achtung - Hinweis:") + End If + + End If + End If + + + Catch ex As Exception + MsgBox("Unexpected Error in Abort Indexing: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) + End Try + + + Close() + End If + End Select + End If End Sub Private Sub chkMultiIndexer_CheckedChanged(sender As Object, e As EventArgs) Handles chkMultiIndexer.CheckedChanged diff --git a/Global_Indexer/frmStart.vb b/Global_Indexer/frmStart.vb index 68a40a5..447b1e3 100644 --- a/Global_Indexer/frmStart.vb +++ b/Global_Indexer/frmStart.vb @@ -240,7 +240,6 @@ Public Class frmStart Try Me.TopMost = False ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')") - CURRENT_ABBRUCH = 0 Dim i As Integer For Each Str As Object In ClassDragDrop.files_dropped If Not Str Is Nothing Then @@ -287,85 +286,11 @@ Public Class frmStart End Sub Sub Open_IndexDialog() - Try - Me.Hide() - frmIndex.ShowDialog() - Me.Visible = True - Me.TopMost = True - Me.BringToFront() - If File.Exists(CURRENT_FILENAME) Then - Select Case CURRENT_ABBRUCH - Case 1 - If USER_LANGUAGE = "de-DE" Then - MsgBox("Bitte indexieren Sie die Datei vollständig!" & vbNewLine & "(Abbruch 1 des Indexierungsvorgangs)", MsgBoxStyle.Information) - Else - MsgBox("Please Index file completely" & vbNewLine & "(Abort 1 of Indexdialog)", MsgBoxStyle.Information) - End If - - Open_IndexDialog() - Case 2 - Dim result As MsgBoxResult - If USER_LANGUAGE = "de-DE" Then - result = MessageBox.Show("Sie brechen nun zum zweiten Mal den Indexierungsvorgang ab!" & vbNewLine & "Wollen Sie die Indexierung aller Dateien abbrechen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - Else - result = MessageBox.Show("You abort the indexdialog for the 2nd time!" & vbNewLine & "Do You want to abort all file- -?", "Confirmation needed:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - End If - - If result = MsgBoxResult.Yes Then - Dim containsfw_file As Boolean = False - Try - ABORT_INDEXING = True - Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')" - - Dim DT As DataTable = ClassDatabase.Return_Datatable(sql, True) - - - Dim anz = DT.Rows.Count - For Each Filerow As DataRow In DT.Rows - Dim filestring As String = Filerow.Item("FILENAME2WORK") - Dim handletype As String = Filerow.Item("HANDLE_TYPE") - - If handletype = "|MSGONLY|" Or handletype = "|ATTMNTEXTRACTED|" Then - Try - System.IO.File.Delete(filestring) - Catch ex As Exception - - End Try - - ElseIf handletype.StartsWith("|FW") Then - containsfw_file = True - End If - Next - 'Zuerst die Daten des Ablaufs löschen - If ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')", True) = True Then - If containsfw_file = True Then - If USER_LANGUAGE = "de-DE" Then - MsgBox("Der Indexierungsprozess beinhaltete (auch) Dateien per Folderwatch!" & vbNewLine & "Diese Dateien wurden nicht gelöscht und verbleiben im Folderwatch-Verzeichnis!" & vbNewLine & "Bitte verschieben Sie die Dateien ggfls.", MsgBoxStyle.Information, "Achtung - Hinweis:") - Else - MsgBox("The Indexingprocess contained (also) files from folderwatch!" & vbNewLine & "These files weren't deleted and will stay in the folderwatch-folder!" & vbNewLine & "Please move these files manually.", MsgBoxStyle.Information, "Achtung - Hinweis:") - End If - - End If - End If - - - Catch ex As Exception - MsgBox("Unexpected Error in Abort Indexing: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - End Try - - - CURRENT_ABBRUCH = 0 - Exit Sub - Else - CURRENT_ABBRUCH = 0 - End If - End Select - End If - Catch ex As Exception - MsgBox("Unexpected Error in Call Indexdialog: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - Me.Visible = True - End Try + Me.Hide() + frmIndex.ShowDialog() + Me.Visible = True + Me.TopMost = True + Me.BringToFront() End Sub Private Sub frmStart_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing