This commit is contained in:
SchreiberM
2016-10-14 13:27:47 +02:00
parent 4548dc3abc
commit 353f161c57
30 changed files with 1400 additions and 607 deletions

View File

@@ -52,6 +52,8 @@ Public Class frmConstructor_Main
Private DT_TREEVIEW_PER_CONTROLS As DataTable
Private DT_TREEVIEW_CONFIGURATION As DataTable
Private SEARCH_TYPE As String
Private DT_ADDING_USERS As DataTable
Private DT_CONTROL_SCREEN As DataTable
@@ -159,6 +161,7 @@ Public Class frmConstructor_Main
Private LOAD_DIRECT As Boolean = False
Private IS_SINGLE_RECORD As Boolean = False
Private LOAD_ENTITY_SEARCH_AT_STARTUP As Boolean = False
Private RECORD_ID As Integer
Private PARENT_ENTITYID As Integer
Private SQL_RIGHT_READ_AND_VIEW_ONLY As String = ""
@@ -243,6 +246,7 @@ Public Class frmConstructor_Main
Dim sw As New Stopwatch
Try
sw.Start()
CURRENT_DT_DOC_ENTITY_SEARCH = Nothing
tsslblRecord.Text = ""
tsslblStatus.Text = ""
_FormClosing = False
@@ -2238,6 +2242,7 @@ Public Class frmConstructor_Main
IS_SINGLE_RECORD = ENTITY_ROW.Item("SINGLE_RECORD")
POS_ENTITY = ENTITY_ROW.Item("POS_ENTITY")
REDUNDANT_FORM = ENTITY_ROW.Item("REDUNDANT_ENTITY")
LOAD_ENTITY_SEARCH_AT_STARTUP = ENTITY_ROW.Item("LOAD_ENT_SEARCH_AT_SU")
If REDUNDANT_FORM <> 0 Then
CURRENT_ENTITY_REDUNDANT_ID = REDUNDANT_FORM
Else
@@ -2267,7 +2272,6 @@ Public Class frmConstructor_Main
GridControlMain.MainView = grvwGrid
End Select
SELECTED_RECORD_ID = 0
Dim DT As DataTable
' LINQ für Zugriff auf DT_VWPMO_CONSTRUCTOR_FORMS
Dim result1 = (From form In DT_VWPMO_CONSTRUCTOR_FORMS.AsEnumerable()
@@ -2281,6 +2285,10 @@ Public Class frmConstructor_Main
'Anzahl der Datensätze
ENTITY_RECORD_COUNT = ClassDatabase.Execute_Scalar("SELECT COUNT(*) FROM TBPMO_RECORD where FORM_ID = " & ENTITY_ID, True)
If CBool(LOAD_ENTITY_SEARCH_AT_STARTUP) = True Then
ClassDOC_SEARCH.Get_DOC_RESULTTABLE(DT_RESULTLIST_OPTIONS, DT_RESULTLIST_VARIABLE_VALUE, DT_WINDREAM_RESULTLIST, ENTITY_ID, RECORD_ID, "ENTITY", "", True, True)
End If
Select Case ClickedLevel
Case 1
EBENE1_ENTITY = ""
@@ -3552,315 +3560,7 @@ Public Class frmConstructor_Main
End Try
End Sub
Private Sub RUN_WD_SEARCH(BaseSearch As String, Type As String)
Dim sw As New Stopwatch
sw.Start()
Dim elapsed As Double
Try
Dim windream_temp_search
If Not windream_Docshow = True Or Sett_LoadWD_Docs = False Or TCDetails.SelectedTabPageIndex <> 1 Then
Exit Sub
End If
Cursor = Cursors.WaitCursor
Dim DTWD As DataTable
If Type = "ENTITY" Then
Dim _sql = "SELECT WINDREAM_SEARCH,SEARCH_PATTERN1,SEARCH_PATTERN2,SEARCH_PATTERN3,SEARCH_PATTERN4,SEARCH_PATTERN5 FROM TBPMO_FORM_CONSTRUCTOR_DETAIL WHERE WINDREAM_SEARCH <> '' AND FORM_ID = " & ENTITY_ID
DTWD = ClassDatabase.Return_Datatable(_sql)
If DTWD.Rows.Count = 1 Then
If IsDBNull(DTWD.Rows(0).Item(0)) Then
Clear_Windream_ResultList()
Cursor = Cursors.Default
Exit Sub
End If
Dim msg = "Windream-Dokumente für Entität: " & ACT_EBENE_STRING
If USER_LANGUAGE <> "de-DE" Then
msg = "windream-files for entity: " & ACT_EBENE_STRING
End If
tslblWindreamView.Text = msg
Else
Clear_Windream_ResultList()
Cursor = Cursors.Default
Exit Sub
Exit Sub
End If
Else
Dim sql = "SELECT WINDREAM_SEARCH,SEARCH_PATTERN1,SEARCH_PATTERN2,SEARCH_PATTERN3,SEARCH_PATTERN4,SEARCH_PATTERN5 FROM TBPMO_FORM_VIEW WHERE WINDREAM_SEARCH <> '' AND FORM_ID = " & ENTITY_ID
DTWD = ClassDatabase.Return_Datatable(sql)
If DTWD.Rows.Count = 1 Then
If IsDBNull(DTWD.Rows(0).Item(0)) Then
Clear_Windream_ResultList()
Cursor = Cursors.Default
Exit Sub
Exit Sub
End If
Dim msg = "Windream-Dokumente für Record: " & RECORD_ID
If USER_LANGUAGE <> "de-DE" Then
msg = "windream-files for record: " & RECORD_ID
End If
tslblWindreamView.Text = msg
Else
Clear_Windream_ResultList()
Cursor = Cursors.Default
Exit Sub
Exit Sub
End If
End If
'Die SearchPatterns durchlaufen und zwischenspeichern
If IsDBNull(DTWD.Rows(0).Item(0)) Then
Clear_Windream_ResultList()
Cursor = Cursors.Default
Exit Sub
Exit Sub
End If
BaseSearch = DTWD.Rows(0).Item(0)
SP1 = DTWD.Rows(0).Item(1)
If IsDBNull(DTWD.Rows(0).Item(2)) Then
SP2 = ""
Else
SP2 = DTWD.Rows(0).Item(2)
End If
If IsDBNull(DTWD.Rows(0).Item(3)) Then
SP3 = ""
Else
SP3 = DTWD.Rows(0).Item(3)
End If
If IsDBNull(DTWD.Rows(0).Item(4)) Then
SP4 = ""
Else
SP4 = DTWD.Rows(0).Item(4)
End If
If IsDBNull(DTWD.Rows(0).Item(5)) Then
SP5 = ""
Else
SP5 = DTWD.Rows(0).Item(5)
End If
'Eine tempfile generieren
Dim tempFilename1 = My.Computer.FileSystem.GetTempFileName()
'Nur den Filenamen ohne Erweiterung
Dim tempName = Path.GetFileNameWithoutExtension(tempFilename1)
'tempfile lsöchen
If My.Computer.FileSystem.FileExists(tempFilename1) Then
My.Computer.FileSystem.DeleteFile(tempFilename1)
End If
Try
Dim temppath = Path.GetTempPath
Dim EncodingFormat As Encoding
If WD_UNICODE = True Then
EncodingFormat = Encoding.GetEncoding(1252) '1252
If LogErrorsOnly = False Then ClassLogger.Add(" >> Unicode is used (Encoding.GetEncoding(1252))", False)
Else
If LogErrorsOnly = False Then ClassLogger.Add(" >> UTF8 (Encoding.GetEncoding(65001))", False)
EncodingFormat = Encoding.GetEncoding(65001)
End If
Dim fileContents As String
If LogErrorsOnly = False Then ClassLogger.Add(" >> ReadAlltext: " & windream_temp_search, False)
fileContents = My.Computer.FileSystem.ReadAllText(BaseSearch, EncodingFormat) ', System.Text.Encoding.Unicode
If LogErrorsOnly = False Then ClassLogger.Add(" >> fileContents geladen", False)
fileContents = fileContents.Replace("Í", "Ö")
Dim _sp1 = SP1
Dim _sp2 = SP2
Dim _sp3 = SP3
Dim _sp4 = SP4
Dim _sp5 = SP5
If _sp1.ToString <> String.Empty Then
_sp1 = Return_SearchPattern(_sp1.ToString)
fileContents = fileContents.Replace("%pattern1%", _sp1)
fileContents = fileContents.Replace("471101", _sp1)
End If
If _sp2.ToString <> String.Empty Then
_sp2 = Return_SearchPattern(_sp2.ToString)
If _sp2 = 0 Then
_sp2 = ""
End If
fileContents = fileContents.Replace("%pattern2%", _sp2)
fileContents = fileContents.Replace("471102", _sp2)
End If
If _sp3.ToString <> String.Empty Then
_sp3 = Return_SearchPattern(_sp3.ToString)
If _sp3 = 0 Then
_sp3 = ""
End If
fileContents = fileContents.Replace("%pattern3%", _sp3)
fileContents = fileContents.Replace("471103", _sp3)
End If
If _sp4.ToString <> String.Empty Then
_sp4 = Return_SearchPattern(_sp4.ToString)
If _sp4 = 0 Then
_sp4 = ""
End If
fileContents = fileContents.Replace("%pattern4%", _sp4)
fileContents = fileContents.Replace("471104", _sp4)
End If
If _sp5.ToString <> String.Empty Then
_sp5 = Return_SearchPattern(_sp5.ToString)
If _sp5 = 0 Then
_sp5 = ""
End If
fileContents = fileContents.Replace("%pattern5%", _sp5)
fileContents = fileContents.Replace("471105", _sp5)
End If
'Die windream File zusammensetzen
windream_temp_search = temppath & tempName & ".wdf"
TEMP_FILES.Add(windream_temp_search)
'Die File schreiben
My.Computer.FileSystem.WriteAllText(windream_temp_search, fileContents, False, EncodingFormat)
My.Computer.FileSystem.WriteAllText(temppath & "SEARCH_COPY.wdf", fileContents, False, EncodingFormat)
' XML-Datei öffnen und laden
Dim Stream As New IO.StreamReader(CStr(windream_temp_search), EncodingFormat)
Dim Reader As New System.Xml.XmlTextReader(Stream)
' XML-Datei initialisieren
Dim xml As New System.Xml.XmlDocument()
' XML-Datei öffnen und laden
xml.Load(Reader)
Reader.Close()
xml.Save(windream_temp_search)
If LogErrorsOnly = False Then ClassLogger.Add(" >> Xml Generiert: " & windream_temp_search, False)
Dim windreamSucheErgebnisse As WINDREAMLib.WMObjects
Try
windreamSucheErgebnisse = ClassWindream.GetSearchDocuments(windream_temp_search)
Catch ex As Exception
MsgBox("Error in windreamSucheErgebnisse:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
elapsed = sw.Elapsed.TotalSeconds
If LogErrorsOnly = False Then ClassLogger.Add(" >> GetSearchDocuments took " & Format(elapsed, "0.000000000") & " seconds", False)
If windreamSucheErgebnisse.Count > 0 Then
Dim stg As String
If USER_LANGUAGE = "de-DE" Then
stg = "windream-Dateien"
Else
stg = "windream-files"
End If
TabWindream.Text = stg & " (" & windreamSucheErgebnisse.Count & ")"
'AxObjectListControl.SetIconMode(True)
'AxObjectListControl.RemoveAllColumnHeader()
'Me.AxObjectListControl.SetSession(ClassWindream.oSession, "", "")
'Change the status icon
'ICON STATES:
'Me.AxObjectListControl.SetStatusIcon(0)
'Change the icon
' Me.AxObjectListControl.SetStatusIcon(2)
Try
Dim sql_ResultList = "select * from TBPMO_WINDREAM_RESULTLIST_CONFIG where guid = 1"
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql_ResultList, "GET RESULTLIST KONFIG")
If Not DT Is Nothing And DT.Rows.Count = 1 Then
Dim anzparam As Integer = 1
For Each Column As DataColumn In DT.Columns
If Column.ColumnName.StartsWith("COLUMN") And Column.ColumnName.EndsWith("WIDTH") = False Then
Dim sql = String.Format("select {0} from TBPMO_WINDREAM_RESULTLIST_CONFIG Where GUID = 1", Column.ColumnName)
Dim ColumnName = ClassDatabase.Execute_Scalar(sql, True)
If Not IsDBNull(ColumnName) Then
If Not IsDBNull(ColumnName) Or IsNothing(ColumnName) Or ColumnName <> "" Or ColumnName <> "{}" Then
'Jetzt die Spalten aus Array hinzufügen und Breite konfigurieren
sql = String.Format("select COLUMN{0}_WIDTH from TBPMO_WINDREAM_RESULTLIST_CONFIG Where GUID = 1", anzparam)
Dim Width = ClassDatabase.Execute_Scalar(sql, True)
If IsNothing(Width) Or IsDBNull(Width) Then
Width = 200
End If
'You need to use the column name here
'Please note that some attributes or indices will not be displayed
'Try not to add the same header twice, it will throw cause problems if you do that
' Me.AxObjectListControl.AddColumnHeader(ColumnName, Width)
anzparam += 1
End If
End If
End If
Next
Else
Dim param As New List(Of String)
'The file name
param.Add("szLongName")
'The document-Type
param.Add("szText37")
'Versionsnummer
param.Add("dwVersionNumber")
'Datumsangaben
param.Add("dwCreationDate")
param.Add("dwCreation_Time")
'Add all search params
For Each spar As String In param
Dim width As Integer = 200
Select Case spar
Case "szLongName"
'Dateiname
width = 300
Case "szText37"
'Dokumentart
width = 160
Case "dwCreationDate"
'Erstelldatum
width = 90
Case "dwCreation_Time"
'Erstell-Zeit
width = 120
End Select
'You need to use the column name here
'Please note that some attributes or indices will not be displayed
'Try not to add the same header twice, it will throw cause problems if you do that
' Me.AxObjectListControl.AddColumnHeader(spar, width)
Next
End If
Catch ex As Exception
MsgBox("Unexpected Error in Construct windreamResultList: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
If LogErrorsOnly = False Then ClassLogger.Add(" >> AxObjectListControl loaded ", False)
'Execute the search
Dim results As WINDREAMLib.WMObjects = windreamSucheErgebnisse
If LogErrorsOnly = False Then ClassLogger.Add(" >> results loaded ", False)
'Set the contents without displaying them
'AxObjectListControl.SetContentsEx(results)
'Change the icon
' AxObjectListControl.SetStatusIcon(5)
'Display the results...
'The Previous Object Count
Dim poc As Integer = 0
'Display new objects, as long as the objectcount changes after displaying the objects
'Do Until (poc <> AxObjectListControl.GetObjectCount)
' poc = AxObjectListControl.GetObjectCount
' 'If you want, you can display more items at a timeRefresh_FollowUp_TabHeader
' 'But do not display to many at a time or the user interface could freeze
' 'Maybe try 50
' AxObjectListControl.DisplayResults(WDResultListCount)
'Loop
'AxObjectListControl.SetStatusIcon(3)
Else
Dim msg = "Windream-Dokumente für Record: " & RECORD_ID & " - Keine Dateien gefunden"
If USER_LANGUAGE <> "de-DE" Then
msg = "windream-files for record: " & RECORD_ID & " - no files found"
End If
tslblWindreamView.Text = "Windream-Dokumente für Record: " & RECORD_ID & " - Keine Dateien gefunden"
Clear_Windream_ResultList()
End If
Catch ex As Exception
MsgBox("Error in execute-windreamSearch:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
Cursor = Cursors.Default
Catch ex As Exception
MsgBox("Error in RUN_WD_SEARCH:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
elapsed = sw.Elapsed.TotalSeconds
sw.Stop()
sw.Reset()
If LogErrorsOnly = False Then ClassLogger.Add(" >> Run WD Search took " & Format(elapsed, "0.000000000") & " seconds", False)
Cursor = Cursors.Default
End Sub
Private Sub WD_DELETE_DOCS()
Dim sw As New Stopwatch
sw.Start()
@@ -3925,13 +3625,19 @@ Public Class frmConstructor_Main
If LogErrorsOnly = False Then ClassLogger.Add(" >> Run WD Delete Docs took " & Format(elapsed, "0.000000000") & " seconds", False)
Cursor = Cursors.Default
End Sub
Private Sub RUN_WDSEARCH_GRID(Type As String)
Private Sub RUN_WDSEARCH_GRID(Type As String, Optional ftString As String = "")
Me.Cursor = Cursors.WaitCursor
SEARCH_TYPE = Type
If SEARCH_TYPE <> "FULLTEXT" Then
tsTextboxFulltext.Text = ""
End If
Try
Dim sw As New Stopwatch
sw.Start()
Dim elapsed As Double
Dim DT_RESULT As DataTable = ClassDOC_SEARCH.Get_DOC_RESULTTABLE(DT_RESULTLIST_OPTIONS, DT_RESULTLIST_VARIABLE_VALUE, DT_WINDREAM_RESULTLIST, ENTITY_ID, RECORD_ID, Type)
Dim DT_RESULT As DataTable
DT_RESULT = ClassDOC_SEARCH.Get_DOC_RESULTTABLE(DT_RESULTLIST_OPTIONS, DT_RESULTLIST_VARIABLE_VALUE, DT_WINDREAM_RESULTLIST, ENTITY_ID, RECORD_ID, Type, ftString, CBool(LOAD_ENTITY_SEARCH_AT_STARTUP))
If IsNothing(DT_RESULT) Then
Dim msg = "wrong DocSearch-Configuration - Check logfile and contact Digital Data"
tslblWindreamView.Text = msg
@@ -3956,7 +3662,7 @@ Public Class frmConstructor_Main
msg = "windream-files for entity: " & Entitystring
End If
msg &= " (" & DT_RESULT.Rows.Count.ToString & ")"
Else
ElseIf Type = "RECORD" Then
If NODE_NAVIGATION Then
If NODE_TEXT.Contains(" (") Then
NODE_TEXT = NODE_TEXT.Substring(0, NODE_TEXT.IndexOf("(") - 1)
@@ -3973,7 +3679,12 @@ Public Class frmConstructor_Main
End If
msg &= " (" & DT_RESULT.Rows.Count.ToString & ")"
End If
Else
msg = String.Format("Dateien für Volltextsuche")
If USER_LANGUAGE <> "de-DE" Then
msg = String.Format("Files for Fulltext-Search")
End If
msg &= " (" & DT_RESULT.Rows.Count.ToString & ")"
End If
tslblWindreamView.Text = msg
@@ -3987,7 +3698,7 @@ Public Class frmConstructor_Main
DT_DOCRESULT_DROPDOWN_ITEMS,
AddressOf OnCBSelectedValueChanged,
AddressOf OnDateSelectedValueChanged,
AddressOf OnTextSelectedValueChanged)
AddressOf OnTextSelectedValueChanged, Type)
If TCDetails.SelectedTabPageIndex <> 1 Then
TCDetails.SelectedTabPageIndex = 1
@@ -4009,7 +3720,7 @@ Public Class frmConstructor_Main
If USER_LANGUAGE <> "de-DE" Then
msg = "No windream-files found for entity: " & Entitystring
End If
Else
ElseIf Type = "RECORD" Then
If NODE_NAVIGATION Then
If NODE_TEXT.Contains(" (") Then
NODE_TEXT = NODE_TEXT.Substring(0, NODE_TEXT.IndexOf("(") - 1)
@@ -4024,6 +3735,11 @@ Public Class frmConstructor_Main
If USER_LANGUAGE <> "de-DE" Then
msg = "No files found for record " & RECORD_ID
End If
Else
msg = "Keine Dateien für Volltextsuche gefunden"
If USER_LANGUAGE <> "de-DE" Then
msg = "No windream-files found for fulltext-search"
End If
End If
tslblWindreamView.Text = msg
@@ -4046,6 +3762,9 @@ Public Class frmConstructor_Main
'ItemComboBox = sender
Dim item As ClassWindreamDocGrid.WindreamDocGridComboboxItem = ComboBox.SelectedItem
Dim value As String = item.Value
If value.ToUpper = "Not displayable in Group-Search".ToUpper Then
Exit Sub
End If
Dim configId As Integer = item.ConfigID
Dim docId As Integer = ClassWindreamDocGrid.SELECTED_DOC_ID
Dim user As String = Environment.UserName
@@ -4079,6 +3798,9 @@ Public Class frmConstructor_Main
Try
Dim TextBox As TextEdit = sender
Dim value = TextBox.EditValue
If value.ToUpper = "Not displayable in Group-Search".ToUpper Then
Exit Sub
End If
Dim colTitle = DirectCast(GridControlDocSearch.MainView, DevExpress.XtraGrid.Views.Grid.GridView).FocusedColumn.FieldName
Dim configId As Integer = ClassWindreamDocGrid.RESULT_CONFIG_IDS.Item(colTitle)
Dim docId As Integer = ClassWindreamDocGrid.SELECTED_DOC_ID
@@ -4329,17 +4051,17 @@ Public Class frmConstructor_Main
' If RIGHT_WINDREAM_FORBIDDEN = False Then
'tsButtonEdit.Enabled = False
If RECORD_ID = 0 Then
Dim result As MsgBoxResult
Dim msg = String.Format("Wollen Sie eine Entitätsweite Suche ausführen?")
If USER_LANGUAGE <> "de-DE" Then
msg = String.Format("Would You like to run a entity-wide docsearch?")
End If
result = MessageBox.Show(msg, "Exporting result:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = MsgBoxResult.Yes Then
RUN_WDSEARCH_GRID("ENTITY")
End If
'Dim result As MsgBoxResult
'Dim msg = String.Format("Wollen Sie eine Entitätsweite Suche ausführen?")
'If USER_LANGUAGE <> "de-DE" Then
' msg = String.Format("Would You like to run a entity-wide docsearch?")
'End If
'result = MessageBox.Show(msg, "Exporting result:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
'If result = MsgBoxResult.Yes Then
' RUN_WDSEARCH_GRID("ENTITY")
'End If
Exit Sub
Else
' RUN_WD_SEARCH(WD_Suche, "RECORD")
RUN_WDSEARCH_GRID("RECORD")
@@ -5174,17 +4896,22 @@ Public Class frmConstructor_Main
End If
End Sub
Private Sub grvwGrid_MouseDown(sender As Object, e As MouseEventArgs) Handles grvwGrid.MouseDown, grvwTiles.MouseDown, grvwCarousel.MouseDown
Dim view As BaseView = CType(sender, BaseView)
Try
Dim view As BaseView = CType(sender, BaseView)
If e.Button = Windows.Forms.MouseButtons.Right Then
GRIDRightMouse_Clicked = True
Else
GRIDRightMouse_Clicked = False
End If
Dim hitInfo As GridHitInfo = View.CalcHitInfo(New Point(e.X, e.Y))
If e.Button = Windows.Forms.MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
GRIDdownHitInfo = hitInfo
End If
If e.Button = Windows.Forms.MouseButtons.Right Then
GRIDRightMouse_Clicked = True
Else
GRIDRightMouse_Clicked = False
End If
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
If e.Button = Windows.Forms.MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
GRIDdownHitInfo = hitInfo
End If
Catch ex As Exception
ClassLogger.Add(">> Unexpected Error in grvwGrid_MouseDown: " & ex.Message, False)
End Try
End Sub
Private Sub grvwGrid_MouseMove(sender As Object, e As MouseEventArgs) Handles grvwGrid.MouseMove, grvwTiles.MouseMove, grvwCarousel.MouseMove
Dim view As BaseView = CType(sender, BaseView)
@@ -6112,7 +5839,7 @@ Public Class frmConstructor_Main
End Sub
Private Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMI_DeleteFile.Click
If RECORD_ID = 0 Then
If RECORD_ID = 0 And SEARCH_TYPE <> "ENTITY" Then
MsgBox("Please select a record!", MsgBoxStyle.Exclamation)
Exit Sub
End If
@@ -6120,19 +5847,23 @@ Public Class frmConstructor_Main
MsgBox("Could not read File Parameters (DELETE FILES)!", MsgBoxStyle.Exclamation)
Exit Sub
End If
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
If row.Item("DOC_PATH") <> "" Then
Dim msg = "Sind Sie sicher, dass Sie die Datei " & vbNewLine & row.Item("DOC_PATH") & vbNewLine & "endgültig löschen wollen?"
If USER_LANGUAGE <> "de-DE" Then
msg = "Are You sure You want to permanently delete this file?" & vbNewLine & row.Item("DOC_PATH")
End If
Dim result1 As MsgBoxResult
result1 = MessageBox.Show(msg, "Confirmation:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result1 = MsgBoxResult.Yes Then
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 0 Then
MsgBox("Please choose a file!", MsgBoxStyle.Exclamation)
Exit Sub
End If
Dim msg = "Sind Sie sicher, dass Sie die Datei(en) endgültig löschen wollen?"
If USER_LANGUAGE <> "de-DE" Then
msg = "Are You sure You want to permanently delete this file(s)?"
End If
Dim result1 As MsgBoxResult
result1 = MessageBox.Show(msg, "Confirmation:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result1 = MsgBoxResult.Yes Then
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
If row.Item("DOC_PATH") <> "" Then
Try
If Not IsNothing(row.Item("DOC_ID")) Then
Dim Count As Integer = ClassDatabase.Execute_Scalar("SELECT COUNT(GUID) FROM TBPMO_DOC_RECORD_LINK WHERE DOC_ID = " & row.Item("DOC_ID"))
If Count > 1 Then
If Count > 1 And SEARCH_TYPE = "RECORD" Then
msg = "Diese Datei ist noch mit anderen Datensätzen verknüpft! Lediglich die Verknüpfung zum aktuellen Datensatz wird gelöscht!"
If USER_LANGUAGE <> "de-DE" Then
msg = "This file is also linked to other records! Only the link for this Record will be deleted!"
@@ -6143,11 +5874,14 @@ Public Class frmConstructor_Main
End If
RUN_WDSEARCH_GRID("RECORD")
Else
If SEARCH_TYPE = "FULLTEXT" Or SEARCH_TYPE = "ENTITY" Then
RECORD_ID = 0
End If
If ClassFileResult.Delete_ResultFile(row.Item("DOC_ID"), RECORD_ID, 1) = True Then
If ClassWindream.Delete_WDFile(row.Item("DOC_PATH")) = True Then
ClassHelper.InsertEssential_Log(row.Item("DOC_ID"), "DOC-ID", "FILE DELETED BY USER")
End If
RUN_WDSEARCH_GRID("RECORD")
Else
msg = String.Format("Die Datei {0} konnte nicht gelöscht werden! Prüfen Sie die logfile!", row.Item("DOC_PATH"))
If USER_LANGUAGE <> "de-DE" Then
@@ -6161,9 +5895,15 @@ Public Class frmConstructor_Main
Catch ex As Exception
MsgBox("Unexpected Error in Delete file:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End If
End If
Next
If SEARCH_TYPE = "ENTITY" Then
CURRENT_DT_DOC_ENTITY_SEARCH = Nothing
End If
Next
RUN_WDSEARCH_GRID(SEARCH_TYPE)
End If
End Sub
@@ -6251,4 +5991,35 @@ Public Class frmConstructor_Main
'frm.MdiParent = MAIN_FORM
frm.Show()
End Sub
Private Sub SucheAnzeigenToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles SucheAnzeigenToolStripMenuItem1.Click
GridViewDoc_Search.ShowFindPanel()
End Sub
Private Sub tsTextboxFulltext_KeyUp(sender As Object, e As KeyEventArgs) Handles tsTextboxFulltext.KeyUp
If e.KeyCode = Keys.Return Then
If tsTextboxFulltext.Text <> "" Then
RUN_WDSEARCH_GRID("FULLTEXT", tsTextboxFulltext.Text)
End If
End If
End Sub
Private Sub GridViewDoc_Search_ColumnFilterChanged(sender As Object, e As EventArgs) Handles GridViewDoc_Search.ColumnFilterChanged
Try
Dim origtext As String = tslblWindreamView.Text
If origtext.Contains(" (") Then
Dim existingstring = origtext.Substring(0, origtext.IndexOf("(") - 1)
tslblWindreamView.Text = String.Format("{0} ({1})", existingstring, GridViewDoc_Search.RowCount)
Else
tslblWindreamView.Text = String.Format("{0} ({1})", tslblWindreamView.Text, GridViewDoc_Search.RowCount)
End If
Catch ex As Exception
End Try
End Sub
Private Sub tsbtnEntitySearch_Click(sender As Object, e As EventArgs) Handles tsbtnEntitySearch.Click
RUN_WDSEARCH_GRID("ENTITY")
End Sub
End Class