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

@@ -0,0 +1,103 @@
Imports DevExpress.XtraTreeList
Imports DevExpress.XtraTreeList.Nodes
Imports DevExpress.XtraTreeList.Nodes.Operations
Public Class ClassTreeListViewState
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
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

View File

@@ -8,6 +8,35 @@ Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraEditors.Controls Imports DevExpress.XtraEditors.Controls
Public Class ClassWindreamDocGrid Public Class ClassWindreamDocGrid
' === BEGIN CLASS PART ===
Public Class WindreamDoc
Public Property DocId As Integer
Public Property DocPath As String
Public Property DisplayName As String
Public Property DocType As String
End Class
Private ReadOnly GridView As GridView
Public ReadOnly Property SelectedDocuments As List(Of WindreamDoc)
Get
Return GetSelectedDocuments(GridView)
End Get
End Property
Public ReadOnly Property HasSelectedDocuments As Boolean
Get
Return HasNoSelectedDocuments(GridView)
End Get
End Property
Public Sub New(pGridView As GridView)
GridView = pGridView
End Sub
' === END CLASS PART ===
Private Shared _Helper As ClassHelper Private Shared _Helper As ClassHelper
Public Shared SELECTED_DOC_PATH As String Public Shared SELECTED_DOC_PATH As String
'Public Shared RESULT_OBJECTTYPE As String 'Public Shared RESULT_OBJECTTYPE As String
@@ -31,12 +60,6 @@ Public Class ClassWindreamDocGrid
Private Shared _textValueChangedHandler As EventHandler Private Shared _textValueChangedHandler As EventHandler
Private Shared _checkValueChangedHandler As EventHandler Private Shared _checkValueChangedHandler As EventHandler
Public Class WindreamDoc
Public Property DocId As Integer
Public Property DocPath As String
Public Property DisplayName As String
End Class
Private Shared Function Init_Table() Private Shared Function Init_Table()
Try Try
Dim table As New DataTable With { Dim table As New DataTable With {
@@ -60,7 +83,12 @@ Public Class ClassWindreamDocGrid
End Function End Function
Public Shared Function GetSelectedDocuments(pGridView As GridView) Public Shared Function HasNoSelectedDocuments(pGridView As GridView) As Boolean
Dim oSelectedRows As List(Of Integer) = pGridView.GetSelectedRows().ToList()
Return oSelectedRows.Count = 0
End Function
Public Shared Function GetSelectedDocuments(pGridView As GridView) As List(Of WindreamDoc)
Dim oSelectedRows As List(Of Integer) = pGridView.GetSelectedRows().ToList() Dim oSelectedRows As List(Of Integer) = pGridView.GetSelectedRows().ToList()
Dim oDocuments As New List(Of WindreamDoc) Dim oDocuments As New List(Of WindreamDoc)
@@ -68,10 +96,12 @@ Public Class ClassWindreamDocGrid
Dim oDocId = pGridView.GetRowCellValue(oRowHandle, "DocID") Dim oDocId = pGridView.GetRowCellValue(oRowHandle, "DocID")
Dim oDisplayName = pGridView.GetRowCellValue(oRowHandle, "Displayname") Dim oDisplayName = pGridView.GetRowCellValue(oRowHandle, "Displayname")
Dim oDocPath = pGridView.GetRowCellValue(oRowHandle, "FULLPATH") Dim oDocPath = pGridView.GetRowCellValue(oRowHandle, "FULLPATH")
Dim oDocType = pGridView.GetRowCellValue(oRowHandle, "OBJECTTYPE")
oDocuments.Add(New WindreamDoc With { oDocuments.Add(New WindreamDoc With {
.DocId = oDocId, .DocId = oDocId,
.DocPath = oDocPath, .DocPath = oDocPath,
.DocType = oDocType,
.DisplayName = oDisplayName .DisplayName = oDisplayName
}) })
Next Next

View File

@@ -66,7 +66,6 @@ Module ModuleRuntimeVariables
Public CURRENT_NOTIFICATION_MSG As String Public CURRENT_NOTIFICATION_MSG As String
Public CURRENT_ENTITY_ID As Integer Public CURRENT_ENTITY_ID As Integer
Public CURRENT_LINK_ENTITY_ID As Integer = 0
Public CURRENT_FORMVIEW_ID As Integer Public CURRENT_FORMVIEW_ID As Integer
Public CURRENT_REDUNDANT_FORM_ID As Integer Public CURRENT_REDUNDANT_FORM_ID As Integer
Public CURRENT_REDUNDANT_FORMVIEW_ID As Integer Public CURRENT_REDUNDANT_FORMVIEW_ID As Integer
@@ -140,7 +139,7 @@ Module ModuleRuntimeVariables
Public CURRENT_SEARCH_TYPE As String = "RECORD" Public CURRENT_SEARCH_TYPE As String = "RECORD"
Public CURRENT_FULLTEXT_PATTERN As String Public CURRENT_FULLTEXT_PATTERN As String
Public CURRENT_DT_SELECTED_FILES As DataTable Public Property CURRENT_DT_SELECTED_FILES As DataTable
Public MASS_RECORD_IDs2CHANGE As ArrayList Public MASS_RECORD_IDs2CHANGE As ArrayList
Public MASS_COLUMN_LIST As ArrayList Public MASS_COLUMN_LIST As ArrayList

View File

@@ -268,6 +268,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Classes\ClassConfig.vb" /> <Compile Include="Classes\ClassConfig.vb" />
<Compile Include="Classes\ClassTreeListViewState.vb" />
<Compile Include="Classes\NodeNavigation\ClassAsyncNodeBuild.vb" /> <Compile Include="Classes\NodeNavigation\ClassAsyncNodeBuild.vb" />
<Compile Include="Classes\ClassAsyncReturnDT.vb" /> <Compile Include="Classes\ClassAsyncReturnDT.vb" />
<Compile Include="Classes\ClassBackgroundHelper.vb" /> <Compile Include="Classes\ClassBackgroundHelper.vb" />

View File

@@ -2,7 +2,12 @@
Imports System.Text Imports System.Text
Imports DD_LIB_Standards Imports DD_LIB_Standards
Public Class frmDocRecordLink Public Class frmDocRecordLink
Dim ENTITY_LOAD_ACTIVE As Boolean = False
Public Property Documents As New List(Of ClassWindreamDocGrid.WindreamDoc)
Private CURRENT_LINK_ENTITY_ID As Integer = 0
Private ENTITY_LOAD_ACTIVE As Boolean = False
Private Class ClassEntity Private Class ClassEntity
Public title As String Public title As String
Public id As Integer Public id As Integer
@@ -58,71 +63,140 @@ Public Class frmDocRecordLink
grvwGrid.BestFitColumns() grvwGrid.BestFitColumns()
End Sub End Sub
Private Sub frmDocRecordLink_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub frmDocRecordLink_Load(sender As Object, e As EventArgs) Handles Me.Load
ENTITY_LOAD_ACTIVE = True ' OLD WAY
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then If Documents.Count = 0 Then
txtFileInfo.Text = ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_PATH") ENTITY_LOAD_ACTIVE = True
Else If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
txtFileInfo.Text = String.Format("{0} files selected for linking to record", ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count) txtFileInfo.Text = ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_PATH")
End If
Try
If IsNothing(CURRENT_DT_ENTITY_RECORDS) Then
Me.Close()
End If
If CURRENT_LINK_ENTITY_ID = 0 Then
Refresh_Grid_Data(True, Nothing)
CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID
Else Else
Dim DT_RESULT As DataTable txtFileInfo.Text = String.Format("{0} files selected for linking to record", ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count)
If CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID Then End If
DT_RESULT = CURRENT_DT_ENTITY_RECORDS Try
If IsNothing(CURRENT_DT_ENTITY_RECORDS) Then
Me.Close()
End If
If CURRENT_LINK_ENTITY_ID = 0 Then
Refresh_Grid_Data(True, Nothing)
CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID
Else Else
DT_RESULT = ReturnDataforEntity(CURRENT_LINK_ENTITY_ID) Dim DT_RESULT As DataTable
If CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID Then
DT_RESULT = CURRENT_DT_ENTITY_RECORDS
Else
DT_RESULT = ReturnDataforEntity(CURRENT_LINK_ENTITY_ID)
End If
If Not IsNothing(DT_RESULT) Then
Refresh_Grid_Data(False, DT_RESULT)
End If
End If End If
If Not IsNothing(DT_RESULT) Then
Refresh_Grid_Data(False, DT_RESULT) Dim DT_ENTITIES As DataTable = GetENTITIES()
Dim oSelectedIndex As Integer = 0
If DT_ENTITIES.Rows.Count = 0 Then
Exit Sub
End If End If
End If Dim oCount = 0
For Each row As DataRow In DT_ENTITIES.Rows
Dim entity As New ClassEntity
Dim DT_ENTITIES As DataTable = GetENTITIES() entity.title = row.Item("FORM_TITLE")
Dim oSelectedIndex As Integer = 0 entity.id = row.Item("FORM_ID")
cmbConstructorForms.Items.Add(entity)
If DT_ENTITIES.Rows.Count = 0 Then If CURRENT_LINK_ENTITY_ID = entity.id Then
Exit Sub txtcurrSichtData.Text = entity.title
End If oSelectedIndex = oCount
Dim oCount = 0 End If
For Each row As DataRow In DT_ENTITIES.Rows oCount += 1
Dim entity As New ClassEntity Next
entity.title = row.Item("FORM_TITLE") If USER_LANGUAGE = "de-DE" Then
entity.id = row.Item("FORM_ID") Me.Text = CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " Datei(en) mit Datensatz verknüpfen:"
cmbConstructorForms.Items.Add(entity) Else
If CURRENT_LINK_ENTITY_ID = entity.id Then Me.Text = "Link " & CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " files with record:"
txtcurrSichtData.Text = entity.title
oSelectedIndex = oCount
End If End If
oCount += 1 ' Den index der aktuell geöffneten ConstructorForm setzen
Next cmbConstructorForms.SelectedIndex = oSelectedIndex
If USER_LANGUAGE = "de-DE" Then
Me.Text = CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " Datei(en) mit Datensatz verknüpfen:" Catch ex As Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDocRecordLink_Load", ex.Message, ex.StackTrace)
End Try
Load_DocGrid_Layout()
bsiInfo.Caption = "Waiting for record-Selection....."
End If
If Documents.Count > 0 Then
ENTITY_LOAD_ACTIVE = True
If Documents.Count = 1 Then
txtFileInfo.Text = Documents.First.DocPath
Else Else
Me.Text = "Link " & CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " files with record:" txtFileInfo.Text = String.Format("{0} files selected for linking to record", Documents.Count)
End If End If
' Den index der aktuell geöffneten ConstructorForm setzen Try
cmbConstructorForms.SelectedIndex = oSelectedIndex If IsNothing(CURRENT_DT_ENTITY_RECORDS) Then
Me.Close()
End If
If CURRENT_LINK_ENTITY_ID = 0 Then
Refresh_Grid_Data(True, Nothing)
CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID
Else
Dim DT_RESULT As DataTable
If CURRENT_LINK_ENTITY_ID = CURRENT_ENTITY_ID Then
DT_RESULT = CURRENT_DT_ENTITY_RECORDS
Else
DT_RESULT = ReturnDataforEntity(CURRENT_LINK_ENTITY_ID)
End If
Catch ex As Exception If Not IsNothing(DT_RESULT) Then
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDocRecordLink_Load", ex.Message, ex.StackTrace) Refresh_Grid_Data(False, DT_RESULT)
End Try End If
End If
Dim DT_ENTITIES As DataTable = GetENTITIES()
Dim oSelectedIndex As Integer = 0
If DT_ENTITIES.Rows.Count = 0 Then
Exit Sub
End If
Dim oCount = 0
For Each row As DataRow In DT_ENTITIES.Rows
Dim entity As New ClassEntity
entity.title = row.Item("FORM_TITLE")
entity.id = row.Item("FORM_ID")
cmbConstructorForms.Items.Add(entity)
If CURRENT_LINK_ENTITY_ID = entity.id Then
txtcurrSichtData.Text = entity.title
oSelectedIndex = oCount
End If
oCount += 1
Next
If USER_LANGUAGE = "de-DE" Then
Me.Text = CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " Datei(en) mit Datensatz verknüpfen:"
Else
Me.Text = "Link " & CURRENT_DT_SELECTED_FILES.Rows.Count.ToString & " files with record:"
End If
' Den index der aktuell geöffneten ConstructorForm setzen
cmbConstructorForms.SelectedIndex = oSelectedIndex
Catch ex As Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDocRecordLink_Load", ex.Message, ex.StackTrace)
End Try
Load_DocGrid_Layout()
bsiInfo.Caption = "Waiting for record-Selection....."
End If
Load_DocGrid_Layout()
bsiInfo.Caption = "Waiting for record-Selection....."
End Sub End Sub
Private Function GetENTITIES() As DataTable Private Function GetENTITIES() As DataTable
Try Try
Dim SQL As String = String.Format("SELECT DISTINCT FORM_ID,FORM_TITLE,SEQUENCE FROM VWPMO_CONSTRUCTOR_FORMS where CONSTRUCT_ID in " & Dim SQL As String = String.Format("SELECT DISTINCT FORM_ID,FORM_TITLE,SEQUENCE FROM VWPMO_CONSTRUCTOR_FORMS where CONSTRUCT_ID in " &
"(SELECT CONSTRUCT_ID FROM TBPMO_CONSTRUCTOR_USER WHERE USER_ID = {0}) ORDER BY SEQUENCE", USER_GUID) "(SELECT CONSTRUCT_ID FROM TBPMO_CONSTRUCTOR_USER WHERE USER_ID = {0}) ORDER BY SEQUENCE", USER_GUID)
Dim dt As DataTable = MYDB_ECM.GetDatatable(sql) Dim dt As DataTable = MYDB_ECM.GetDatatable(SQL)
Return dt Return dt
Catch ex As Exception Catch ex As Exception
MsgBox("Entities could not be loaded in LinkToRecord: " & vbNewLine & ex.Message) MsgBox("Entities could not be loaded in LinkToRecord: " & vbNewLine & ex.Message)

View File

@@ -3,16 +3,29 @@ Imports DD_LIB_Standards
Imports DevExpress.XtraPrinting Imports DevExpress.XtraPrinting
Public Class frmDoc_Links Public Class frmDoc_Links
Public Property Documents As New List(Of ClassWindreamDocGrid.WindreamDoc)
Private Sub frmDoc_DocLinks_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub frmDoc_DocLinks_Load(sender As Object, e As EventArgs) Handles Me.Load
Try Try
Refresh_Grid_Data(Documents)
Refresh_Grid_Data() ' TODO: this does not work for the old form
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then If Documents.Count = 0 Then
Me.Text = $"Document-Links for file: {ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_PATH")}" Text = $"Document-Links for: NODOC-ID"
ElseIf Documents.Count = 1 Then
Text = $"Document-Links for: {Documents.First.DocPath}"
Else Else
Me.Text = $"Document-Links for file: NODOC-ID" Text = $"Document-Links for {Documents.Count} files"
End If End If
'If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
' Me.Text = $"Document-Links for file: {ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_PATH")}"
'Else
' Me.Text = $"Document-Links for file: NODOC-ID"
'End If
bbtnitmdeletelink.Enabled = False bbtnitmdeletelink.Enabled = False
Select Case CURRENT_FILE_RIGHT Select Case CURRENT_FILE_RIGHT
Case "RW" Case "RW"
bbtnitmdeletelink.Enabled = True bbtnitmdeletelink.Enabled = True
@@ -23,22 +36,44 @@ Public Class frmDoc_Links
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDoc_DocLinks_Load", ex.Message, ex.StackTrace) ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in frmDoc_DocLinks_Load", ex.Message, ex.StackTrace)
End Try End Try
End Sub End Sub
Sub Refresh_Grid_Data()
Private Function Get_Grid_Data(pDocuments As List(Of ClassWindreamDocGrid.WindreamDoc)) As DataTable
Dim oTable As DataTable
Dim oSql As String = ""
If pDocuments.Count > 0 Then
Dim oIds = String.Join(",", pDocuments.Select(Function(d) d.DocId).ToArray())
oSql = $"SELECT * FROM VWPMO_CUST_DOC_OBJECT_LINKS WHERE DocID IN ({oIds})"
oTable = MYDB_ECM.GetDatatable(oSql)
Else
oSql = $"select * FROM VWPMO_CUST_DOC_OBJECT_LINKS WHERE DocID = {CURRENT_DOC_ID}"
oTable = MYDB_ECM.GetDatatable(oSql)
End If
If oTable Is Nothing Then
LOGGER.Error("Please check your link-object-relation: {0}", oSql)
End If
Return oTable
End Function
Sub Refresh_Grid_Data(pDocuments As List(Of ClassWindreamDocGrid.WindreamDoc))
Try Try
Dim DT_RECORDS As DataTable Dim oTable = Get_Grid_Data(pDocuments)
Dim oSql = $"select * FROM VWPMO_CUST_DOC_OBJECT_LINKS WHERE DocID = {CURRENT_DOC_ID}"
DT_RECORDS = MYDB_ECM.GetDatatable(oSql) If Not IsNothing(oTable) Then
If Not IsNothing(DT_RECORDS) Then BarStaticItemStatus.Caption = $"{oTable.Rows.Count} links for Document found!"
BarStaticItemStatus.Caption = $"{DT_RECORDS.Rows.Count} links for Document found!"
grvwGrid.Columns.Clear() grvwGrid.Columns.Clear()
GridControlRecords.DataSource = DT_RECORDS GridControlRecords.DataSource = oTable
'grvwGrid.Columns.Item("already linked").Fixed = True 'grvwGrid.Columns.Item("already linked").Fixed = True
Try Try
grvwGrid.Columns.Item("DocID").Visible = False grvwGrid.Columns.Item("DocID").Visible = False
grvwGrid.Columns.Item("RecordID").Visible = False grvwGrid.Columns.Item("RecordID").Visible = False
'grvwGrid.Columns.Item("FULL_FILENAME").Visible = False 'grvwGrid.Columns.Item("FULL_FILENAME").Visible = False
Try Try
grvwGrid.Columns.Item("VALUE").Visible = False If grvwGrid.Columns.Item("VALUE") IsNot Nothing Then
grvwGrid.Columns.Item("VALUE").Visible = False
End If
Catch ex1 As Exception Catch ex1 As Exception
LOGGER.Warn("Column VALUE not part of VWPMO_CUST_DOC_OBJECT_LINKS" & ex1.Message) LOGGER.Warn("Column VALUE not part of VWPMO_CUST_DOC_OBJECT_LINKS" & ex1.Message)
End Try End Try
@@ -49,16 +84,17 @@ Public Class frmDoc_Links
End Try End Try
GridControlRecords.RefreshDataSource() GridControlRecords.RefreshDataSource()
'If DT_RECORDS.Rows.Count > 10000 Then 'If oTable.Rows.Count > 10000 Then
' BarButtonItem2.Enabled = False ' BarButtonItem2.Enabled = False
'Else 'Else
' BarButtonItem2.Enabled = True ' BarButtonItem2.Enabled = True
'End If 'End If
Else Else
MsgBox($"Please check Your link-object-relation: {oSql}", MsgBoxStyle.Exclamation) MsgBox($"Please check Your link-object-relation", MsgBoxStyle.Exclamation)
End If End If
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex)
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in Sub Refresh_Grid_Data", ex.Message, ex.StackTrace) ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error in Sub Refresh_Grid_Data", ex.Message, ex.StackTrace)
End Try End Try
@@ -86,22 +122,25 @@ Public Class frmDoc_Links
End Try End Try
Next Next
Refresh_Grid_Data() Refresh_Grid_Data(Documents)
End Sub End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
Try Try
Dim saveFileDialogDocSearchResult As New SaveFileDialog Dim saveFileDialogDocSearchResult As New SaveFileDialog With {
saveFileDialogDocSearchResult.Filter = "Excel File|*.xlsx" .Filter = "Excel File|*.xlsx",
saveFileDialogDocSearchResult.Title = "Export to Excel:" .Title = "Export to Excel:"
}
saveFileDialogDocSearchResult.ShowDialog() saveFileDialogDocSearchResult.ShowDialog()
If saveFileDialogDocSearchResult.FileName <> "" Then If saveFileDialogDocSearchResult.FileName <> "" Then
Dim oOptions As XlsxExportOptionsEx = New XlsxExportOptionsEx Dim oOptions As New XlsxExportOptionsEx With {
oOptions.ShowGridLines = True .ShowGridLines = True,
oOptions.AllowSortingAndFiltering = DevExpress.Utils.DefaultBoolean.True .AllowSortingAndFiltering = DevExpress.Utils.DefaultBoolean.True,
oOptions.ExportType = DevExpress.Export.ExportType.DataAware .ExportType = DevExpress.Export.ExportType.DataAware,
oOptions.ExportMode = XlsxExportMode.SingleFile .ExportMode = XlsxExportMode.SingleFile,
oOptions.AllowFixedColumnHeaderPanel = DevExpress.Utils.DefaultBoolean.True .AllowFixedColumnHeaderPanel = DevExpress.Utils.DefaultBoolean.True
}
Cursor = Cursors.WaitCursor Cursor = Cursors.WaitCursor
GridControlRecords.MainView.ExportToXlsx(saveFileDialogDocSearchResult.FileName, oOptions) GridControlRecords.MainView.ExportToXlsx(saveFileDialogDocSearchResult.FileName, oOptions)
@@ -118,21 +157,18 @@ Public Class frmDoc_Links
End If End If
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in ExportExcel: " & ex.Message, MsgBoxStyle.Critical) MsgBox("Unexpected Error in ExportExcel: " & ex.Message, MsgBoxStyle.Critical)
End Try End Try
Cursor = Cursors.Default Cursor = Cursors.Default
End Sub End Sub
Private Sub frmDoc_Links_MaximizedBoundsChanged(sender As Object, e As EventArgs) Handles MyBase.MaximizedBoundsChanged
End Sub
Private Sub frmDoc_Links_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged Private Sub frmDoc_Links_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
Try Try
grvwGrid.OptionsView.ColumnAutoWidth = False grvwGrid.OptionsView.ColumnAutoWidth = False
grvwGrid.BestFitColumns() grvwGrid.BestFitColumns()
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex)
End Try End Try
End Sub End Sub

View File

@@ -422,16 +422,22 @@ Public Class frmEntities
End Sub End Sub
Private Sub BW_Entity_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BW_Entity.RunWorkerCompleted Private Sub BW_Entity_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BW_Entity.RunWorkerCompleted
ProgressPanel1.Visible = False If e.Error IsNot Nothing Then
btncancel.Visible = False MsgBox("Unexpected Error in Executing Procedure - Check the log!", MsgBoxStyle.Critical, Text)
If Not IsNothing(DT_RESULT) Then LOGGER.Error(e.Error)
Dim result = DT_RESULT.Rows(0).Item(0) Else
If result <> 0 Then If Not IsNothing(DT_RESULT) Then
MsgBox("Unexpected Error in Executing Procedure - Check the log!", MsgBoxStyle.Critical) Dim result = DT_RESULT.Rows(0).Item(0)
Else If result <> 0 Then
MsgBox("Procedure was executed successfully!", MsgBoxStyle.Information) MsgBox("Unexpected Error in Executing Procedure - Check the log!", MsgBoxStyle.Critical, Text)
Else
MsgBox("Procedure was executed successfully!", MsgBoxStyle.Information, Text)
End If
End If End If
End If End If
ProgressPanel1.Visible = False
btncancel.Visible = False
End Sub End Sub
Private Sub btncancel_Click(sender As Object, e As EventArgs) Handles btncancel.Click Private Sub btncancel_Click(sender As Object, e As EventArgs) Handles btncancel.Click

View File

@@ -24,7 +24,7 @@ Partial Class frmNodeNavigation
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container() Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmNodeNavigation)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmNodeNavigation))
Dim GridLevelNode2 As DevExpress.XtraGrid.GridLevelNode = New DevExpress.XtraGrid.GridLevelNode() Dim GridLevelNode1 As DevExpress.XtraGrid.GridLevelNode = New DevExpress.XtraGrid.GridLevelNode()
Me.ribbonNodeNavigation = New DevExpress.XtraBars.Ribbon.RibbonControl() Me.ribbonNodeNavigation = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.bbtnitmRecEdit = New DevExpress.XtraBars.BarButtonItem() Me.bbtnitmRecEdit = New DevExpress.XtraBars.BarButtonItem()
Me.bsiInfo = New DevExpress.XtraBars.BarStaticItem() Me.bsiInfo = New DevExpress.XtraBars.BarStaticItem()
@@ -113,7 +113,7 @@ Partial Class frmNodeNavigation
Me.ribbonNodeNavigation.ShowExpandCollapseButton = DevExpress.Utils.DefaultBoolean.[True] Me.ribbonNodeNavigation.ShowExpandCollapseButton = DevExpress.Utils.DefaultBoolean.[True]
Me.ribbonNodeNavigation.ShowMoreCommandsButton = DevExpress.Utils.DefaultBoolean.[False] Me.ribbonNodeNavigation.ShowMoreCommandsButton = DevExpress.Utils.DefaultBoolean.[False]
Me.ribbonNodeNavigation.ShowToolbarCustomizeItem = False Me.ribbonNodeNavigation.ShowToolbarCustomizeItem = False
Me.ribbonNodeNavigation.Size = New System.Drawing.Size(1307, 147) Me.ribbonNodeNavigation.Size = New System.Drawing.Size(1307, 158)
Me.ribbonNodeNavigation.StatusBar = Me.RibbonStatusBar1 Me.ribbonNodeNavigation.StatusBar = Me.RibbonStatusBar1
Me.ribbonNodeNavigation.Toolbar.ShowCustomizeItem = False Me.ribbonNodeNavigation.Toolbar.ShowCustomizeItem = False
' '
@@ -271,10 +271,10 @@ Partial Class frmNodeNavigation
Me.RibbonStatusBar1.ItemLinks.Add(Me.bsitmRecordID) Me.RibbonStatusBar1.ItemLinks.Add(Me.bsitmRecordID)
Me.RibbonStatusBar1.ItemLinks.Add(Me.BarStaticItemLocked) Me.RibbonStatusBar1.ItemLinks.Add(Me.BarStaticItemLocked)
Me.RibbonStatusBar1.ItemLinks.Add(Me.bsitmtInfoDoc) Me.RibbonStatusBar1.ItemLinks.Add(Me.bsitmtInfoDoc)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 821) Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 822)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.ribbonNodeNavigation Me.RibbonStatusBar1.Ribbon = Me.ribbonNodeNavigation
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1307, 23) Me.RibbonStatusBar1.Size = New System.Drawing.Size(1307, 22)
' '
'RibbonPage2 'RibbonPage2
' '
@@ -284,7 +284,7 @@ Partial Class frmNodeNavigation
'SplitContainerMain 'SplitContainerMain
' '
Me.SplitContainerMain.Dock = System.Windows.Forms.DockStyle.Fill Me.SplitContainerMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerMain.Location = New System.Drawing.Point(0, 147) Me.SplitContainerMain.Location = New System.Drawing.Point(0, 158)
Me.SplitContainerMain.Name = "SplitContainerMain" Me.SplitContainerMain.Name = "SplitContainerMain"
' '
'SplitContainerMain.Panel1 'SplitContainerMain.Panel1
@@ -296,7 +296,7 @@ Partial Class frmNodeNavigation
' '
Me.SplitContainerMain.Panel2.Controls.Add(Me.SplitContainer1) Me.SplitContainerMain.Panel2.Controls.Add(Me.SplitContainer1)
Me.SplitContainerMain.Panel2.Text = "Panel2" Me.SplitContainerMain.Panel2.Text = "Panel2"
Me.SplitContainerMain.Size = New System.Drawing.Size(1307, 674) Me.SplitContainerMain.Size = New System.Drawing.Size(1307, 664)
Me.SplitContainerMain.SplitterPosition = 451 Me.SplitContainerMain.SplitterPosition = 451
Me.SplitContainerMain.TabIndex = 2 Me.SplitContainerMain.TabIndex = 2
' '
@@ -332,7 +332,7 @@ Partial Class frmNodeNavigation
Me.TreeListDevexpress.OptionsView.ShowTreeLines = DevExpress.Utils.DefaultBoolean.[False] Me.TreeListDevexpress.OptionsView.ShowTreeLines = DevExpress.Utils.DefaultBoolean.[False]
Me.TreeListDevexpress.OptionsView.ShowVertLines = False Me.TreeListDevexpress.OptionsView.ShowVertLines = False
Me.TreeListDevexpress.OptionsView.TreeLineStyle = DevExpress.XtraTreeList.LineStyle.Dark Me.TreeListDevexpress.OptionsView.TreeLineStyle = DevExpress.XtraTreeList.LineStyle.Dark
Me.TreeListDevexpress.Size = New System.Drawing.Size(451, 674) Me.TreeListDevexpress.Size = New System.Drawing.Size(451, 664)
Me.TreeListDevexpress.StateImageList = Me.ImageCollection1 Me.TreeListDevexpress.StateImageList = Me.ImageCollection1
Me.TreeListDevexpress.TabIndex = 1 Me.TreeListDevexpress.TabIndex = 1
' '
@@ -355,8 +355,8 @@ Partial Class frmNodeNavigation
'SplitContainer1.Panel2 'SplitContainer1.Panel2
' '
Me.SplitContainer1.Panel2.Controls.Add(Me.GridControlDocSearch) Me.SplitContainer1.Panel2.Controls.Add(Me.GridControlDocSearch)
Me.SplitContainer1.Size = New System.Drawing.Size(844, 674) Me.SplitContainer1.Size = New System.Drawing.Size(846, 664)
Me.SplitContainer1.SplitterDistance = 219 Me.SplitContainer1.SplitterDistance = 215
Me.SplitContainer1.TabIndex = 0 Me.SplitContainer1.TabIndex = 0
' '
'pnlControls 'pnlControls
@@ -366,7 +366,7 @@ Partial Class frmNodeNavigation
Me.pnlControls.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlControls.Dock = System.Windows.Forms.DockStyle.Fill
Me.pnlControls.Location = New System.Drawing.Point(0, 0) Me.pnlControls.Location = New System.Drawing.Point(0, 0)
Me.pnlControls.Name = "pnlControls" Me.pnlControls.Name = "pnlControls"
Me.pnlControls.Size = New System.Drawing.Size(844, 219) Me.pnlControls.Size = New System.Drawing.Size(846, 215)
Me.pnlControls.TabIndex = 0 Me.pnlControls.TabIndex = 0
' '
'GridControlDocSearch 'GridControlDocSearch
@@ -374,12 +374,12 @@ Partial Class frmNodeNavigation
Me.GridControlDocSearch.AllowDrop = True Me.GridControlDocSearch.AllowDrop = True
Me.GridControlDocSearch.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center Me.GridControlDocSearch.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center
Me.GridControlDocSearch.Dock = System.Windows.Forms.DockStyle.Fill Me.GridControlDocSearch.Dock = System.Windows.Forms.DockStyle.Fill
GridLevelNode2.RelationName = "Level1" GridLevelNode1.RelationName = "Level1"
Me.GridControlDocSearch.LevelTree.Nodes.AddRange(New DevExpress.XtraGrid.GridLevelNode() {GridLevelNode2}) Me.GridControlDocSearch.LevelTree.Nodes.AddRange(New DevExpress.XtraGrid.GridLevelNode() {GridLevelNode1})
Me.GridControlDocSearch.Location = New System.Drawing.Point(0, 0) Me.GridControlDocSearch.Location = New System.Drawing.Point(0, 0)
Me.GridControlDocSearch.MainView = Me.GridViewDoc_Search Me.GridControlDocSearch.MainView = Me.GridViewDoc_Search
Me.GridControlDocSearch.Name = "GridControlDocSearch" Me.GridControlDocSearch.Name = "GridControlDocSearch"
Me.GridControlDocSearch.Size = New System.Drawing.Size(844, 451) Me.GridControlDocSearch.Size = New System.Drawing.Size(846, 445)
Me.GridControlDocSearch.TabIndex = 8 Me.GridControlDocSearch.TabIndex = 8
Me.GridControlDocSearch.TabStop = False Me.GridControlDocSearch.TabStop = False
Me.GridControlDocSearch.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewDoc_Search}) Me.GridControlDocSearch.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewDoc_Search})
@@ -393,13 +393,15 @@ Partial Class frmNodeNavigation
Me.GridViewDoc_Search.GridControl = Me.GridControlDocSearch Me.GridViewDoc_Search.GridControl = Me.GridControlDocSearch
Me.GridViewDoc_Search.LevelIndent = 10 Me.GridViewDoc_Search.LevelIndent = 10
Me.GridViewDoc_Search.Name = "GridViewDoc_Search" Me.GridViewDoc_Search.Name = "GridViewDoc_Search"
Me.GridViewDoc_Search.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.MouseDown
Me.GridViewDoc_Search.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.[False] Me.GridViewDoc_Search.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.[False]
Me.GridViewDoc_Search.OptionsDetail.ShowDetailTabs = False Me.GridViewDoc_Search.OptionsDetail.ShowDetailTabs = False
Me.GridViewDoc_Search.OptionsSelection.EnableAppearanceFocusedCell = False Me.GridViewDoc_Search.OptionsSelection.EnableAppearanceFocusedCell = False
Me.GridViewDoc_Search.OptionsSelection.EnableAppearanceFocusedRow = False Me.GridViewDoc_Search.OptionsSelection.EnableAppearanceFocusedRow = False
Me.GridViewDoc_Search.OptionsSelection.EnableAppearanceHideSelection = False Me.GridViewDoc_Search.OptionsSelection.EnableAppearanceHideSelection = False
Me.GridViewDoc_Search.OptionsSelection.MultiSelect = True Me.GridViewDoc_Search.OptionsSelection.MultiSelect = True
Me.GridViewDoc_Search.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect Me.GridViewDoc_Search.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect
Me.GridViewDoc_Search.OptionsSelection.ResetSelectionClickOutsideCheckboxSelector = True
Me.GridViewDoc_Search.OptionsView.ColumnAutoWidth = False Me.GridViewDoc_Search.OptionsView.ColumnAutoWidth = False
Me.GridViewDoc_Search.OptionsView.EnableAppearanceEvenRow = True Me.GridViewDoc_Search.OptionsView.EnableAppearanceEvenRow = True
Me.GridViewDoc_Search.OptionsView.ShowAutoFilterRow = True Me.GridViewDoc_Search.OptionsView.ShowAutoFilterRow = True

View File

@@ -429,9 +429,6 @@
<metadata name="ImageCollection1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="ImageCollection1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="ImageCollection1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="DevExpress.Utils.v21.2" name="DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <assembly alias="DevExpress.Utils.v21.2" name="DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<data name="ImageCollection1.ImageStream" type="DevExpress.Utils.ImageCollectionStreamer, DevExpress.Utils.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ImageCollection1.ImageStream" type="DevExpress.Utils.ImageCollectionStreamer, DevExpress.Utils.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@@ -14,28 +14,9 @@ Imports System.IO
Imports System.Runtime.InteropServices Imports System.Runtime.InteropServices
Imports DD_LIB_Standards Imports DD_LIB_Standards
Imports DigitalData.Modules.Base Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Public Class frmNodeNavigation 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" #Region "Laufzeitvariablen & Konstanten"
Dim DT_STRUCTURE_NODES As DataTable Dim DT_STRUCTURE_NODES As DataTable
Dim DT_ADDING_USERS As DataTable Dim DT_ADDING_USERS As DataTable
@@ -60,6 +41,8 @@ Public Class frmNodeNavigation
Delete Delete
End Enum End Enum
Private WindowsEx As WindowsEx
Private DT_CONTROLS_ENTITY As DataTable Private DT_CONTROLS_ENTITY As DataTable
Private DT_COLUMNS_GRID_ENTITY As DataTable Private DT_COLUMNS_GRID_ENTITY As DataTable
Private DT_DOCRESULT_DROPDOWN_ITEMS As DataTable Private DT_DOCRESULT_DROPDOWN_ITEMS As DataTable
@@ -94,121 +77,26 @@ Public Class frmNodeNavigation
Public Const SW_SHOW As Short = 5 Public Const SW_SHOW As Short = 5
Private CONTROL_DOCTYPE_MATCH As Integer = 0 Private CONTROL_DOCTYPE_MATCH As Integer = 0
Private FocusedNode As TreeListNode Private FocusedNode As TreeListNode
Private MyTreeListViewState As TreeListViewState Private MyTreeListViewState As ClassTreeListViewState
#End Region #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() Private DocList As ClassWindreamDocGrid
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
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) Public Sub New(pEntityID As Int16, pConstructID As Int16)
' Dieser Aufruf ist für den Designer erforderlich. ' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent() InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
oEntityID = pEntityID oEntityID = pEntityID
oConstructID = pConstructID oConstructID = pConstructID
DocList = New ClassWindreamDocGrid(GridViewDoc_Search)
WindowsEx = New WindowsEx(LOGCONFIG)
End Sub End Sub
Private Function Get_Splitter_Layout_Filename() Private Function Get_Splitter_Layout_Filename()
Dim Filename As String = String.Format("{0}-{1}-SplitterLayout.xml", CONSTRUCTOR_DETAIL_ID, CONSTRUCTOR_DETAIL_ID.ToString) 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 End Function
Sub Save_Splitter_Layout() Sub Save_Splitter_Layout()
Try Try
@@ -294,9 +182,10 @@ Public Class frmNodeNavigation
Catch ex As System.Exception Catch ex As System.Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", ex.Message, "Error in Loading Form part 4") ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", ex.Message, "Error in Loading Form part 4")
End Try End Try
Load_nodes() Load_nodes()
End Sub End Sub
Async Function Load_nodes() As Threading.Tasks.Task Private Sub Load_nodes()
Dim oHandle = SplashScreenManager.ShowOverlayForm(Me) Dim oHandle = SplashScreenManager.ShowOverlayForm(Me)
Try Try
@@ -345,12 +234,13 @@ Public Class frmNodeNavigation
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex)
Finally Finally
SplashScreenManager.CloseOverlayForm(oHandle) SplashScreenManager.CloseOverlayForm(oHandle)
End Try End Try
End Function End Sub
Private Sub TreeListDevexpress_ColumnFilterChanged(sender As Object, e As EventArgs) Private Sub TreeListDevexpress_ColumnFilterChanged(sender As Object, e As EventArgs)
Dim tree As TreeList = TryCast(sender, TreeList) 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() 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() Save_DocGrid_Layout()
End Sub End Sub
Private Sub GridViewDoc_Search_FocusedColumnChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs) Handles GridViewDoc_Search.FocusedColumnChanged 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() Refresh_DocID()
End Sub End Sub
Private Sub GridViewDoc_Search_FocusedRowChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs) Handles GridViewDoc_Search.FocusedRowChanged 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() Refresh_DocID()
End Sub End Sub
@@ -2266,52 +2153,58 @@ Public Class frmNodeNavigation
End If End If
Me.Cursor = Cursors.WaitCursor Me.Cursor = Cursors.WaitCursor
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search) Dim oSelectedDocs = ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
'Refresh_DocID()
If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
e.Cancel = True e.Cancel = True
End If End If
Refresh_DocID()
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then If oSelectedDocs.First.DocId = 0 Then
If ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DOC_ID") = 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 e.Cancel = True
End If End If
End If If ROW_READ_ONLY = False Then
File_in_Work() If RIGHT_READ_ONLY_DOC = True Then
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 USER_IS_ADMIN = False Then If USER_IS_ADMIN = False Then
ContextMenu_Read() ContextMenu_Read()
Else 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 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 End If
End If
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then If oSelectedDocs.First.DisplayName <> "" Then
If ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME") <> "" Then
tsmiFileRenameDisplayname.Visible = True tsmiFileRenameDisplayname.Visible = True
Else Else
tsmiFileRenameDisplayname.Visible = False tsmiFileRenameDisplayname.Visible = False
@@ -2328,36 +2221,70 @@ Public Class frmNodeNavigation
End Try End Try
End Sub End Sub
Sub ContextMenu_Multiplefiles()
tsmiFileProperties.Enabled = False
Sub ContextMenu_Read() tsmiFileOpen.Enabled = False
tsmiFileOpen.Enabled = True tsmiFileFolderOpen.Enabled = False
tsmiFileInWork.Enabled = False
tsmiFileLink_Add.Enabled = True
tsmiFileLink_ShowAll.Enabled = True
tsmiFileLinkRemove.Enabled = True
tsmiFileRename.Enabled = False tsmiFileRename.Enabled = False
tsmiFileInWork.Enabled = False tsmiFileVersion.Enabled = False
tsmiFileLink_Add.Enabled = False tsmiFileRightsShow.Enabled = False
tsmiFileLink_ShowAll.Enabled = True
tsmiFileDelete.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 tsmiFileLinkRemove.Enabled = False
tsmiFileRename.Enabled = False
tsmiFileVersion.Enabled = True
tsmiFileRightsShow.Enabled = True
tsmiFileDelete.Enabled = False
End Sub End Sub
Sub ContextMenu_Write() Sub ContextMenu_Write()
tsmiFileOpen.Enabled = True tsmiFileProperties.Enabled = True
tsmiFileOpen.Enabled = True
tsmiFileFolderOpen.Enabled = True
tsmiFileRename.Enabled = True
tsmiFileInWork.Enabled = True tsmiFileInWork.Enabled = True
tsmiFileLink_Add.Enabled = True tsmiFileLink_Add.Enabled = True
tsmiFileLink_ShowAll.Enabled = True tsmiFileLink_ShowAll.Enabled = True
tsmiFileDelete.Enabled = True
tsmiFileLinkRemove.Enabled = True tsmiFileLinkRemove.Enabled = True
tsmiFileRename.Enabled = True
tsmiFileVersion.Enabled = True
tsmiFileRightsShow.Enabled = True
tsmiFileDelete.Enabled = True
End Sub End Sub
Sub Open_File() Sub Open_File()
Me.Cursor = Cursors.WaitCursor Me.Cursor = Cursors.WaitCursor
Dim allow_Open As Boolean = False 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) Dim Result = ClassDOC_SEARCH.Get_File_Rights(ClassWindreamDocGrid.SELECTED_DOC_ID)
If Not IsNothing(Result) Then If Not IsNothing(Result) Then
Select Case Result.ToString Select Case Result.ToString
Case "R" Case "R"
@@ -2369,16 +2296,23 @@ Public Class frmNodeNavigation
End Select End Select
End If End If
If allow_Open = True Then 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) MsgBox("Could not read File Parameters(5)!", MsgBoxStyle.Exclamation)
Exit Sub Exit Sub
End If End If
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows 'For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
If ClassHelper.File_open(row.Item("DOC_PATH"), row.Item("DOC_ID")) = True Then ' 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 TimerFileHandle.Enabled = True
End If End If
Next Next
Else Else
If clsWD_GET.WDFile_exists(ClassWindreamDocGrid.SELECTED_DOC_PATH, DD_LIB_Standards.clsDatabase.DB_PROXY_INITIALIZED, ClassProxy.MyLinkedServer, True) = True Then 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 End Sub
Private Sub tsmiFileInWork_Click(sender As Object, e As EventArgs) Handles tsmiFileInWork.Click 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) MsgBox("Could not read File Parameters (3)!", MsgBoxStyle.Exclamation)
Exit Sub Exit Sub
End If End If
@@ -2482,15 +2416,30 @@ Public Class frmNodeNavigation
Private Sub tsmiFileRenameDisplayname_Click(sender As Object, e As EventArgs) Handles tsmiFileRenameDisplayname.Click Private Sub tsmiFileRenameDisplayname_Click(sender As Object, e As EventArgs) Handles tsmiFileRenameDisplayname.Click
Try Try
If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
If ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME") <> "" Then Exit Sub
Dim oRowHandle As Integer = GridViewDoc_Search.FocusedRowHandle End If
Dim frm As New frmFileRename(1, ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME"), "Displayname")
frm.ShowDialog() 'If ClassWindreamDocGrid.DT_RESULTFILES.Rows.Count = 1 Then
RUN_WDSEARCH_GRID(True) ' If ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME") <> "" Then
If Not IsNothing(oRowHandle) Then ' Dim oRowHandle As Integer = GridViewDoc_Search.FocusedRowHandle
GridViewDoc_Search.FocusedRowHandle = oRowHandle ' Dim frm As New frmFileRename(1, ClassWindreamDocGrid.DT_RESULTFILES.Rows(0).Item("DISPLAYNAME"), "Displayname")
End If ' 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
End If End If
Catch ex As Exception Catch ex As Exception
@@ -2507,7 +2456,11 @@ Public Class frmNodeNavigation
LOGGER.Warn("Attention: Could not set DocVariable RENAME_DOC_PATH: " & ex.Message) LOGGER.Warn("Attention: Could not set DocVariable RENAME_DOC_PATH: " & ex.Message)
RENAME_DOC_PATH = Nothing RENAME_DOC_PATH = Nothing
End Try 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) MsgBox("Could not read File Parameters!", MsgBoxStyle.Exclamation)
Exit Sub Exit Sub
End If End If
@@ -2539,32 +2492,49 @@ Public Class frmNodeNavigation
End Sub End Sub
Private Sub tsmiFileFolderOpen_Click(sender As Object, e As EventArgs) Handles tsmiFileFolderOpen.Click 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) MsgBox("Could not read File Parameters(5)!", MsgBoxStyle.Exclamation)
Exit Sub Exit Sub
End If End If
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows 'For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows
ClassHelper.Open_Folder(row.Item("DOC_PATH"), row.Item("DOC_ID")) ' 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 Next
End Sub End Sub
Private Sub tsmiFileLink_Add_Click(sender As Object, e As EventArgs) Handles tsmiFileLink_Add.Click Private Sub tsmiFileLink_Add_Click(sender As Object, e As EventArgs) Handles tsmiFileLink_Add.Click
Try Try
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search) 'ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then '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) MsgBox("Could not read File Parameters (LinkRecord)!", MsgBoxStyle.Exclamation)
Exit Sub Exit Sub
End If End If
Refresh_Selected_Table() 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 Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in Linking Record: " & ex.Message, MsgBoxStyle.Critical) MsgBox("Unexpected Error in Linking Record: " & ex.Message, MsgBoxStyle.Critical)
End Try End Try
End Sub End Sub
Sub Refresh_Selected_Table() Sub Refresh_Selected_Table()
Dim table As New DataTable Dim table As New DataTable With {
table.TableName = "SelectedFiles" .TableName = "SelectedFiles"
}
' Create two columns, ID and Name. ' Create two columns, ID and Name.
Dim idColumn As DataColumn = table.Columns.Add("ID", GetType(System.Int32)) 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("FILEPATH", GetType(System.String))
table.Columns.Add("DOC_ID", GetType(System.Int32)) table.Columns.Add("DOC_ID", GetType(System.Int32))
table.Columns.Add("OBJECTTYPE", GetType(System.String)) table.Columns.Add("OBJECTTYPE", GetType(System.String))
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows For Each oDoc As ClassWindreamDocGrid.WindreamDoc In ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
If row.Item("DOC_PATH") <> String.Empty Then If oDoc.DocPath <> String.Empty Then
'Set the ID column as the primary key column. 'Set the ID column as the primary key column.
Dim newRow As DataRow = table.NewRow() Dim newRow As DataRow = table.NewRow()
newRow("FILEPATH") = row.Item("DOC_PATH") newRow("FILEPATH") = oDoc.DocPath
newRow("DOC_ID") = row.Item("DOC_ID") newRow("DOC_ID") = oDoc.DocId
newRow("OBJECTTYPE") = row.Item("OBJECTTYPE") newRow("OBJECTTYPE") = oDoc.DocType
table.Rows.Add(newRow) table.Rows.Add(newRow)
End If End If
Next Next
@@ -2598,9 +2568,10 @@ Public Class frmNodeNavigation
End If End If
CURRENT_DOC_ID = GridViewDoc_Search.GetRowCellValue(GridViewDoc_Search.FocusedRowHandle, "DocID") CURRENT_DOC_ID = GridViewDoc_Search.GetRowCellValue(GridViewDoc_Search.FocusedRowHandle, "DocID")
Dim frm As New frmDoc_Links Dim oDocuments = DocList.SelectedDocuments
frm.Show() Dim oForm As New frmDoc_Links With {.Documents = oDocuments}
frm.BringToFront() oForm.Show()
oForm.BringToFront()
Catch ex As Exception Catch ex As Exception
MsgBox("Unexpected Error in Showing DocLinks: " & ex.Message, MsgBoxStyle.Critical) MsgBox("Unexpected Error in Showing DocLinks: " & ex.Message, MsgBoxStyle.Critical)
End Try End Try
@@ -2611,32 +2582,31 @@ Public Class frmNodeNavigation
ClassHelper.MSGBOX_Handler("INFO", "Attention", "Missing Selection:", "Please select a record!") ClassHelper.MSGBOX_Handler("INFO", "Attention", "Missing Selection:", "Please select a record!")
Exit Sub Exit Sub
End If End If
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then If ClassWindreamDocGrid.HasNoSelectedDocuments(GridViewDoc_Search) Then
Exit Sub Exit Sub
End If 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!" 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 If USER_LANGUAGE <> "de-DE" Then
msg = "Would You like to delete only the references?" & vbNewLine & "File(s) will stay in ECM/Archive/Explorer!" msg = "Would You like to delete only the references?" & vbNewLine & "File(s) will stay in ECM/Archive/Explorer!"
End If End If
Dim result As MsgBoxResult Dim result As MsgBoxResult
result = MessageBox.Show(msg, CAPTION_CONFIRMATION, MessageBoxButtons.YesNo, MessageBoxIcon.Question) result = MessageBox.Show(msg, CAPTION_CONFIRMATION, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = MsgBoxResult.Yes Then If result = MsgBoxResult.Yes Then
Try Try
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows For Each oDoc As ClassWindreamDocGrid.WindreamDoc In ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
If ClassFileResult.Delete_ResultFile(row.Item("DOC_ID"), CURRENT_RECORD_ID, 0) = True Then If ClassFileResult.Delete_ResultFile(oDoc.DocId, CURRENT_RECORD_ID, 0) = True Then
ClassHelper.InsertEssential_Log(row.Item("DOC_ID"), "DOC-ID", "RECORD LINK REMOVED FROM DOC-SEARCH") ClassHelper.InsertEssential_Log(oDoc.DocId, "DOC-ID", "RECORD LINK REMOVED FROM DOC-SEARCH")
Cursor = Cursors.WaitCursor Cursor = Cursors.WaitCursor
RUN_WDSEARCH_GRID(True) RUN_WDSEARCH_GRID(True)
End If End If
Next Next
Catch ex As Exception Catch ex As Exception
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Removing links from file:", ex.Message) ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Removing links from file:", ex.Message)
End Try End Try
End If
End If End If
End Sub End Sub
@@ -2665,27 +2635,25 @@ Public Class frmNodeNavigation
Show_File_Properties() Show_File_Properties()
End Sub End Sub
Sub Show_File_Properties() 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) MsgBox("Could not read File Parameters(4)!", MsgBoxStyle.Exclamation)
Exit Sub Exit Sub
End If End If
For Each row As DataRow In ClassWindreamDocGrid.DT_RESULTFILES.Rows Cursor = Cursors.WaitCursor
If row.Item("DOC_PATH") <> "" Then For Each oDoc As ClassWindreamDocGrid.WindreamDoc In ClassWindreamDocGrid.GetSelectedDocuments(GridViewDoc_Search)
Dim oFileFullPath = ClassHelper.FORMAT_WM_PATH(row.Item("DOC_PATH")) If oDoc.DocPath <> "" Then
Cursor = Cursors.WaitCursor Dim oFileFullPath = ClassHelper.FORMAT_WM_PATH(oDoc.DocPath)
Dim sei As New SHELLEXECUTEINFO Try
sei.cbSize = Marshal.SizeOf(sei) If Not WindowsEx.OpenFileProperties(oFileFullPath) Then
sei.lpVerb = "properties" Dim ex As New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error())
sei.lpFile = oFileFullPath ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Open file propertys:", ex.Message)
sei.nShow = SW_SHOW End If
sei.fMask = SEE_MASK_INVOKEIDLIST Catch ex As Exception
If Not ShellExecuteEx(sei) Then LOGGER.Error(ex)
Dim ex As New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error()) End Try
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Open file propertys:", ex.Message)
End If
End If End If
Cursor = Cursors.Default
Next Next
Cursor = Cursors.Default
End Sub End Sub
Private Sub EigenschaftenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EigenschaftenToolStripMenuItem.Click Private Sub EigenschaftenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EigenschaftenToolStripMenuItem.Click
@@ -2710,7 +2678,7 @@ Public Class frmNodeNavigation
End Sub End Sub
Private Sub UnterknotenNeuOrdnenToolStripMenuItem_Click(sender As Object, e As EventArgs) 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!" 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 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!" 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 'End Sub
Private Sub GridViewDoc_Search_RowStyle(sender As Object, e As RowStyleEventArgs) Handles GridViewDoc_Search.RowStyle Private Sub GridViewDoc_Search_RowStyle(sender As Object, e As RowStyleEventArgs) Handles GridViewDoc_Search.RowStyle
If e.RowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle Then 'TODO: Refactor RowStyle maybe
e.Appearance.BackColor = Color.Yellow 'If e.RowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle Then
Else ' e.Appearance.BackColor = Color.Yellow
If e.RowHandle = -1 Then 'Else
Exit Sub ' If e.RowHandle = -1 Then
End If ' Exit Sub
Try ' End If
Dim rowCellValue = GridViewDoc_Search.GetRowCellValue(e.RowHandle, "in work?") ' Try
If Not IsNothing(rowCellValue) Then ' Dim rowCellValue = GridViewDoc_Search.GetRowCellValue(e.RowHandle, "in work?")
Dim inwork = rowCellValue ' If Not IsNothing(rowCellValue) Then
If inwork = True Then ' Dim inwork = rowCellValue
e.Appearance.BackColor = Color.Orchid ' If inwork = True Then
e.HighPriority = True ' e.Appearance.BackColor = Color.Orchid
End If ' e.HighPriority = True
End If ' End If
Catch ex As Exception ' End If
LOGGER.Warn("Unexpected Error in Checking Value In Work: " & ex.Message) ' Catch ex As Exception
End Try ' LOGGER.Warn("Unexpected Error in Checking Value In Work: " & ex.Message)
' End Try
Try ' Try
Dim DROPDOWN_VALUE ' Dim DROPDOWN_VALUE
If Not IsNothing(DT_DOCRESULT_DROPDOWN_ITEMS) Then ' If Not IsNothing(DT_DOCRESULT_DROPDOWN_ITEMS) Then
'Den ColumnTitle aus ConfigTableholen ' 'Den ColumnTitle aus ConfigTableholen
If DT_DOCRESULT_DROPDOWN_ITEMS.Rows.Count > 0 Then ' If DT_DOCRESULT_DROPDOWN_ITEMS.Rows.Count > 0 Then
For Each confrow As DataRow In DT_DOCRESULT_DROPDOWN_ITEMS.Rows ' For Each confrow As DataRow In DT_DOCRESULT_DROPDOWN_ITEMS.Rows
Dim CAPTION = confrow.Item("HEADER_CAPTION") ' Dim CAPTION = confrow.Item("HEADER_CAPTION")
DROPDOWN_VALUE = GridViewDoc_Search.GetRowCellValue(e.RowHandle, CAPTION) ' DROPDOWN_VALUE = GridViewDoc_Search.GetRowCellValue(e.RowHandle, CAPTION)
If Not IsNothing(DROPDOWN_VALUE) Then ' If Not IsNothing(DROPDOWN_VALUE) Then
Exit For ' Exit For
End If ' End If
Next ' Next
If Not IsNothing(DROPDOWN_VALUE) Then ' If Not IsNothing(DROPDOWN_VALUE) Then
Dim ColorRow As Color ' Dim ColorRow As Color
Dim expression As String = String.Format("VALUE = '{0}'", DROPDOWN_VALUE) ' Dim expression As String = String.Format("VALUE = '{0}'", DROPDOWN_VALUE)
Dim matchingRows() As DataRow = DT_DOCRESULT_DROPDOWN_ITEMS.Select(expression, "SEQUENCE") ' Dim matchingRows() As DataRow = DT_DOCRESULT_DROPDOWN_ITEMS.Select(expression, "SEQUENCE")
Dim rowcolorname As String = "" ' Dim rowcolorname As String = ""
'Die Color für den value auswählen ' 'Die Color für den value auswählen
For Each matchingRow As DataRow In matchingRows ' For Each matchingRow As DataRow In matchingRows
rowcolorname = "" ' rowcolorname = ""
If Not IsDBNull(matchingRow.Item("COLOR")) Then ' If Not IsDBNull(matchingRow.Item("COLOR")) Then
rowcolorname = matchingRow.Item("COLOR") ' rowcolorname = matchingRow.Item("COLOR")
End If ' End If
If rowcolorname <> "" Then ' If rowcolorname <> "" Then
Exit For ' Exit For
End If ' End If
Next ' Next
If rowcolorname <> "" Then ' If rowcolorname <> "" Then
ColorRow = Color.FromName(rowcolorname) ' ColorRow = Color.FromName(rowcolorname)
e.Appearance.BackColor = ColorRow ' e.Appearance.BackColor = ColorRow
e.HighPriority = True ' e.HighPriority = True
End If ' 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 ' End If
Catch ex As Exception ' Catch ex As Exception
LOGGER.Warn("Unexpected Error in RowStyle-Color Dropdown: " & ex.Message) ' LOGGER.Warn("Unexpected Error in RowStyle-Color Dropdown: " & ex.Message)
End Try ' End Try
End If 'End If
End Sub End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BbtnitmNodeReorder.ItemClick 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!" 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 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!" 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 Private Sub bbtnitmRecSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtnitmRecSave.ItemClick
Save_Record() Save_Record()
End Sub 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 End Class