From 03c3f2be3b8232a1bfdf78810bdc42be2cc8ff04 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 17 Jun 2022 11:01:53 +0200 Subject: [PATCH] Common/DocumentResultList: Refresh results after saving changes --- GUIs.Common/My Project/licenses.licx | 16 +- .../ctrlObjectPropertyDialog.vb | 18 ++- GUIs.Common/frmDocumentResultList.Designer.vb | 61 ++++---- GUIs.Common/frmDocumentResultList.resx | 138 +++++++++--------- GUIs.Common/frmDocumentResultList.vb | 12 +- 5 files changed, 131 insertions(+), 114 deletions(-) diff --git a/GUIs.Common/My Project/licenses.licx b/GUIs.Common/My Project/licenses.licx index 0330697a..9ed1fd07 100644 --- a/GUIs.Common/My Project/licenses.licx +++ b/GUIs.Common/My Project/licenses.licx @@ -1,9 +1,13 @@ -DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.PictureEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.ProgressBarControl, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.Repository.RepositoryItemDateEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.LookUpEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.PictureEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/GUIs.Common/ObjectPropertyDialog/ctrlObjectPropertyDialog.vb b/GUIs.Common/ObjectPropertyDialog/ctrlObjectPropertyDialog.vb index 83ee1a85..7e02b4ad 100644 --- a/GUIs.Common/ObjectPropertyDialog/ctrlObjectPropertyDialog.vb +++ b/GUIs.Common/ObjectPropertyDialog/ctrlObjectPropertyDialog.vb @@ -1,14 +1,14 @@ Imports System.Windows.Forms Imports DevExpress.XtraEditors.Repository +Imports DevExpress.XtraSplashScreen +Imports DevExpress.XtraEditors +Imports DevExpress.XtraLayout Imports DigitalData.GUIs.Common.Base Imports DigitalData.Modules.EDMI.API Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Language Imports DigitalData.Modules.ZooFlow -Imports DevExpress.XtraSplashScreen -Imports DevExpress.XtraEditors Imports DigitalData.Modules.Base.IDB -Imports DevExpress.XtraLayout Public Class ctrlObjectPropertyDialog Implements IBaseForm @@ -21,7 +21,7 @@ Public Class ctrlObjectPropertyDialog Private Property Environment As Environment Private Property ObjectId As Long Private Property HostForm As Form - Private Property FormHelper As FormHelper + Private Property Helper As FormHelper Private ReadOnly Changes As New Dictionary(Of String, Object) @@ -43,6 +43,7 @@ Public Class ctrlObjectPropertyDialog Logger = pLogConfig.GetLogger() HostForm = pHostForm ControlManager = New AttributeControls(pLogConfig, pEnv, pClient) + Helper = New FormHelper(pLogConfig, pHostForm) GridBuilder = New GridBuilder(ViewObjectHistory, ViewValueHistory) GridBuilder. @@ -56,7 +57,7 @@ Public Class ctrlObjectPropertyDialog Environment = pEnv End Sub - Public Async Function SaveChanges() As Task + Public Async Function SaveChanges() As Task(Of Boolean) Try For Each oChange As KeyValuePair(Of String, Object) In Changes Logger.Info("Updating Attribute [{0}] with value [{1}]", oChange.Key, oChange.Value.ToString) @@ -66,10 +67,13 @@ Public Class ctrlObjectPropertyDialog }) Next - FormHelper.ShowInfoMessage($"{Changes.Count} Änderungen gespeichert!", "SaveChanges") + Helper.ShowInfoMessage($"{Changes.Count} Änderungen gespeichert!", "SaveChanges") Changes.Clear() + + Return True Catch ex As Exception - FormHelper.ShowErrorMessage(ex, "SaveChanges") + Helper.ShowErrorMessage(ex, "SaveChanges") + Return False End Try End Function diff --git a/GUIs.Common/frmDocumentResultList.Designer.vb b/GUIs.Common/frmDocumentResultList.Designer.vb index 15b572b7..d48dfa2e 100644 --- a/GUIs.Common/frmDocumentResultList.Designer.vb +++ b/GUIs.Common/frmDocumentResultList.Designer.vb @@ -100,6 +100,9 @@ Partial Class frmDocumentResultList Me.DockPanelFileList = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.panelContainerStatus = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanelMetadata = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel3_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.CtrlObjectPropertyDialog = New DigitalData.GUIs.Common.ctrlObjectPropertyDialog() Me.DockPanelStatus = New DevExpress.XtraBars.Docking.DockPanel() Me.ControlContainer1 = New DevExpress.XtraBars.Docking.ControlContainer() Me.LayoutControl1 = New DevExpress.XtraLayout.LayoutControl() @@ -110,9 +113,6 @@ Partial Class frmDocumentResultList Me.LayoutControlItem1 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem2 = New DevExpress.XtraLayout.LayoutControlItem() Me.EmptySpaceItem1 = New DevExpress.XtraLayout.EmptySpaceItem() - Me.DockPanelMetadata = New DevExpress.XtraBars.Docking.DockPanel() - Me.DockPanel3_Container = New DevExpress.XtraBars.Docking.ControlContainer() - Me.CtrlObjectPropertyDialog = New DigitalData.GUIs.Common.ctrlObjectPropertyDialog() Me.DockPanelPreview = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel1_Container = New DevExpress.XtraBars.Docking.ControlContainer() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() @@ -143,6 +143,8 @@ Partial Class frmDocumentResultList Me.DockPanelFileList.SuspendLayout() Me.DockPanel2_Container.SuspendLayout() Me.panelContainerStatus.SuspendLayout() + Me.DockPanelMetadata.SuspendLayout() + Me.DockPanel3_Container.SuspendLayout() Me.DockPanelStatus.SuspendLayout() Me.ControlContainer1.SuspendLayout() CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).BeginInit() @@ -155,8 +157,6 @@ Partial Class frmDocumentResultList CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.DockPanelMetadata.SuspendLayout() - Me.DockPanel3_Container.SuspendLayout() Me.DockPanelPreview.SuspendLayout() Me.DockPanel1_Container.SuspendLayout() Me.SuspendLayout() @@ -224,7 +224,6 @@ Partial Class frmDocumentResultList resources.ApplyResources(Me.RibbonControl, "RibbonControl") Me.RibbonControl.MaxItemId = 59 Me.RibbonControl.Name = "RibbonControl" - Me.RibbonControl.PageHeaderItemLinks.Add(Me.BarWorkspaceMenuItem1) Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPageStart, Me.RibbonPage2}) Me.RibbonControl.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemTextEdit1, Me.RepositoryItemTextEdit2, Me.RepositoryItemSearchControl1, Me.cmbGridFontSize}) Me.RibbonControl.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] @@ -764,9 +763,9 @@ Partial Class frmDocumentResultList ' 'panelContainerStatus ' - Me.panelContainerStatus.ActiveChild = Me.DockPanelStatus - Me.panelContainerStatus.Controls.Add(Me.DockPanelStatus) + Me.panelContainerStatus.ActiveChild = Me.DockPanelMetadata Me.panelContainerStatus.Controls.Add(Me.DockPanelMetadata) + Me.panelContainerStatus.Controls.Add(Me.DockPanelStatus) Me.panelContainerStatus.Dock = DevExpress.XtraBars.Docking.DockingStyle.Right Me.panelContainerStatus.ID = New System.Guid("3d77391e-21ef-4574-8521-d9f3b7468ebe") resources.ApplyResources(Me.panelContainerStatus, "panelContainerStatus") @@ -774,6 +773,27 @@ Partial Class frmDocumentResultList Me.panelContainerStatus.OriginalSize = New System.Drawing.Size(275, 200) Me.panelContainerStatus.Tabbed = True ' + 'DockPanelMetadata + ' + Me.DockPanelMetadata.Controls.Add(Me.DockPanel3_Container) + Me.DockPanelMetadata.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill + Me.DockPanelMetadata.ID = New System.Guid("a7688cec-f13e-448b-82cf-a6bb020fb3f7") + resources.ApplyResources(Me.DockPanelMetadata, "DockPanelMetadata") + Me.DockPanelMetadata.Name = "DockPanelMetadata" + Me.DockPanelMetadata.Options.ShowCloseButton = False + Me.DockPanelMetadata.OriginalSize = New System.Drawing.Size(268, 413) + ' + 'DockPanel3_Container + ' + Me.DockPanel3_Container.Controls.Add(Me.CtrlObjectPropertyDialog) + resources.ApplyResources(Me.DockPanel3_Container, "DockPanel3_Container") + Me.DockPanel3_Container.Name = "DockPanel3_Container" + ' + 'CtrlObjectPropertyDialog + ' + resources.ApplyResources(Me.CtrlObjectPropertyDialog, "CtrlObjectPropertyDialog") + Me.CtrlObjectPropertyDialog.Name = "CtrlObjectPropertyDialog" + ' 'DockPanelStatus ' Me.DockPanelStatus.Controls.Add(Me.ControlContainer1) @@ -861,27 +881,6 @@ Partial Class frmDocumentResultList Me.EmptySpaceItem1.Size = New System.Drawing.Size(248, 321) Me.EmptySpaceItem1.TextSize = New System.Drawing.Size(0, 0) ' - 'DockPanelMetadata - ' - Me.DockPanelMetadata.Controls.Add(Me.DockPanel3_Container) - Me.DockPanelMetadata.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill - Me.DockPanelMetadata.ID = New System.Guid("a7688cec-f13e-448b-82cf-a6bb020fb3f7") - resources.ApplyResources(Me.DockPanelMetadata, "DockPanelMetadata") - Me.DockPanelMetadata.Name = "DockPanelMetadata" - Me.DockPanelMetadata.Options.ShowCloseButton = False - Me.DockPanelMetadata.OriginalSize = New System.Drawing.Size(268, 413) - ' - 'DockPanel3_Container - ' - Me.DockPanel3_Container.Controls.Add(Me.CtrlObjectPropertyDialog) - resources.ApplyResources(Me.DockPanel3_Container, "DockPanel3_Container") - Me.DockPanel3_Container.Name = "DockPanel3_Container" - ' - 'CtrlObjectPropertyDialog - ' - resources.ApplyResources(Me.CtrlObjectPropertyDialog, "CtrlObjectPropertyDialog") - Me.CtrlObjectPropertyDialog.Name = "CtrlObjectPropertyDialog" - ' 'DockPanelPreview ' Me.DockPanelPreview.Controls.Add(Me.DockPanel1_Container) @@ -941,6 +940,8 @@ Partial Class frmDocumentResultList Me.DockPanelFileList.ResumeLayout(False) Me.DockPanel2_Container.ResumeLayout(False) Me.panelContainerStatus.ResumeLayout(False) + Me.DockPanelMetadata.ResumeLayout(False) + Me.DockPanel3_Container.ResumeLayout(False) Me.DockPanelStatus.ResumeLayout(False) Me.ControlContainer1.ResumeLayout(False) CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).EndInit() @@ -953,8 +954,6 @@ Partial Class frmDocumentResultList CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).EndInit() - Me.DockPanelMetadata.ResumeLayout(False) - Me.DockPanel3_Container.ResumeLayout(False) Me.DockPanelPreview.ResumeLayout(False) Me.DockPanel1_Container.ResumeLayout(False) Me.ResumeLayout(False) diff --git a/GUIs.Common/frmDocumentResultList.resx b/GUIs.Common/frmDocumentResultList.resx index 66af4182..5e4eaf4e 100644 --- a/GUIs.Common/frmDocumentResultList.resx +++ b/GUIs.Common/frmDocumentResultList.resx @@ -572,6 +572,72 @@ 0 + + Fill + + + 0, 0 + + + 268, 434 + + + 0 + + + CtrlObjectPropertyDialog + + + DigitalData.GUIs.Common.ctrlObjectPropertyDialog, DigitalData.GUIs.Common, Version=1.12.1.0, Culture=neutral, PublicKeyToken=null + + + DockPanel3_Container + + + 0 + + + 0, 0 + + + 268, 434 + + + 0 + + + DockPanel3_Container + + + DevExpress.XtraBars.Docking.ControlContainer, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + DockPanelMetadata + + + 0 + + + 4, 26 + + + 268, 434 + + + Eigenschaften + + + DockPanelMetadata + + + DevExpress.XtraBars.Docking.DockPanel, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + panelContainerStatus + + + 0 + 162, 45 @@ -699,72 +765,6 @@ panelContainerStatus - 0 - - - Fill - - - 0, 0 - - - 268, 434 - - - 0 - - - CtrlObjectPropertyDialog - - - DigitalData.GUIs.Common.ctrlObjectPropertyDialog, DigitalData.GUIs.Common, Version=1.12.1.0, Culture=neutral, PublicKeyToken=null - - - DockPanel3_Container - - - 0 - - - 0, 0 - - - 268, 434 - - - 0 - - - DockPanel3_Container - - - DevExpress.XtraBars.Docking.ControlContainer, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - - DockPanelMetadata - - - 0 - - - 4, 26 - - - 268, 434 - - - Eigenschaften - - - DockPanelMetadata - - - DevExpress.XtraBars.Docking.DockPanel, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - - panelContainerStatus - - 1 @@ -1403,7 +1403,7 @@ Attribute - Workspaces + Arbeitsbereiche Suche @@ -1418,10 +1418,10 @@ Allgemein - Workspaces + Arbeitsbereiche - Layout + Ansicht False diff --git a/GUIs.Common/frmDocumentResultList.vb b/GUIs.Common/frmDocumentResultList.vb index c5f9b9d9..bd5ea712 100644 --- a/GUIs.Common/frmDocumentResultList.vb +++ b/GUIs.Common/frmDocumentResultList.vb @@ -503,6 +503,10 @@ Public Class frmDocumentResultList Else IsLoading = True Try + ' Save current row handle and unset it + Dim oCurrentRowHandle As Integer = GridView1.FocusedRowHandle + GridView1.FocusedRowHandle = GridControl.InvalidRowHandle + ' Save the new results ResultLists = pResults @@ -513,6 +517,10 @@ Public Class frmDocumentResultList UpdateTotalResults() LoadGridDataAndLayout() + ' After the new results are loaded, set the old row handle + ' to trigger the row change events and load object properties + GridView1.FocusedRowHandle = oCurrentRowHandle + Return True Catch ex As Exception Logger.Error(ex) @@ -1033,7 +1041,9 @@ Public Class frmDocumentResultList End Sub Private Async Sub MenuItemSaveProperties_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemSaveProperties.ItemClick - Await CtrlObjectPropertyDialog.SaveChanges() + If Await CtrlObjectPropertyDialog.SaveChanges() Then + RaiseEvent NeedsRefresh(sender, Params.ProfileGuid) + End If End Sub Private Sub BarButtonItem11_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonItem11.ItemClick