fix loading control name list

This commit is contained in:
Jonathan Jenne
2022-08-16 16:13:25 +02:00
parent 4c76383eee
commit 20d93efcc1
2 changed files with 85 additions and 59 deletions

View File

@@ -7,6 +7,7 @@ Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.Grid
Imports DigitalData.GUIs.Common
Imports DigitalData.Modules.Language.Utils
Imports DigitalData.Modules.Logging
Public Class frmAdministration
Private UNSAVED_CHANGES_PROFILE As Boolean = False
@@ -17,12 +18,15 @@ Public Class frmAdministration
Private ReadOnly email As New ClassEmail
Private FormDesigner As frmFormDesigner
Private _Logger As Logger = LOGCONFIG.GetLogger()
Private Property profile_guid As Integer = 0
Private Property DT_CHART_CONFIG As DataTable
Private Property PROF_ORIGIN As DataTable
Private Sub frmAdministration_Load(sender As Object, e As System.EventArgs) Handles Me.Load
_Logger.Debug("Loading Administration")
FORM_LOADED = False
UNSAVED_CHANGES_PROFILE = False
Try
@@ -57,7 +61,7 @@ Public Class frmAdministration
tabctrl_Profilkonfig.SelectedIndex = 0
Catch ex As Exception
LOGGER.Error(ex)
_Logger.Error(ex)
MsgBox("Fehler bei Laden der Wertehilfen und Konfig-Daten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
If IDB_ACTIVE = True Then
@@ -77,6 +81,8 @@ Public Class frmAdministration
ObjekttypenEintragen()
Indexe_eintragen()
' RibbonPageGroupProfile.Enabled = False
_Logger.Debug("Administration loaded!")
End Sub
Sub Indexe_eintragen()
If cmbObjekttypen.Text <> "" Then
@@ -128,7 +134,7 @@ Public Class frmAdministration
' MyIndicies_Types.Add(type)
'Next
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox("Error in GetIndices windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
PM_VEKTOR_INDEXComboBox.SelectedIndex = -1
cmbLOGIndex.SelectedIndex = -1
@@ -163,7 +169,7 @@ Public Class frmAdministration
MyIndicies_Types.Add(type)
Next
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox("Error in GetIndices IDB: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
@@ -177,6 +183,8 @@ Public Class frmAdministration
End Sub
Sub Refresh_Profildaten()
_Logger.Debug("Loading Profile Data")
Try
BINDINGSOURCE_CHANGING = True
CHANGES_FORM_DESIGN = True
@@ -193,10 +201,11 @@ Public Class frmAdministration
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
_Logger.Error(ex)
MsgBox("Fehler bei Refresh_Profildaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
Finally
BINDINGSOURCE_CHANGING = False
_Logger.Debug("Loading Profile Data done!")
End Try
End Sub
Private Sub ObjekttypenEintragen()
@@ -209,7 +218,7 @@ Public Class frmAdministration
Me.cmbObjekttypen.Items.Add(aType.aName)
Next
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox("Es konnte keine Verbindung zum windream-Server hergestellt werden.", MsgBoxStyle.Critical, "Fehler beim Zugriff auf windream-Server")
End Try
Else
@@ -260,7 +269,7 @@ Public Class frmAdministration
p.Close()
End If
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei öffnen der windream-Suche:")
End Try
End Sub
@@ -301,7 +310,7 @@ Public Class frmAdministration
Catch ex As Exception
'Profilzuordnung'
LOGGER.Error(ex)
_LOGGER.Error(ex)
End Try
End Sub
@@ -329,7 +338,7 @@ Public Class frmAdministration
TBPROFILE_USERTableAdapter.CMDInsert(profileId, userId, USER_USERNAME)
FillProfile_Zuordnung(profileId)
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen eines Users:")
End Try
End Sub
@@ -343,7 +352,7 @@ Public Class frmAdministration
TBPROFILE_USERTableAdapter.CmdDelete(profileId, userId)
FillProfile_Zuordnung(profileId)
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Entfernen eines Users:")
End Try
End Sub
@@ -359,7 +368,7 @@ Public Class frmAdministration
' TBPROFILE_USERTableAdapter.CMDInsert(profileId, userId, USER_USERNAME)
FillProfile_Zuordnung(profileId)
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen einer Gruppe:")
End Try
End Sub
@@ -375,7 +384,7 @@ Public Class frmAdministration
'TBPROFILE_USERTableAdapter.cmdDelete(userId)
FillProfile_Zuordnung(profileId)
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Entfernen einer Gruppe:")
End Try
End Sub
@@ -388,9 +397,9 @@ Public Class frmAdministration
EditMode_Profile("Unlock")
End Sub
Private Sub Refresh_Final_indexe()
_Logger.Debug("Loading Final Index Data")
Try
'Me.lblSaveFinalIndex.Visible = False
If FORM_LOADED = False Then Exit Sub
@@ -404,6 +413,8 @@ Public Class frmAdministration
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Refresh_Final_indexe:")
Finally
_Logger.Debug("Loading Final Index Data done!")
End Try
End Sub
@@ -531,7 +542,7 @@ Public Class frmAdministration
SQLconnection.Close()
Return True
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox("Fehler in Execute_SQL: " & vbNewLine & ex.Message & vbNewLine & vbNewLine & " SQL: " & SQL)
Return False
End Try
@@ -573,7 +584,7 @@ Public Class frmAdministration
Try
Me.TBDD_USERTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBDD_USER)
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox("Fehler bei LoadUsers: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
End Sub
@@ -698,9 +709,9 @@ Public Class frmAdministration
Refresh_Final_indexe()
End If
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox($"Error while loading Final Index properties: {ex.Message}", MsgBoxStyle.Critical)
LOGGER.Info($"Error while loading Final Index properties: {ex.Message}")
_LOGGER.Info($"Error while loading Final Index properties: {ex.Message}")
End Try
End Sub
@@ -742,7 +753,7 @@ Public Class frmAdministration
propertyGrid.Refresh()
End If
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
Finally
UNSAVED_CHANGES_FI = True
End Try
@@ -802,7 +813,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox("Fehler bei Anlage Profilkopie:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
@@ -824,7 +835,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox("Fehler bei Löschen des Profils:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
@@ -863,7 +874,7 @@ Public Class frmAdministration
tsbStaticInfo.Caption = ""
End If
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
If ex.Message.Contains("DataTable-Index") = False Then
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Speichern des Profils:")
End If
@@ -878,7 +889,7 @@ Public Class frmAdministration
Try
TBPM_PROFILEBindingSource.AddNew()
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
End Try
End If
@@ -921,7 +932,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
MsgBox("Fehler beim Speichern: " & vbNewLine & vbNewLine & ex.Message)
LOGGER.Error(ex)
_LOGGER.Error(ex)
End Try
End Sub
@@ -1035,9 +1046,9 @@ Public Class frmAdministration
End If
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox("Error while Saving Final Index: " & ex.Message, MsgBoxStyle.Critical)
LOGGER.Info("Error while Saving Final Index: " & ex.Message)
_LOGGER.Info("Error while Saving Final Index: " & ex.Message)
Finally
BarButtonItem19.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
BarButtonItem16.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
@@ -1070,7 +1081,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
MsgBox("Error in Saving SQL Overview: " & vbNewLine & vbNewLine & ex.Message)
LOGGER.Error(ex)
_LOGGER.Error(ex)
End Try
End Sub
@@ -1101,7 +1112,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
MsgBox("Error in Saving Profile SQL: " & vbNewLine & vbNewLine & ex.Message)
LOGGER.Error(ex)
_LOGGER.Error(ex)
End Try
End Sub
@@ -1133,7 +1144,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
MsgBox("Error in Saving Profile SQLFinish: " & vbNewLine & vbNewLine & ex.Message)
LOGGER.Error(ex)
_LOGGER.Error(ex)
End Try
End Sub
Function CHECK_QUESTION_CHANGES() As Boolean
@@ -1175,15 +1186,21 @@ Public Class frmAdministration
If FORM_LOADED = False Or UNSAVED_CHANGES_PROFILE = True Or UNSAVED_CHANGES_FI = True Or BINDINGSOURCE_CHANGING = True Then
Exit Sub
End If
BINDINGSOURCE_CHANGING = True
If TabControl1.SelectedIndex = 1 And FORM_LOADED Then
Try
Dim profileId As Integer = GetCurrentProfileId()
_Logger.Debug("Loading Profile [{0}]", profileId)
If Not IsNothing(profileId) Then
FillProfile_Zuordnung(profileId)
End If
Catch ex As Exception
LOGGER.Error(ex)
_LOGGER.Error(ex)
MsgBox($"Error while calling FillProfile_User", MsgBoxStyle.Critical)
End Try
End If