Multiselect

This commit is contained in:
Jonathan Jenne
2023-08-02 08:11:40 +02:00
parent 5cb526e7a4
commit 080a711067
10 changed files with 634 additions and 421 deletions

View File

@@ -14,28 +14,9 @@ Imports System.IO
Imports System.Runtime.InteropServices
Imports DD_LIB_Standards
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Public Class frmNodeNavigation
<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)>
Public Shared Function ShellExecuteEx(ByRef lpExecInfo As SHELLEXECUTEINFO) As Boolean
End Function
Public Structure SHELLEXECUTEINFO
Public cbSize As Integer
Public fMask As Integer
Public hwnd As IntPtr
<MarshalAs(UnmanagedType.LPTStr)> Public lpVerb As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpFile As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpParameters As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpDirectory As String
Dim nShow As Integer
Dim hInstApp As IntPtr
Dim lpIDList As IntPtr
<MarshalAs(UnmanagedType.LPTStr)> Public lpClass As String
Public hkeyClass As IntPtr
Public dwHotKey As Integer
Public hIcon As IntPtr
Public hProcess As IntPtr
End Structure
#Region "Laufzeitvariablen & Konstanten"
Dim DT_STRUCTURE_NODES As DataTable
Dim DT_ADDING_USERS As DataTable
@@ -60,6 +41,8 @@ Public Class frmNodeNavigation
Delete
End Enum
Private WindowsEx As WindowsEx
Private DT_CONTROLS_ENTITY As DataTable
Private DT_COLUMNS_GRID_ENTITY As DataTable
Private DT_DOCRESULT_DROPDOWN_ITEMS As DataTable
@@ -94,121 +77,26 @@ Public Class frmNodeNavigation
Public Const SW_SHOW As Short = 5
Private CONTROL_DOCTYPE_MATCH As Integer = 0
Private FocusedNode As TreeListNode
Private MyTreeListViewState As TreeListViewState
Private MyTreeListViewState As ClassTreeListViewState
#End Region
Public Class TreeListViewState
Private expanded As ArrayList
Private selected As ArrayList
Private focused As Object
Private topNode As Object
Public Sub New()
Me.New(Nothing)
End Sub
Public Sub New(ByVal treeList As TreeList)
Me.treeList_Renamed = treeList
expanded = New ArrayList()
selected = New ArrayList()
End Sub
Public Sub Clear()
expanded.Clear()
selected.Clear()
focused = Nothing
topNode = Nothing
End Sub
Private Function GetExpanded() As ArrayList
Dim op As New OperationSaveExpanded()
TreeList.NodesIterator.DoOperation(op)
Return op.Nodes
End Function
Private Function GetSelected() As ArrayList
Dim al As New ArrayList()
For Each node As TreeListNode In TreeList.Selection
al.Add(node.GetValue(TreeList.KeyFieldName))
Next node
Return al
End Function
Private DocList As ClassWindreamDocGrid
Public Sub LoadState()
TreeList.BeginUpdate()
Try
TreeList.CollapseAll()
Dim node As TreeListNode
For Each key As Object In expanded
node = TreeList.FindNodeByKeyID(key)
If node IsNot Nothing Then
node.Expanded = True
End If
Next key
TreeList.FocusedNode = TreeList.FindNodeByKeyID(focused)
For Each key As Object In selected
node = TreeList.FindNodeByKeyID(key)
If node IsNot Nothing Then
TreeList.Selection.Add(node)
End If
Next key
Finally
TreeList.EndUpdate()
Dim topVisibleNode As TreeListNode = TreeList.FindNodeByKeyID(topNode)
If topVisibleNode Is Nothing Then
topVisibleNode = TreeList.FocusedNode
End If
TreeList.TopVisibleNodeIndex = TreeList.GetVisibleIndexByNode(topVisibleNode)
End Try
End Sub
Public Sub SaveState()
If TreeList.FocusedNode IsNot Nothing Then
expanded = GetExpanded()
selected = GetSelected()
focused = TreeList.FocusedNode(TreeList.KeyFieldName)
topNode = TreeList.GetNodeByVisibleIndex(TreeList.TopVisibleNodeIndex)(TreeList.KeyFieldName)
Else
Clear()
End If
End Sub
Private treeList_Renamed As TreeList
Public Property TreeList() As TreeList
Get
Return treeList_Renamed
End Get
Set(ByVal value As TreeList)
treeList_Renamed = value
Clear()
End Set
End Property
Private Class OperationSaveExpanded
Inherits TreeListOperation
Private al As New ArrayList()
Public Overrides Sub Execute(ByVal node As TreeListNode)
If node.HasChildren AndAlso node.Expanded Then
al.Add(node.GetValue(node.TreeList.KeyFieldName))
End If
End Sub
Public ReadOnly Property Nodes() As ArrayList
Get
Return al
End Get
End Property
End Class
End Class
Public Sub New(pEntityID As Int16, pConstructID As Int16)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
oEntityID = pEntityID
oConstructID = pConstructID
DocList = New ClassWindreamDocGrid(GridViewDoc_Search)
WindowsEx = New WindowsEx(LOGCONFIG)
End Sub
Private Function Get_Splitter_Layout_Filename()
Dim Filename As String = String.Format("{0}-{1}-SplitterLayout.xml", CONSTRUCTOR_DETAIL_ID, CONSTRUCTOR_DETAIL_ID.ToString)
Return System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
Return Path.Combine(Application.UserAppDataPath(), Filename)
End Function
Sub Save_Splitter_Layout()
Try
@@ -294,9 +182,10 @@ Public Class frmNodeNavigation
Catch ex As System.Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", ex.Message, "Error in Loading Form part 4")
End Try
Load_nodes()
End Sub
Async Function Load_nodes() As Threading.Tasks.Task
Private Sub Load_nodes()
Dim oHandle = SplashScreenManager.ShowOverlayForm(Me)
Try
@@ -345,12 +234,13 @@ Public Class frmNodeNavigation
Catch ex As Exception
LOGGER.Error(ex)
Finally
SplashScreenManager.CloseOverlayForm(oHandle)
End Try
End Function
End Sub
Private Sub TreeListDevexpress_ColumnFilterChanged(sender As Object, e As EventArgs)
Dim tree As TreeList = TryCast(sender, TreeList)
Dim filteredColumns As List(Of TreeListColumn) = tree.Columns.Cast(Of TreeListColumn)().Where(Function(c) c.FilterInfo.AutoFilterRowValue IsNot Nothing).ToList()
@@ -1847,15 +1737,12 @@ Public Class frmNodeNavigation
Save_DocGrid_Layout()
End Sub
Private Sub GridViewDoc_Search_FocusedColumnChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs) Handles GridViewDoc_Search.FocusedColumnChanged
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
'ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
Refresh_DocID()
End Sub
Private Sub GridViewDoc_Search_FocusedRowChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs) Handles GridViewDoc_Search.FocusedRowChanged
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
'ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
Refresh_DocID()
End Sub
@@ -2266,52 +2153,58 @@ Public Class frmNodeNavigation
End If
Me.Cursor = Cursors.WaitCursor
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
Dim oSelectedDocs = ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
'Refresh_DocID()
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
e.Cancel = True
End If
Refresh_DocID()
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
If ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_ID") = 0 Then
If oSelectedDocs.First.DocId = 0 Then
e.Cancel = True
End If
If oSelectedDocs.Count > 1 Then
ContextMenu_Multiplefiles()
ElseIf oSelectedDocs.Count = 1 Then
File_in_Work()
Dim oSelectedDocument = oSelectedDocs.First
Dim Result = ClassDOC_SEARCH.Get_File_Rights(oSelectedDocument.DocId)
If Not IsNothing(Result) Then
ROW_READ_ONLY = False
Select Case Result.ToString
Case "R"
ContextMenu_Read()
Case "RW"
ContextMenu_Write()
Case "RWA"
ContextMenu_Write()
Case ""
If USER_IS_ADMIN = False Then
ContextMenu_Read()
Else
LOGGER.Warn("FileRight is '' but User is Admin!! - Check the configuration!")
End If
ROW_READ_ONLY = True
End Select
CURRENT_FILE_RIGHT = Result.ToString
Else
ContextMenu_Read()
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Getting rights - check the log")
e.Cancel = True
End If
End If
File_in_Work()
Dim Result = ClassDOC_SEARCH.Get_File_Rights(ClassWindreamDocGrid.SELECTED_DOC_ID)
If Not IsNothing(Result) Then
ROW_READ_ONLY = False
Select Case Result.ToString
Case "R"
ContextMenu_Read()
Case "RW"
ContextMenu_Write()
Case "RWA"
ContextMenu_Write()
Case ""
If ROW_READ_ONLY = False Then
If RIGHT_READ_ONLY_DOC = True Then
If USER_IS_ADMIN = False Then
ContextMenu_Read()
Else
LOGGER.Warn("FileRight is '' but User is Admin!! - Check the configuration!")
LOGGER.Warn("RIGHT_READ_ONLY_DOC = True but User is Admin!! - Check the configuration!")
End If
ROW_READ_ONLY = True
End Select
CURRENT_FILE_RIGHT = Result.ToString
Else
ContextMenu_Read()
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Getting rights - check the log")
e.Cancel = True
End If
If ROW_READ_ONLY = False Then
If RIGHT_READ_ONLY_DOC = True Then
If USER_IS_ADMIN = False Then
ContextMenu_Read()
Else
LOGGER.Warn("RIGHT_READ_ONLY_DOC = True but User is Admin!! - Check the configuration!")
End If
End If
End If
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
If ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME") <> "" Then
If oSelectedDocs.First.DisplayName <> "" Then
tsmiFileRenameDisplayname.Visible = True
Else
tsmiFileRenameDisplayname.Visible = False
@@ -2328,36 +2221,70 @@ Public Class frmNodeNavigation
End Try
End Sub
Sub ContextMenu_Multiplefiles()
tsmiFileProperties.Enabled = False
Sub ContextMenu_Read()
tsmiFileOpen.Enabled = True
tsmiFileOpen.Enabled = False
tsmiFileFolderOpen.Enabled = False
tsmiFileInWork.Enabled = False
tsmiFileLink_Add.Enabled = True
tsmiFileLink_ShowAll.Enabled = True
tsmiFileLinkRemove.Enabled = True
tsmiFileRename.Enabled = False
tsmiFileInWork.Enabled = False
tsmiFileLink_Add.Enabled = False
tsmiFileLink_ShowAll.Enabled = True
tsmiFileVersion.Enabled = False
tsmiFileRightsShow.Enabled = False
tsmiFileDelete.Enabled = False
End Sub
Sub ContextMenu_Read()
tsmiFileProperties.Enabled = True
tsmiFileOpen.Enabled = True
tsmiFileFolderOpen.Enabled = True
tsmiFileInWork.Enabled = False
tsmiFileLink_Add.Enabled = False
tsmiFileLink_ShowAll.Enabled = True
tsmiFileLinkRemove.Enabled = False
tsmiFileRename.Enabled = False
tsmiFileVersion.Enabled = True
tsmiFileRightsShow.Enabled = True
tsmiFileDelete.Enabled = False
End Sub
Sub ContextMenu_Write()
tsmiFileOpen.Enabled = True
tsmiFileProperties.Enabled = True
tsmiFileOpen.Enabled = True
tsmiFileFolderOpen.Enabled = True
tsmiFileRename.Enabled = True
tsmiFileInWork.Enabled = True
tsmiFileLink_Add.Enabled = True
tsmiFileLink_ShowAll.Enabled = True
tsmiFileDelete.Enabled = True
tsmiFileLinkRemove.Enabled = True
tsmiFileRename.Enabled = True
tsmiFileVersion.Enabled = True
tsmiFileRightsShow.Enabled = True
tsmiFileDelete.Enabled = True
End Sub
Sub Open_File()
Me.Cursor = Cursors.WaitCursor
Dim allow_Open As Boolean = False
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
'ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
Dim Result = ClassDOC_SEARCH.Get_File_Rights(ClassWindreamDocGrid.SELECTED_DOC_ID)
If Not IsNothing(Result) Then
Select Case Result.ToString
Case "R"
@@ -2369,16 +2296,23 @@ Public Class frmNodeNavigation
End Select
End If
If allow_Open = True Then
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
'If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
' MsgBox("Could not read File Parameters(5)!", MsgBoxStyle.Exclamation)
' Exit Sub
'End If
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
MsgBox("Could not read File Parameters(5)!", MsgBoxStyle.Exclamation)
Exit Sub
End If
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
If ClassHelper.File_open(row.Item("DOC_PATH"), row.Item("DOC_ID")) = True Then
'For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
' If ClassHelper.File_open(row.Item("DOC_PATH"), row.Item("DOC_ID")) = True Then
' TimerFileHandle.Enabled = True
' End If
'Next
For Each oDoc As ClassWindreamDocGrid.WindreamDoc In ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
If ClassHelper.File_open(oDoc.DocPath, oDoc.DocId) = True Then
TimerFileHandle.Enabled = True
End If
Next
Else
If clsWD_GET.WDFile_exists(ClassWindreamDocGrid.SELECTED_DOC_PATH, DD_LIB_Standards.clsDatabase.DB_PROXY_INITIALIZED, ClassProxy.MyLinkedServer, True) = True Then
@@ -2445,7 +2379,7 @@ Public Class frmNodeNavigation
End Sub
Private Sub tsmiFileInWork_Click(sender As Object, e As EventArgs) Handles tsmiFileInWork.Click
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
MsgBox("Could not read File Parameters (3)!", MsgBoxStyle.Exclamation)
Exit Sub
End If
@@ -2482,15 +2416,30 @@ Public Class frmNodeNavigation
Private Sub tsmiFileRenameDisplayname_Click(sender As Object, e As EventArgs) Handles tsmiFileRenameDisplayname.Click
Try
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
If ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME") <> "" Then
Dim oRowHandle As Integer = GridViewDoc_Search.FocusedRowHandle
Dim frm As New frmFileRename(1, ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME"), "Displayname")
frm.ShowDialog()
RUN_WDSEARCH_GRID(True)
If Not IsNothing(oRowHandle) Then
GridViewDoc_Search.FocusedRowHandle = oRowHandle
End If
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
Exit Sub
End If
'If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
' If ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME") <> "" Then
' Dim oRowHandle As Integer = GridViewDoc_Search.FocusedRowHandle
' Dim frm As New frmFileRename(1, ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME"), "Displayname")
' frm.ShowDialog()
' RUN_WDSEARCH_GRID(True)
' If Not IsNothing(oRowHandle) Then
' GridViewDoc_Search.FocusedRowHandle = oRowHandle
' End If
' End If
'End If
Dim oDocuments = ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
If oDocuments.First.DisplayName <> "" Then
Dim oRowHandle As Integer = GridViewDoc_Search.FocusedRowHandle
Dim frm As New frmFileRename(1, oDocuments.First.DisplayName, "Displayname")
frm.ShowDialog()
RUN_WDSEARCH_GRID(True)
If Not IsNothing(oRowHandle) Then
GridViewDoc_Search.FocusedRowHandle = oRowHandle
End If
End If
Catch ex As Exception
@@ -2507,7 +2456,11 @@ Public Class frmNodeNavigation
LOGGER.Warn("Attention: Could not set DocVariable RENAME_DOC_PATH: " & ex.Message)
RENAME_DOC_PATH = Nothing
End Try
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
'If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
' MsgBox("Could not read File Parameters!", MsgBoxStyle.Exclamation)
' Exit Sub
'End If
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
MsgBox("Could not read File Parameters!", MsgBoxStyle.Exclamation)
Exit Sub
End If
@@ -2539,32 +2492,49 @@ Public Class frmNodeNavigation
End Sub
Private Sub tsmiFileFolderOpen_Click(sender As Object, e As EventArgs) Handles tsmiFileFolderOpen.Click
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
'If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
' MsgBox("Could not read File Parameters(5)!", MsgBoxStyle.Exclamation)
' Exit Sub
'End If
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
MsgBox("Could not read File Parameters(5)!", MsgBoxStyle.Exclamation)
Exit Sub
End If
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
ClassHelper.Open_Folder(row.Item("DOC_PATH"), row.Item("DOC_ID"))
'For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
' ClassHelper.Open_Folder(row.Item("DOC_PATH"), row.Item("DOC_ID"))
'Next
For Each oDoc As ClassWindreamDocGrid.WindreamDoc In ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
ClassHelper.Open_Folder(oDoc.DocPath, oDoc.DocId)
Next
End Sub
Private Sub tsmiFileLink_Add_Click(sender As Object, e As EventArgs) Handles tsmiFileLink_Add.Click
Try
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
'ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
'If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
' MsgBox("Could not read File Parameters (LinkRecord)!", MsgBoxStyle.Exclamation)
' Exit Sub
'End If
'ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
MsgBox("Could not read File Parameters (LinkRecord)!", MsgBoxStyle.Exclamation)
Exit Sub
End If
Refresh_Selected_Table()
Dim frm As New frmDocRecordLink
frm.Show()
Dim oDocuments = DocList.SelectedDocuments
Dim oForm As New frmDocRecordLink With {.Documents = oDocuments}
oForm.Show()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in Linking Record: " & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Sub Refresh_Selected_Table()
Dim table As New DataTable
table.TableName = "SelectedFiles"
Dim table As New DataTable With {
.TableName = "SelectedFiles"
}
' Create two columns, ID and Name.
Dim idColumn As DataColumn = table.Columns.Add("ID", GetType(System.Int32))
@@ -2575,13 +2545,13 @@ Public Class frmNodeNavigation
table.Columns.Add("FILEPATH", GetType(System.String))
table.Columns.Add("DOC_ID", GetType(System.Int32))
table.Columns.Add("OBJECTTYPE", GetType(System.String))
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
If row.Item("DOC_PATH") <> String.Empty Then
For Each oDoc As ClassWindreamDocGrid.WindreamDoc In ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
If oDoc.DocPath <> String.Empty Then
'Set the ID column as the primary key column.
Dim newRow As DataRow = table.NewRow()
newRow("FILEPATH") = row.Item("DOC_PATH")
newRow("DOC_ID") = row.Item("DOC_ID")
newRow("OBJECTTYPE") = row.Item("OBJECTTYPE")
newRow("FILEPATH") = oDoc.DocPath
newRow("DOC_ID") = oDoc.DocId
newRow("OBJECTTYPE") = oDoc.DocType
table.Rows.Add(newRow)
End If
Next
@@ -2598,9 +2568,10 @@ Public Class frmNodeNavigation
End If
CURRENT_DOC_ID = GridViewDoc_Search.GetRowCellValue(GridViewDoc_Search.FocusedRowHandle, "DocID")
Dim frm As New frmDoc_Links
frm.Show()
frm.BringToFront()
Dim oDocuments = DocList.SelectedDocuments
Dim oForm As New frmDoc_Links With {.Documents = oDocuments}
oForm.Show()
oForm.BringToFront()
Catch ex As Exception
MsgBox("Unexpected Error in Showing DocLinks: " & ex.Message, MsgBoxStyle.Critical)
End Try
@@ -2611,32 +2582,31 @@ Public Class frmNodeNavigation
ClassHelper.MSGBOX_Handler("INFO", "Attention", "Missing Selection:", "Please select a record!")
Exit Sub
End If
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
Exit Sub
End If
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count > 0 Then
Dim msg = "Wollen Sie die Verknüpfung der gewählten Datei/en wirklich entfernen?" & vbNewLine & "Datei/en bleibt/bleiben im DMS/Archiv/Explorer erhalten!"
If USER_LANGUAGE <> "de-DE" Then
msg = "Would You like to delete only the references?" & vbNewLine & "File(s) will stay in ECM/Archive/Explorer!"
End If
Dim result As MsgBoxResult
result = MessageBox.Show(msg, CAPTION_CONFIRMATION, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = MsgBoxResult.Yes Then
Try
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
If ClassFileResult.Delete_ResultFile(row.Item("DOC_ID"), CURRENT_RECORD_ID, 0) = True Then
ClassHelper.InsertEssential_Log(row.Item("DOC_ID"), "DOC-ID", "RECORD LINK REMOVED FROM DOC-SEARCH")
Cursor = Cursors.WaitCursor
RUN_WDSEARCH_GRID(True)
End If
Dim msg = "Wollen Sie die Verknüpfung der gewählten Datei/en wirklich entfernen?" & vbNewLine & "Datei/en bleibt/bleiben im DMS/Archiv/Explorer erhalten!"
If USER_LANGUAGE <> "de-DE" Then
msg = "Would You like to delete only the references?" & vbNewLine & "File(s) will stay in ECM/Archive/Explorer!"
End If
Dim result As MsgBoxResult
result = MessageBox.Show(msg, CAPTION_CONFIRMATION, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = MsgBoxResult.Yes Then
Try
For Each oDoc As ClassWindreamDocGrid.WindreamDoc In ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
If ClassFileResult.Delete_ResultFile(oDoc.DocId, CURRENT_RECORD_ID, 0) = True Then
ClassHelper.InsertEssential_Log(oDoc.DocId, "DOC-ID", "RECORD LINK REMOVED FROM DOC-SEARCH")
Cursor = Cursors.WaitCursor
RUN_WDSEARCH_GRID(True)
End If
Next
Next
Catch ex As Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Removing links from file:", ex.Message)
End Try
End If
Catch ex As Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Removing links from file:", ex.Message)
End Try
End If
End Sub
@@ -2665,27 +2635,25 @@ Public Class frmNodeNavigation
Show_File_Properties()
End Sub
Sub Show_File_Properties()
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
MsgBox("Could not read File Parameters(4)!", MsgBoxStyle.Exclamation)
Exit Sub
End If
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
If row.Item("DOC_PATH") <> "" Then
Dim oFileFullPath = ClassHelper.FORMAT_WM_PATH(row.Item("DOC_PATH"))
Cursor = Cursors.WaitCursor
Dim sei As New SHELLEXECUTEINFO
sei.cbSize = Marshal.SizeOf(sei)
sei.lpVerb = "properties"
sei.lpFile = oFileFullPath
sei.nShow = SW_SHOW
sei.fMask = SEE_MASK_INVOKEIDLIST
If Not ShellExecuteEx(sei) Then
Dim ex As New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error())
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Open file propertys:", ex.Message)
End If
Cursor = Cursors.WaitCursor
For Each oDoc As ClassWindreamDocGrid.WindreamDoc In ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
If oDoc.DocPath <> "" Then
Dim oFileFullPath = ClassHelper.FORMAT_WM_PATH(oDoc.DocPath)
Try
If Not WindowsEx.OpenFileProperties(oFileFullPath) Then
Dim ex As New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error())
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Open file propertys:", ex.Message)
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
End If
Cursor = Cursors.Default
Next
Cursor = Cursors.Default
End Sub
Private Sub EigenschaftenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EigenschaftenToolStripMenuItem.Click
@@ -2710,7 +2678,7 @@ Public Class frmNodeNavigation
End Sub
Private Sub UnterknotenNeuOrdnenToolStripMenuItem_Click(sender As Object, e As EventArgs)
MyTreeListViewState = New TreeListViewState(TreeListDevexpress)
MyTreeListViewState = New ClassTreeListViewState(TreeListDevexpress)
Dim oQuestion = "Wollen Sie die gesamte Struktur unterhalb dieses Knotens neu ordnen lassen?" & vbNewLine & "Nein, wenn nur die direkten Unterknoten neu geordnet werden sollen!"
If USER_LANGUAGE <> "de-DE" Then
oQuestion = "Do you want to reorder the entire structure below this node?" & vbNewLine & "No, if only the direct subnodes are to be reordered!"
@@ -2761,77 +2729,78 @@ Public Class frmNodeNavigation
'End Sub
Private Sub GridViewDoc_Search_RowStyle(sender As Object, e As RowStyleEventArgs) Handles GridViewDoc_Search.RowStyle
If e.RowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle Then
e.Appearance.BackColor = Color.Yellow
Else
If e.RowHandle = -1 Then
Exit Sub
End If
Try
Dim rowCellValue = GridViewDoc_Search.GetRowCellValue(e.RowHandle, "in work?")
If Not IsNothing(rowCellValue) Then
Dim inwork = rowCellValue
If inwork = True Then
e.Appearance.BackColor = Color.Orchid
e.HighPriority = True
End If
End If
Catch ex As Exception
LOGGER.Warn("Unexpected Error in Checking Value In Work: " & ex.Message)
End Try
'TODO: Refactor RowStyle maybe
'If e.RowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle Then
' e.Appearance.BackColor = Color.Yellow
'Else
' If e.RowHandle = -1 Then
' Exit Sub
' End If
' Try
' Dim rowCellValue = GridViewDoc_Search.GetRowCellValue(e.RowHandle, "in work?")
' If Not IsNothing(rowCellValue) Then
' Dim inwork = rowCellValue
' If inwork = True Then
' e.Appearance.BackColor = Color.Orchid
' e.HighPriority = True
' End If
' End If
' Catch ex As Exception
' LOGGER.Warn("Unexpected Error in Checking Value In Work: " & ex.Message)
' End Try
Try
Dim DROPDOWN_VALUE
If Not IsNothing(DT_DOCRESULT_DROPDOWN_ITEMS) Then
'Den ColumnTitle aus ConfigTableholen
If DT_DOCRESULT_DROPDOWN_ITEMS.Rows.Count > 0 Then
For Each confrow As DataRow In DT_DOCRESULT_DROPDOWN_ITEMS.Rows
Dim CAPTION = confrow.Item("HEADER_CAPTION")
DROPDOWN_VALUE = GridViewDoc_Search.GetRowCellValue(e.RowHandle, CAPTION)
If Not IsNothing(DROPDOWN_VALUE) Then
Exit For
End If
Next
' Try
' Dim DROPDOWN_VALUE
' If Not IsNothing(DT_DOCRESULT_DROPDOWN_ITEMS) Then
' 'Den ColumnTitle aus ConfigTableholen
' If DT_DOCRESULT_DROPDOWN_ITEMS.Rows.Count > 0 Then
' For Each confrow As DataRow In DT_DOCRESULT_DROPDOWN_ITEMS.Rows
' Dim CAPTION = confrow.Item("HEADER_CAPTION")
' DROPDOWN_VALUE = GridViewDoc_Search.GetRowCellValue(e.RowHandle, CAPTION)
' If Not IsNothing(DROPDOWN_VALUE) Then
' Exit For
' End If
' Next
If Not IsNothing(DROPDOWN_VALUE) Then
Dim ColorRow As Color
Dim expression As String = String.Format("VALUE = '{0}'", DROPDOWN_VALUE)
Dim matchingRows() As DataRow = DT_DOCRESULT_DROPDOWN_ITEMS.Select(expression, "SEQUENCE")
Dim rowcolorname As String = ""
'Die Color für den value auswählen
For Each matchingRow As DataRow In matchingRows
rowcolorname = ""
If Not IsDBNull(matchingRow.Item("COLOR")) Then
rowcolorname = matchingRow.Item("COLOR")
End If
' If Not IsNothing(DROPDOWN_VALUE) Then
' Dim ColorRow As Color
' Dim expression As String = String.Format("VALUE = '{0}'", DROPDOWN_VALUE)
' Dim matchingRows() As DataRow = DT_DOCRESULT_DROPDOWN_ITEMS.Select(expression, "SEQUENCE")
' Dim rowcolorname As String = ""
' 'Die Color für den value auswählen
' For Each matchingRow As DataRow In matchingRows
' rowcolorname = ""
' If Not IsDBNull(matchingRow.Item("COLOR")) Then
' rowcolorname = matchingRow.Item("COLOR")
' End If
If rowcolorname <> "" Then
Exit For
End If
Next
If rowcolorname <> "" Then
ColorRow = Color.FromName(rowcolorname)
e.Appearance.BackColor = ColorRow
e.HighPriority = True
End If
' If rowcolorname <> "" Then
' Exit For
' End If
' Next
' If rowcolorname <> "" Then
' ColorRow = Color.FromName(rowcolorname)
' e.Appearance.BackColor = ColorRow
' e.HighPriority = True
' End If
'Dim c As Color = DirectCast(rowCellValue, Color)
' 'Dim c As Color = DirectCast(rowCellValue, Color)
End If
End If
' End If
' End If
End If
Catch ex As Exception
LOGGER.Warn("Unexpected Error in RowStyle-Color Dropdown: " & ex.Message)
End Try
' End If
' Catch ex As Exception
' LOGGER.Warn("Unexpected Error in RowStyle-Color Dropdown: " & ex.Message)
' End Try
End If
'End If
End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BbtnitmNodeReorder.ItemClick
MyTreeListViewState = New TreeListViewState(TreeListDevexpress)
MyTreeListViewState = New ClassTreeListViewState(TreeListDevexpress)
Dim oQuestion = "Wollen Sie die gesamte Struktur unterhalb dieses Knotens neu ordnen lassen?" & vbNewLine & "Nein, wenn nur die direkten Unterknoten neu geordnet werden sollen!"
If USER_LANGUAGE <> "de-DE" Then
oQuestion = "Do you want to reorder the entire structure below this node?" & vbNewLine & "No, if only the direct subnodes are to be reordered!"
@@ -2879,8 +2848,4 @@ Public Class frmNodeNavigation
Private Sub bbtnitmRecSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtnitmRecSave.ItemClick
Save_Record()
End Sub
Private Sub GridViewDoc_Search_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles GridViewDoc_Search.SelectionChanged
Dim oDocuments = ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
End Sub
End Class