Zooflow: Reorganize administration, prepare for user admin section

This commit is contained in:
Jonathan Jenne
2022-02-25 10:33:33 +01:00
parent eaa2e312c7
commit 10e3c43ef1
29 changed files with 190 additions and 82 deletions

View File

@@ -27,14 +27,21 @@ Public Class frmAdmin_Start
DetailForm = New ClassDetailForm(My.LogConfig)
AddHandler DetailForm.DetailFormClosed, AddressOf DetailForm_Closed
Load_SQLData()
DetailForm.LoadData()
TreeListMenu.ExpandAll()
End Sub
Private Sub DetailForm_Closed(sender As Object, e As IAdminForm)
If e.HasChanges Then
Load_SQLData()
Load_GridData(DetailForm.DetailDataList.Item(CurrentPage))
If e.HasChanges And CurrentPage IsNot Nothing Then
DetailForm.LoadData()
Dim oKey = $"{CurrentPage}-OVERVIEW"
If DetailForm.DetailDataList.ContainsKey(oKey) Then
Load_GridData(DetailForm.DetailDataList.Item(oKey))
Else
MsgBox($"Could not load data for Page [{oKey}] because it does not exist!", MsgBoxStyle.Critical, Text)
End If
End If
End Sub
@@ -73,40 +80,6 @@ Public Class frmAdmin_Start
Return True
End Function
Private Function Load_SQLData() As Boolean
Try
Dim oTable As DataTable = My.DatabaseECM.GetDatatable("SELECT * FROM TBZF_ADMIN_SOURCE_SQL WHERE SCOPE = 'OVERVIEW'")
DetailForm.DetailDataList.Clear()
For Each oRow As DataRow In oTable.Rows
Dim oCHeck = oRow.Item("ENTITY_TITLE").ToString
Dim oItem As New ClassDetailForm.DetailData With {
.Guid = CInt(oRow.Item("GUID")),
.ParentId = CInt(oRow.Item("PARENT_ID")),
.Entity = oRow.Item("ENTITY_TITLE").ToString,
.Scope = oRow.Item("SCOPE").ToString,
.SQLCommand = oRow.Item("SQL_COMMAND").ToString.Replace("@LANG_CODE", My.Application.User.Language),
.PrimaryKey = NotNull(oRow.Item("PK_COLUMN"), String.Empty)
}
Try
oItem.SQLResult = My.DatabaseECM.GetDatatable(oItem.SQLCommand)
Catch ex As Exception
oItem.SQLResult = Nothing
Logger.Error(ex)
End Try
Dim oKey As String = oItem.Entity & "-" & oItem.Scope
DetailForm.DetailDataList.Add(oKey, oItem)
Next
Return True
Catch ex As Exception
ShowErrorMessage(ex)
Return False
End Try
End Function
Private Sub TreeListMenu_FocusedNodeChanged(sender As Object, e As DevExpress.XtraTreeList.FocusedNodeChangedEventArgs) Handles TreeListMenu.FocusedNodeChanged
Try
If e.Node Is Nothing OrElse e.Node.Tag Is Nothing OrElse e.Node.Tag = String.Empty Then
@@ -247,7 +220,7 @@ Public Class frmAdmin_Start
End Function
Private Sub BarButtonItem9_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem9.ItemClick
Load_SQLData()
DetailForm.LoadData()
ShowStatus("Source SQL neu geladen")
End Sub