MS Diverses Customizing

This commit is contained in:
Developer01
2024-07-31 11:10:21 +02:00
parent 2039b614c1
commit c15a0ee5a0
36 changed files with 1140 additions and 1612 deletions

View File

@@ -28,7 +28,7 @@ Public Class frmNodeNavigation
Private Property CONSTRUCTOR_DETAIL_ID As Short
Private Property _RowReadOnly As Boolean = False
Private Property ADD_RECORDS_CONSTR As Boolean = True
Private Property TV_Collapse_ExpandState = "Collapse"
Private Property TV_Collapse_ExpandState As String = "Collapse"
Private Property WindowsEx As WindowsEx
@@ -296,9 +296,14 @@ Public Class frmNodeNavigation
End Class
Private Async Sub TreeListDevexpress_FocusedNodeChanged(sender As Object, e As FocusedNodeChangedEventArgs) Handles TreeListDevexpress.FocusedNodeChanged
If FORM_SHOWN = False Then
Exit Sub
End If
FocusedNode = Nothing
If btnCreateNewNode.Visibility = DevExpress.XtraBars.BarItemVisibility.Always Then
btnCreateNewNode.Enabled = False
End If
btnCreateNewNode.Enabled = False
If RIGHT_RECORD_AND_FILE_READ_ONLY = True Then
Exit Sub
@@ -353,18 +358,23 @@ Public Class frmNodeNavigation
CurrentNodeConfigId = oNodeConfigId
AvailableConfigNodes.Clear()
Dim oNodeConfigList = NODE_CONFIGURABLE_NODES_DT.Select($"PARENT_NODE = {oNodeConfigId}").
Cast(Of DataRow).
Select(Function(row) New frmNewNode.NodeConfig() With {
.Id = row.Item("GUID"),
.Name = row.Item("NAME")
}).ToList()
AvailableConfigNodes = oNodeConfigList
If btnCreateNewNode.Visibility = DevExpress.XtraBars.BarItemVisibility.Always Then
Dim oNodeConfigList = NODE_CONFIGURABLE_NODES_DT.Select($"PARENT_NODE = {oNodeConfigId}").
Cast(Of DataRow).
Select(Function(row) New frmNewNode.NodeConfig() With {
.Id = row.Item("GUID"),
.Name = row.Item("NAME")
}).ToList()
AvailableConfigNodes = oNodeConfigList
If AvailableConfigNodes.Count > 0 Then
btnCreateNewNode.Enabled = True
If AvailableConfigNodes.Count > 0 Then
btnCreateNewNode.Enabled = True
Else
btnCreateNewNode.Enabled = False
End If
End If
' END NEW NODE
If oHasRecordId Then
@@ -405,7 +415,7 @@ Public Class frmNodeNavigation
Else
bbtnitmRecEdit.Enabled = True
In_Visible_Record_Group(True)
btnCreateNewNode.Enabled = True
' btnCreateNewNode.Enabled = True
End If
If RIGHT_READ_ONLY_DOC = False Then
@@ -558,8 +568,14 @@ Public Class frmNodeNavigation
End Sub
Private Sub Load_Configurable_Nodes()
Try
btnCreateNewNode.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
Dim oSql = String.Format("SELECT * FROM TBPMO_STRUCTURE_NODES_CONFIGURATION where TYPE_NODE = 1000 AND ENTITY_ID IN (SELECT FORM_ID FROM VWPMO_CONSTRUCTOR_FORMS WHERE CONSTRUCT_ID = {0})", oConstructID)
NODE_CONFIGURABLE_NODES_DT = MYDB_ECM.GetDatatable(oSql)
If Not IsNothing(NODE_CONFIGURABLE_NODES_DT) Then
If NODE_CONFIGURABLE_NODES_DT.Rows.Count > 0 Then
btnCreateNewNode.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Error(ex)
@@ -585,11 +601,6 @@ Public Class frmNodeNavigation
Dim sw As New SW("Load_Datafor_Entity")
'If NODE_NAVIGATION = True Then
' ENTITY_ID = ClassNodeNavigation.Return_ENTITY_FOR_TAG(SelectedNode.Tag)
' CURRENT_ENTITY_ID = ENTITY_ID
'End If
Dim result = (From form In DT_VWPMO_CONSTRUCTOR_FORMS.AsEnumerable()
Select form
Where form.Item("FORM_ID") = _EntityId).Single()
@@ -1076,6 +1087,20 @@ Public Class frmNodeNavigation
TreeListDevexpress.FocusedNode = FocusedNode
TreeListDevexpress.MakeNodeVisible(FocusedNode)
End If
If SQL_OF_NODE_SEARCH <> String.Empty Then
Dim oSQL_SEARCH As String = SQL_OF_NODE_SEARCH
oSQL_SEARCH = oSQL_SEARCH.Replace("@ENTITY_ID", CURRENT_ENTITY_ID)
oSQL_SEARCH = oSQL_SEARCH.Replace("@VALUE", oFilterText)
Dim oDT As DataTable = MYDB_ECM.GetDatatable(oSQL_SEARCH)
If Not IsNothing(oDT) Then
If oDT.Rows.Count > 1 Then
ElseIf oDT.Rows.Count = 1 Then
Dim oResult As String
oResult = oDT.Rows(0).Item(0)
End If
End If
End If
LastFindFilterText = oFilterText
End Sub
@@ -2536,39 +2561,30 @@ Public Class frmNodeNavigation
Private Sub frmNodeNavigation_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Dim sw As New SW("Form_Shown")
Me.BringToFront()
' LoadLayouts()
TreeListDevexpress.CollapseAll()
sw.Done()
FORM_SHOWN = True
End Sub
Private Async Sub tsmiFileRenameDisplayname_Click(sender As Object, e As EventArgs) Handles tsmiFileRenameDisplayname.Click
Try
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()
Await RUN_WDSEARCH_GRID(True)
If Not IsNothing(oRowHandle) Then
GridViewDoc_Search.FocusedRowHandle = oRowHandle
Dim oDocuments = Current_DocList.SelectedDocuments
If oDocuments.Count = 1 Then
ClassFileResult.DocID = oDocuments.First.DocId
ClassFileResult.OldDisplayName = oDocuments.First.DisplayName
If oDocuments.First.DisplayName <> "" Then
Dim oRowHandle As Integer = GridViewDoc_Search.FocusedRowHandle
Dim frm As New frmFileRename(ClassFileResult.DocID, oDocuments.First.DisplayName, "Displayname")
frm.ShowDialog()
Await RUN_WDSEARCH_GRID(True)
If Not IsNothing(oRowHandle) Then
GridViewDoc_Search.FocusedRowHandle = oRowHandle
End If
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Unexpected Error in getting the Displayname: ", ex.Message)
@@ -2585,19 +2601,23 @@ 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
' 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
Dim oDocuments = Current_DocList.SelectedDocuments
If oDocuments.Count = 1 Then
ClassFileResult.DocID = oDocuments.First.DocId
End If
If RENAME_DOC_PATH <> "" Then
Dim FileToRename As String
FileToRename = Path.GetFileNameWithoutExtension(RENAME_DOC_PATH)
Dim oRowHandle As Integer = GridViewDoc_Search.FocusedRowHandle
Dim frm As New frmFileRename(1, FileToRename, "Filename")
Dim frm As New frmFileRename(ClassFileResult.DocID, FileToRename, "Filename")
frm.ShowDialog()
Await RUN_WDSEARCH_GRID(True)
If Not IsNothing(oRowHandle) Then
@@ -2740,8 +2760,18 @@ Public Class frmNodeNavigation
Private Async Sub tsmiFileVersion_Click(sender As Object, e As EventArgs) Handles tsmiFileVersion.Click
Refresh_Selected_Table()
frmWM_CreateVersion.ShowDialog()
Await RUN_WDSEARCH_GRID(True)
Dim oDocuments = Current_DocList.SelectedDocuments
If oDocuments.Count = 1 Then
ClassFileResult.DocID = oDocuments.First.DocId
ClassFileResult.DocumentPath = oDocuments.First.DocPath
frmWM_CreateVersion.ShowDialog()
Await RUN_WDSEARCH_GRID(True)
Else
MsgBox("Please choose only one document!", MsgBoxStyle.Exclamation)
End If
End Sub
Private Sub tsmiFileRightsShow_Click(sender As Object, e As EventArgs) Handles tsmiFileRightsShow.Click
@@ -3149,4 +3179,26 @@ Public Class frmNodeNavigation
RUN_WDSEARCH_GRID(True)
End If
End Sub
Private Sub GridViewDoc_Search_DoubleClick(sender As Object, e As EventArgs) Handles GridViewDoc_Search.DoubleClick
End Sub
Private Sub TimerFileHandle_Tick(sender As Object, e As EventArgs) Handles TimerFileHandle.Tick
Try
Dim oSql = $"SELECT GUID FROM TBPMO_DOC_USER_REFRESH_VIEW WHERE USER_ID = {USER_GUID} AND REFRESHED_WHEN IS NULL"
Dim oDTGUID As DataTable = MYDB_ECM.GetDatatable(oSql)
If oDTGUID.Rows.Count = 1 Then
Dim oupd = $"UPDATE TBPMO_DOC_USER_REFRESH_VIEW SET REFRESHED_WHEN = GETDATE() WHERE GUID = {oDTGUID.Rows(0).Item(0)}"
If MYDB_ECM.ExecuteNonQuery(oupd) = True Then
MsgBox("Attention: The docID of one document changed! The DocSearch will be refreshed!", MsgBoxStyle.Information)
RUN_WDSEARCH_GRID(True)
End If
End If
Catch ex As Exception
LOGGER.Warn($"Unexpected error in TimerFileHandleTick [{ex.Message}]!!")
End Try
End Sub
End Class