From 2f4b55ea18f04e99d7752e629e8fddeb1881aec1 Mon Sep 17 00:00:00 2001 From: Developer01 Date: Fri, 28 Aug 2026 12:21:34 +0200 Subject: [PATCH] =?UTF-8?q?UI-Verbesserungen=20und=20neue=20Reload-Methode?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die Benutzeroberfläche wurde durch Anpassungen der Größen von UI-Elementen (z. B. Ribbon, Grids, Labels) und Textänderungen optimiert. Eine neue RibbonPageGroup (`RbmPgGrp_Cockpit`) wurde hinzugefügt, um Cockpit-Aktionen zu gruppieren. Eine neue Methode `Reload_CurrentCockpitDefinition` wurde implementiert, um die aktuelle Cockpit-Definition aus der Datenbank neu zu laden. Die SQL-Bearbeitungslogik wurde verbessert, sodass Änderungen nur im Objekt gespeichert werden. TreeView-Knoten aktualisieren jetzt SQL-Felder direkt. Debug-Logs und Fehlermeldungen wurden erweitert, um die Nachverfolgbarkeit und Benutzerführung zu verbessern. Die AutoScaleDimensions wurden angepasst, um die Skalierung der UI zu verbessern. --- app/TaskFlow/frmCockpitConfig.Designer.vb | 104 +++++++++++----------- app/TaskFlow/frmCockpitConfig.vb | 82 +++++++++++++++-- 2 files changed, 128 insertions(+), 58 deletions(-) diff --git a/app/TaskFlow/frmCockpitConfig.Designer.vb b/app/TaskFlow/frmCockpitConfig.Designer.vb index 032fec5..cc399c1 100644 --- a/app/TaskFlow/frmCockpitConfig.Designer.vb +++ b/app/TaskFlow/frmCockpitConfig.Designer.vb @@ -41,8 +41,8 @@ Partial Class frmCockpitConfig Me.bsitm_added_Changed = New DevExpress.XtraBars.BarStaticItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() - Me.RbmPgGrp_Node = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RbmPgGrp_Cockpit = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.RbmPgGrp_Node = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.LabelControl1 = New DevExpress.XtraEditors.LabelControl() @@ -142,7 +142,7 @@ Partial Class frmCockpitConfig Me.RibbonControl1.OptionsMenuMinWidth = 385 Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] - Me.RibbonControl1.Size = New System.Drawing.Size(1451, 158) + Me.RibbonControl1.Size = New System.Drawing.Size(1451, 194) Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 ' 'BarButtonItem1 @@ -257,6 +257,15 @@ Partial Class frmCockpitConfig Me.RibbonPageGroup1.Name = "RibbonPageGroup1" Me.RibbonPageGroup1.Text = "Aktionen" ' + 'RbmPgGrp_Cockpit + ' + Me.RbmPgGrp_Cockpit.AllowTextClipping = False + Me.RbmPgGrp_Cockpit.ItemLinks.Add(Me.bbtnitm_AddCockpit) + Me.RbmPgGrp_Cockpit.ItemLinks.Add(Me.bbtnitmsave_Cocpit) + Me.RbmPgGrp_Cockpit.ItemLinks.Add(Me.bbtnitm_DeleteCockpit) + Me.RbmPgGrp_Cockpit.Name = "RbmPgGrp_Cockpit" + Me.RbmPgGrp_Cockpit.Text = "Cockpit Aktionen" + ' 'RbmPgGrp_Node ' Me.RbmPgGrp_Node.AllowTextClipping = False @@ -270,24 +279,15 @@ Partial Class frmCockpitConfig Me.RbmPgGrp_Node.Name = "RbmPgGrp_Node" Me.RbmPgGrp_Node.Text = "Knoten Aktionen" ' - 'RbmPgGrp_Cockpit - ' - Me.RbmPgGrp_Cockpit.AllowTextClipping = False - Me.RbmPgGrp_Cockpit.ItemLinks.Add(Me.bbtnitm_AddCockpit) - Me.RbmPgGrp_Cockpit.ItemLinks.Add(Me.bbtnitmsave_Cocpit) - Me.RbmPgGrp_Cockpit.ItemLinks.Add(Me.bbtnitm_DeleteCockpit) - Me.RbmPgGrp_Cockpit.Name = "RbmPgGrp_Cockpit" - Me.RbmPgGrp_Cockpit.Text = "Cockpit Aktionen" - ' 'RibbonStatusBar1 ' Me.RibbonStatusBar1.ItemLinks.Add(Me.bsitm_info) Me.RibbonStatusBar1.ItemLinks.Add(Me.bsitm_added_Changed) - Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 685) + Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 679) Me.RibbonStatusBar1.Margin = New System.Windows.Forms.Padding(4) Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 - Me.RibbonStatusBar1.Size = New System.Drawing.Size(1451, 22) + Me.RibbonStatusBar1.Size = New System.Drawing.Size(1451, 28) ' 'RibbonPage2 ' @@ -300,7 +300,7 @@ Partial Class frmCockpitConfig Me.LabelControl1.Appearance.Options.UseFont = True Me.LabelControl1.Location = New System.Drawing.Point(12, 7) Me.LabelControl1.Name = "LabelControl1" - Me.LabelControl1.Size = New System.Drawing.Size(83, 17) + Me.LabelControl1.Size = New System.Drawing.Size(100, 21) Me.LabelControl1.TabIndex = 16 Me.LabelControl1.Text = "Wähle Cockpit" ' @@ -312,7 +312,7 @@ Partial Class frmCockpitConfig Me.LookUpEditCockpit.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LookUpEditCockpit.Properties.Appearance.Options.UseFont = True Me.LookUpEditCockpit.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.LookUpEditCockpit.Size = New System.Drawing.Size(312, 24) + Me.LookUpEditCockpit.Size = New System.Drawing.Size(312, 28) Me.LookUpEditCockpit.TabIndex = 17 ' 'CheckEdit_Cockpit_Active @@ -321,7 +321,7 @@ Partial Class frmCockpitConfig Me.CheckEdit_Cockpit_Active.MenuManager = Me.RibbonControl1 Me.CheckEdit_Cockpit_Active.Name = "CheckEdit_Cockpit_Active" Me.CheckEdit_Cockpit_Active.Properties.Caption = "Active" - Me.CheckEdit_Cockpit_Active.Size = New System.Drawing.Size(52, 18) + Me.CheckEdit_Cockpit_Active.Size = New System.Drawing.Size(52, 21) Me.CheckEdit_Cockpit_Active.TabIndex = 20 ' 'ImageCollection1 @@ -368,7 +368,7 @@ Partial Class frmCockpitConfig Me.LabelControl2.Appearance.Options.UseFont = True Me.LabelControl2.Location = New System.Drawing.Point(417, 76) Me.LabelControl2.Name = "LabelControl2" - Me.LabelControl2.Size = New System.Drawing.Size(12, 17) + Me.LabelControl2.Size = New System.Drawing.Size(15, 21) Me.LabelControl2.TabIndex = 27 Me.LabelControl2.Text = "ID" ' @@ -378,7 +378,7 @@ Partial Class frmCockpitConfig Me.LabelControl3.Appearance.Options.UseFont = True Me.LabelControl3.Location = New System.Drawing.Point(494, 76) Me.LabelControl3.Name = "LabelControl3" - Me.LabelControl3.Size = New System.Drawing.Size(49, 17) + Me.LabelControl3.Size = New System.Drawing.Size(60, 21) Me.LabelControl3.TabIndex = 28 Me.LabelControl3.Text = "ParentID" ' @@ -388,7 +388,7 @@ Partial Class frmCockpitConfig Me.LabelControl4.Appearance.Options.UseFont = True Me.LabelControl4.Location = New System.Drawing.Point(417, 126) Me.LabelControl4.Name = "LabelControl4" - Me.LabelControl4.Size = New System.Drawing.Size(67, 17) + Me.LabelControl4.Size = New System.Drawing.Size(80, 21) Me.LabelControl4.TabIndex = 29 Me.LabelControl4.Text = "Knoten-Typ" ' @@ -400,7 +400,7 @@ Partial Class frmCockpitConfig Me.TextEdit_PK_CFG_COCKPIT_DEFINITION_ID.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextEdit_PK_CFG_COCKPIT_DEFINITION_ID.Properties.Appearance.Options.UseFont = True Me.TextEdit_PK_CFG_COCKPIT_DEFINITION_ID.Properties.ReadOnly = True - Me.TextEdit_PK_CFG_COCKPIT_DEFINITION_ID.Size = New System.Drawing.Size(55, 24) + Me.TextEdit_PK_CFG_COCKPIT_DEFINITION_ID.Size = New System.Drawing.Size(55, 28) Me.TextEdit_PK_CFG_COCKPIT_DEFINITION_ID.TabIndex = 31 ' 'TextEdit_ParentID @@ -411,7 +411,7 @@ Partial Class frmCockpitConfig Me.TextEdit_ParentID.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextEdit_ParentID.Properties.Appearance.Options.UseFont = True Me.TextEdit_ParentID.Properties.ReadOnly = True - Me.TextEdit_ParentID.Size = New System.Drawing.Size(55, 24) + Me.TextEdit_ParentID.Size = New System.Drawing.Size(55, 28) Me.TextEdit_ParentID.TabIndex = 32 ' 'LookUpEditTypeID @@ -422,7 +422,7 @@ Partial Class frmCockpitConfig Me.LookUpEditTypeID.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LookUpEditTypeID.Properties.Appearance.Options.UseFont = True Me.LookUpEditTypeID.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.LookUpEditTypeID.Size = New System.Drawing.Size(143, 24) + Me.LookUpEditTypeID.Size = New System.Drawing.Size(143, 28) Me.LookUpEditTypeID.TabIndex = 33 ' 'TextEdit_Bezeichnung @@ -432,7 +432,7 @@ Partial Class frmCockpitConfig Me.TextEdit_Bezeichnung.Name = "TextEdit_Bezeichnung" Me.TextEdit_Bezeichnung.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextEdit_Bezeichnung.Properties.Appearance.Options.UseFont = True - Me.TextEdit_Bezeichnung.Size = New System.Drawing.Size(283, 24) + Me.TextEdit_Bezeichnung.Size = New System.Drawing.Size(283, 28) Me.TextEdit_Bezeichnung.TabIndex = 36 ' 'LabelControl5 @@ -441,7 +441,7 @@ Partial Class frmCockpitConfig Me.LabelControl5.Appearance.Options.UseFont = True Me.LabelControl5.Location = New System.Drawing.Point(565, 76) Me.LabelControl5.Name = "LabelControl5" - Me.LabelControl5.Size = New System.Drawing.Size(120, 17) + Me.LabelControl5.Size = New System.Drawing.Size(144, 21) Me.LabelControl5.TabIndex = 35 Me.LabelControl5.Text = "Knoten Bezeichnung:" ' @@ -453,7 +453,7 @@ Partial Class frmCockpitConfig Me.CheckEdit_Active.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.CheckEdit_Active.Properties.Appearance.Options.UseFont = True Me.CheckEdit_Active.Properties.Caption = "Active" - Me.CheckEdit_Active.Size = New System.Drawing.Size(70, 21) + Me.CheckEdit_Active.Size = New System.Drawing.Size(70, 25) Me.CheckEdit_Active.TabIndex = 37 ' 'LookUpEdit_Image @@ -464,7 +464,7 @@ Partial Class frmCockpitConfig Me.LookUpEdit_Image.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LookUpEdit_Image.Properties.Appearance.Options.UseFont = True Me.LookUpEdit_Image.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.LookUpEdit_Image.Size = New System.Drawing.Size(143, 24) + Me.LookUpEdit_Image.Size = New System.Drawing.Size(143, 28) Me.LookUpEdit_Image.TabIndex = 39 ' 'LabelControl6 @@ -473,7 +473,7 @@ Partial Class frmCockpitConfig Me.LabelControl6.Appearance.Options.UseFont = True Me.LabelControl6.Location = New System.Drawing.Point(417, 181) Me.LabelControl6.Name = "LabelControl6" - Me.LabelControl6.Size = New System.Drawing.Size(47, 17) + Me.LabelControl6.Size = New System.Drawing.Size(57, 21) Me.LabelControl6.TabIndex = 38 Me.LabelControl6.Text = "Bild-Typ" ' @@ -484,7 +484,7 @@ Partial Class frmCockpitConfig Me.TextEdit_Comment.Name = "TextEdit_Comment" Me.TextEdit_Comment.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextEdit_Comment.Properties.Appearance.Options.UseFont = True - Me.TextEdit_Comment.Size = New System.Drawing.Size(359, 24) + Me.TextEdit_Comment.Size = New System.Drawing.Size(359, 28) Me.TextEdit_Comment.TabIndex = 41 ' 'LabelControl7 @@ -493,7 +493,7 @@ Partial Class frmCockpitConfig Me.LabelControl7.Appearance.Options.UseFont = True Me.LabelControl7.Location = New System.Drawing.Point(566, 181) Me.LabelControl7.Name = "LabelControl7" - Me.LabelControl7.Size = New System.Drawing.Size(65, 17) + Me.LabelControl7.Size = New System.Drawing.Size(80, 21) Me.LabelControl7.TabIndex = 40 Me.LabelControl7.Text = "Bemerkung" ' @@ -503,7 +503,7 @@ Partial Class frmCockpitConfig Me.LabelControl_Profil.Appearance.Options.UseFont = True Me.LabelControl_Profil.Location = New System.Drawing.Point(565, 126) Me.LabelControl_Profil.Name = "LabelControl_Profil" - Me.LabelControl_Profil.Size = New System.Drawing.Size(30, 17) + Me.LabelControl_Profil.Size = New System.Drawing.Size(37, 21) Me.LabelControl_Profil.TabIndex = 42 Me.LabelControl_Profil.Text = "Profil" ' @@ -515,7 +515,7 @@ Partial Class frmCockpitConfig Me.LookUpEditProfil.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LookUpEditProfil.Properties.Appearance.Options.UseFont = True Me.LookUpEditProfil.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.LookUpEditProfil.Size = New System.Drawing.Size(359, 24) + Me.LookUpEditProfil.Size = New System.Drawing.Size(359, 28) Me.LookUpEditProfil.TabIndex = 43 ' 'LookUpEditChart @@ -526,7 +526,7 @@ Partial Class frmCockpitConfig Me.LookUpEditChart.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LookUpEditChart.Properties.Appearance.Options.UseFont = True Me.LookUpEditChart.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.LookUpEditChart.Size = New System.Drawing.Size(359, 24) + Me.LookUpEditChart.Size = New System.Drawing.Size(359, 28) Me.LookUpEditChart.TabIndex = 45 ' 'LabelControl_Chart @@ -535,7 +535,7 @@ Partial Class frmCockpitConfig Me.LabelControl_Chart.Appearance.Options.UseFont = True Me.LabelControl_Chart.Location = New System.Drawing.Point(566, 126) Me.LabelControl_Chart.Name = "LabelControl_Chart" - Me.LabelControl_Chart.Size = New System.Drawing.Size(91, 17) + Me.LabelControl_Chart.Size = New System.Drawing.Size(112, 21) Me.LabelControl_Chart.TabIndex = 44 Me.LabelControl_Chart.Text = "Chart-Definition" ' @@ -547,7 +547,7 @@ Partial Class frmCockpitConfig Me.LookUpEditMonitor.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LookUpEditMonitor.Properties.Appearance.Options.UseFont = True Me.LookUpEditMonitor.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.LookUpEditMonitor.Size = New System.Drawing.Size(359, 24) + Me.LookUpEditMonitor.Size = New System.Drawing.Size(359, 28) Me.LookUpEditMonitor.TabIndex = 47 ' 'LabelControl_Monitor @@ -556,7 +556,7 @@ Partial Class frmCockpitConfig Me.LabelControl_Monitor.Appearance.Options.UseFont = True Me.LabelControl_Monitor.Location = New System.Drawing.Point(565, 126) Me.LabelControl_Monitor.Name = "LabelControl_Monitor" - Me.LabelControl_Monitor.Size = New System.Drawing.Size(107, 17) + Me.LabelControl_Monitor.Size = New System.Drawing.Size(130, 21) Me.LabelControl_Monitor.TabIndex = 46 Me.LabelControl_Monitor.Text = "Monitor-Definition" ' @@ -567,7 +567,7 @@ Partial Class frmCockpitConfig Me.XtraTabControl1.Location = New System.Drawing.Point(0, 0) Me.XtraTabControl1.Name = "XtraTabControl1" Me.XtraTabControl1.SelectedTabPage = Me.XtraTabPage1 - Me.XtraTabControl1.Size = New System.Drawing.Size(1451, 267) + Me.XtraTabControl1.Size = New System.Drawing.Size(1451, 223) Me.XtraTabControl1.TabIndex = 50 Me.XtraTabControl1.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.XtraTabPage1, Me.XtraTabPage2}) ' @@ -577,7 +577,7 @@ Partial Class frmCockpitConfig Me.XtraTabPage1.Controls.Add(Me.gridAvailableUsers) Me.XtraTabPage1.Controls.Add(Me.PanelControl1) Me.XtraTabPage1.Name = "XtraTabPage1" - Me.XtraTabPage1.Size = New System.Drawing.Size(1449, 244) + Me.XtraTabPage1.Size = New System.Drawing.Size(1449, 195) Me.XtraTabPage1.Text = "User zu Cockpit" ' 'gridAssignedUsers @@ -587,7 +587,7 @@ Partial Class frmCockpitConfig Me.gridAssignedUsers.Location = New System.Drawing.Point(406, 33) Me.gridAssignedUsers.MainView = Me.viewAssignedUsers Me.gridAssignedUsers.Name = "gridAssignedUsers" - Me.gridAssignedUsers.Size = New System.Drawing.Size(1043, 211) + Me.gridAssignedUsers.Size = New System.Drawing.Size(1043, 162) Me.gridAssignedUsers.TabIndex = 7 Me.gridAssignedUsers.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.viewAssignedUsers}) ' @@ -606,7 +606,7 @@ Partial Class frmCockpitConfig Me.gridAvailableUsers.Location = New System.Drawing.Point(0, 33) Me.gridAvailableUsers.MainView = Me.viewAvailableUsers Me.gridAvailableUsers.Name = "gridAvailableUsers" - Me.gridAvailableUsers.Size = New System.Drawing.Size(406, 211) + Me.gridAvailableUsers.Size = New System.Drawing.Size(406, 162) Me.gridAvailableUsers.TabIndex = 6 Me.gridAvailableUsers.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.viewAvailableUsers}) ' @@ -636,7 +636,7 @@ Partial Class frmCockpitConfig Me.LabelControl9.Appearance.Options.UseFont = True Me.LabelControl9.Location = New System.Drawing.Point(409, 5) Me.LabelControl9.Name = "LabelControl9" - Me.LabelControl9.Size = New System.Drawing.Size(106, 17) + Me.LabelControl9.Size = New System.Drawing.Size(125, 21) Me.LabelControl9.TabIndex = 1 Me.LabelControl9.Text = "Zugeordnete User" ' @@ -646,7 +646,7 @@ Partial Class frmCockpitConfig Me.LabelControl8.Appearance.Options.UseFont = True Me.LabelControl8.Location = New System.Drawing.Point(5, 5) Me.LabelControl8.Name = "LabelControl8" - Me.LabelControl8.Size = New System.Drawing.Size(139, 17) + Me.LabelControl8.Size = New System.Drawing.Size(164, 21) Me.LabelControl8.TabIndex = 0 Me.LabelControl8.Text = "Nicht zugeordnete User" ' @@ -656,7 +656,7 @@ Partial Class frmCockpitConfig Me.XtraTabPage2.Controls.Add(Me.GridAvailableGroups) Me.XtraTabPage2.Controls.Add(Me.PanelControl2) Me.XtraTabPage2.Name = "XtraTabPage2" - Me.XtraTabPage2.Size = New System.Drawing.Size(919, 206) + Me.XtraTabPage2.Size = New System.Drawing.Size(1449, 195) Me.XtraTabPage2.Text = "Gruppe zu Cockpit" ' 'GridAssignedGroups @@ -666,7 +666,7 @@ Partial Class frmCockpitConfig Me.GridAssignedGroups.Location = New System.Drawing.Point(406, 33) Me.GridAssignedGroups.MainView = Me.ViewAssignedGroups Me.GridAssignedGroups.Name = "GridAssignedGroups" - Me.GridAssignedGroups.Size = New System.Drawing.Size(513, 173) + Me.GridAssignedGroups.Size = New System.Drawing.Size(1043, 162) Me.GridAssignedGroups.TabIndex = 8 Me.GridAssignedGroups.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ViewAssignedGroups}) ' @@ -685,7 +685,7 @@ Partial Class frmCockpitConfig Me.GridAvailableGroups.Location = New System.Drawing.Point(0, 33) Me.GridAvailableGroups.MainView = Me.ViewAvailableGroups Me.GridAvailableGroups.Name = "GridAvailableGroups" - Me.GridAvailableGroups.Size = New System.Drawing.Size(406, 173) + Me.GridAvailableGroups.Size = New System.Drawing.Size(406, 162) Me.GridAvailableGroups.TabIndex = 7 Me.GridAvailableGroups.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ViewAvailableGroups}) ' @@ -706,7 +706,7 @@ Partial Class frmCockpitConfig Me.PanelControl2.Dock = System.Windows.Forms.DockStyle.Top Me.PanelControl2.Location = New System.Drawing.Point(0, 0) Me.PanelControl2.Name = "PanelControl2" - Me.PanelControl2.Size = New System.Drawing.Size(919, 33) + Me.PanelControl2.Size = New System.Drawing.Size(1449, 33) Me.PanelControl2.TabIndex = 1 ' 'LabelControl10 @@ -715,7 +715,7 @@ Partial Class frmCockpitConfig Me.LabelControl10.Appearance.Options.UseFont = True Me.LabelControl10.Location = New System.Drawing.Point(409, 5) Me.LabelControl10.Name = "LabelControl10" - Me.LabelControl10.Size = New System.Drawing.Size(130, 17) + Me.LabelControl10.Size = New System.Drawing.Size(154, 21) Me.LabelControl10.TabIndex = 1 Me.LabelControl10.Text = "Zugeordnete Gruppen" ' @@ -725,7 +725,7 @@ Partial Class frmCockpitConfig Me.LabelControl11.Appearance.Options.UseFont = True Me.LabelControl11.Location = New System.Drawing.Point(5, 5) Me.LabelControl11.Name = "LabelControl11" - Me.LabelControl11.Size = New System.Drawing.Size(163, 17) + Me.LabelControl11.Size = New System.Drawing.Size(193, 21) Me.LabelControl11.TabIndex = 0 Me.LabelControl11.Text = "Nicht zugeordnete Gruppen" ' @@ -736,7 +736,7 @@ Partial Class frmCockpitConfig Me.TextEditCockpit_Bez.Name = "TextEditCockpit_Bez" Me.TextEditCockpit_Bez.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextEditCockpit_Bez.Properties.Appearance.Options.UseFont = True - Me.TextEditCockpit_Bez.Size = New System.Drawing.Size(431, 24) + Me.TextEditCockpit_Bez.Size = New System.Drawing.Size(431, 28) Me.TextEditCockpit_Bez.TabIndex = 55 ' 'LabelControl12 @@ -745,7 +745,7 @@ Partial Class frmCockpitConfig Me.LabelControl12.Appearance.Options.UseFont = True Me.LabelControl12.Location = New System.Drawing.Point(417, 7) Me.LabelControl12.Name = "LabelControl12" - Me.LabelControl12.Size = New System.Drawing.Size(122, 17) + Me.LabelControl12.Size = New System.Drawing.Size(147, 21) Me.LabelControl12.TabIndex = 54 Me.LabelControl12.Text = "Cockpit Bezeichnung:" ' @@ -753,7 +753,7 @@ Partial Class frmCockpitConfig ' Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill Me.SplitContainerControl1.Horizontal = False - Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 158) + Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 194) Me.SplitContainerControl1.Name = "SplitContainerControl1" ' 'SplitContainerControl1.Panel1 @@ -790,14 +790,14 @@ Partial Class frmCockpitConfig Me.SplitContainerControl1.Panel2.Controls.Add(Me.XtraTabControl1) Me.SplitContainerControl1.Panel2.Text = "Panel2" Me.SplitContainerControl1.ShowSplitGlyph = DevExpress.Utils.DefaultBoolean.[True] - Me.SplitContainerControl1.Size = New System.Drawing.Size(1451, 527) + Me.SplitContainerControl1.Size = New System.Drawing.Size(1451, 485) Me.SplitContainerControl1.SplitterPosition = 250 Me.SplitContainerControl1.TabIndex = 58 ' 'frmCockpitConfig ' Me.Appearance.Options.UseFont = True - Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 21.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(1451, 707) Me.Controls.Add(Me.SplitContainerControl1) diff --git a/app/TaskFlow/frmCockpitConfig.vb b/app/TaskFlow/frmCockpitConfig.vb index 43070c5..bfe83bc 100644 --- a/app/TaskFlow/frmCockpitConfig.vb +++ b/app/TaskFlow/frmCockpitConfig.vb @@ -81,6 +81,7 @@ Public Class frmCockpitConfig End Sub Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick + Load_TBTF_CFG_COCKPIT_DEFINITION() Load_CFG_COCKPIT() End Sub Sub Load_CFG_COCKPIT() @@ -163,6 +164,65 @@ Public Class frmCockpitConfig bsitm_info_Display($"Keine Informationen gefunden für {myentity}", True) End If End Sub + ' ===== NEUE HILFSMETHODE: AKTUELLEN KNOTEN NEU LADEN ===== + Private Sub Reload_CurrentCockpitDefinition() + Try + If _currentCockpitDefinition Is Nothing OrElse _currentCockpitDefinition.PK_CFG_COCKPIT_DEFINITION_ID = 0 Then + LOGGER.Warn("Reload_CurrentCockpitDefinition: Keine gültige Definition zum Neuladen vorhanden") + Exit Sub + End If + + Dim pkId As Integer = _currentCockpitDefinition.PK_CFG_COCKPIT_DEFINITION_ID + + Dim oSQL = $" + SELECT + PK_CFG_COCKPIT_DEFINITION_ID + ,ACTIVE + ,PARENT_ID + ,TYPE_ID + ,ICON_ID + ,NAME + ,FK_PROFILE_ID + ,FK_CHART_ID + ,FK_MONITOR_ID + ,SQL_QUERY + ,SQL_QUERY_COUNT + ,COMMENT + ,ADDED_WHO + ,ADDED_WHEN + ,CHANGED_WHO + ,CHANGED_WHEN + FROM [dbo].[TBTF_CFG_COCKPIT_DEFINITION] WITH (NOLOCK) + WHERE PK_CFG_COCKPIT_DEFINITION_ID = {pkId}" + + Dim oDT As DataTable = DatabaseFallback.GetDatatableECM(oSQL) + + If oDT IsNot Nothing AndAlso oDT.Rows.Count > 0 Then + Dim row As DataRow = oDT.Rows(0) + + ' ===== DATEN DIREKT IN _currentCockpitDefinition LADEN ===== + _currentCockpitDefinition.Active = If(IsDBNull(row("ACTIVE")), False, CBool(row("ACTIVE"))) + _currentCockpitDefinition.ParentID = If(IsDBNull(row("PARENT_ID")), Nothing, CInt(row("PARENT_ID"))) + _currentCockpitDefinition.TypeID = If(IsDBNull(row("TYPE_ID")), Nothing, CInt(row("TYPE_ID"))) + _currentCockpitDefinition.IconID = If(IsDBNull(row("ICON_ID")), Nothing, CInt(row("ICON_ID"))) + _currentCockpitDefinition.Name = If(IsDBNull(row("NAME")), String.Empty, row("NAME").ToString()) + _currentCockpitDefinition.FK_ProfileID = If(IsDBNull(row("FK_PROFILE_ID")), Nothing, CInt(row("FK_PROFILE_ID"))) + _currentCockpitDefinition.FK_ChartID = If(IsDBNull(row("FK_CHART_ID")), Nothing, CInt(row("FK_CHART_ID"))) + _currentCockpitDefinition.FK_MonitorID = If(IsDBNull(row("FK_MONITOR_ID")), Nothing, CInt(row("FK_MONITOR_ID"))) + _currentCockpitDefinition.SQL_Query = If(IsDBNull(row("SQL_QUERY")), String.Empty, row("SQL_QUERY").ToString()) + _currentCockpitDefinition.SQL_Query_Count = If(IsDBNull(row("SQL_QUERY_COUNT")), String.Empty, row("SQL_QUERY_COUNT").ToString()) + _currentCockpitDefinition.Comment = If(IsDBNull(row("COMMENT")), String.Empty, row("COMMENT").ToString()) + + LOGGER.Debug($"Reload_CurrentCockpitDefinition: Erfolgreich neu geladen - ID={pkId}, SQL_Query Length={_currentCockpitDefinition.SQL_Query.Length}, SQL_Query_Count Length={_currentCockpitDefinition.SQL_Query_Count.Length}") + Else + LOGGER.Warn($"Reload_CurrentCockpitDefinition: Keine Daten gefunden für ID={pkId}") + End If + + Catch ex As Exception + LOGGER.Error($"Error in Reload_CurrentCockpitDefinition: {ex.Message}") + LOGGER.Error(ex) + End Try + End Sub Sub Load_TBTF_CFG_COCKPIT_DEFINITION() Try Dim oSQL = $" @@ -780,10 +840,14 @@ Public Class frmCockpitConfig oForm.ShowDialog() If oForm.DialogResult = DialogResult.OK Then + ' ===== NUR IM OBJEKT SPEICHERN, NICHT IN DATENBANK ===== _currentCockpitDefinition.SQL_Query_Count = oForm.SQLCommand.Replace(praefix, "") + + LOGGER.Debug($"SQL_Query_Count updated in _currentCockpitDefinition - Length: {_currentCockpitDefinition.SQL_Query_Count.Length}") + bsitm_info_Display("SQL_Query_Count aktualisiert (noch nicht gespeichert - bitte 'Speichern' klicken)") End If Catch ex As Exception - MsgBox("Error in Saving SQL: " & vbNewLine & vbNewLine & ex.Message) + MsgBox("Error in editing SQL Count: " & vbNewLine & vbNewLine & ex.Message) LOGGER.Error(ex) End Try End Sub @@ -796,10 +860,14 @@ Public Class frmCockpitConfig oForm.ShowDialog() If oForm.DialogResult = DialogResult.OK Then + ' ===== NUR IM OBJEKT SPEICHERN, NICHT IN DATENBANK ===== _currentCockpitDefinition.SQL_Query = oForm.SQLCommand.Replace(praefix, "") + + LOGGER.Debug($"SQL_Query updated in _currentCockpitDefinition - Length: {_currentCockpitDefinition.SQL_Query.Length}") + bsitm_info_Display("SQL_Query aktualisiert (noch nicht gespeichert - bitte 'Speichern' klicken)") End If Catch ex As Exception - MsgBox("Error in Saving SQL: " & vbNewLine & vbNewLine & ex.Message) + MsgBox("Error in editing SQL: " & vbNewLine & vbNewLine & ex.Message) LOGGER.Error(ex) End Try End Sub @@ -904,17 +972,14 @@ Public Class frmCockpitConfig Dim newIconId As Integer? = _currentCockpitDefinition.IconID If (currentIconId Is Nothing OrElse IsDBNull(currentIconId)) AndAlso newIconId.HasValue Then - ' Altes Icon war NULL, neues ist gesetzt currentNode.SetValue("ICON_ID", newIconId.Value) LOGGER.Debug($"Icon aktualisiert: NULL -> {newIconId.Value}") ElseIf currentIconId IsNot Nothing AndAlso Not IsDBNull(currentIconId) AndAlso newIconId.HasValue Then - ' Beide haben Werte - prüfen ob unterschiedlich If CInt(currentIconId) <> newIconId.Value Then currentNode.SetValue("ICON_ID", newIconId.Value) LOGGER.Debug($"Icon aktualisiert: {currentIconId} -> {newIconId.Value}") End If ElseIf (currentIconId IsNot Nothing AndAlso Not IsDBNull(currentIconId)) AndAlso Not newIconId.HasValue Then - ' Altes Icon war gesetzt, neues ist NULL currentNode.SetValue("ICON_ID", DBNull.Value) LOGGER.Debug($"Icon aktualisiert: {currentIconId} -> NULL") End If @@ -922,10 +987,15 @@ Public Class frmCockpitConfig ' ACTIVE-Status aktualisieren (für CustomDrawNodeCell) currentNode.SetValue("ACTIVE", _currentCockpitDefinition.Active) + ' ===== SQL-FELDER IM TREEVIEW-KNOTEN AKTUALISIEREN ===== + currentNode.SetValue("SQL_QUERY", _currentCockpitDefinition.SQL_Query) + currentNode.SetValue("SQL_QUERY_COUNT", _currentCockpitDefinition.SQL_Query_Count) + LOGGER.Debug($"TreeView SQL fields updated - SQL_Query length: {_currentCockpitDefinition.SQL_Query.Length}, SQL_Query_Count length: {_currentCockpitDefinition.SQL_Query_Count.Length}") + ' TreeView visuell aktualisieren TreeList_Cockpit.RefreshNode(currentNode) End If - + Reload_CurrentCockpitDefinition() MsgBox("Node definition saved successfully.", MsgBoxStyle.Information) LOGGER.Debug($"Saved node definition ID={_currentCockpitDefinition.PK_CFG_COCKPIT_DEFINITION_ID}, Name={_currentCockpitDefinition.Name}")