ZooFlow: Add Base Form

This commit is contained in:
Jonathan Jenne
2021-02-12 12:47:40 +01:00
parent 4108410b15
commit 403c87bde7
12 changed files with 156 additions and 114 deletions

View File

@@ -8,15 +8,15 @@ Imports DevExpress.XtraTab
Imports DigitalData.Modules.Logging
Public Class frmAdmin_Start
Inherits frmAdmin_Base
Private Const IDB_START = "IDB_START"
Private Const IDB_ATTRIBUTES = "IDB_ATTRIBUTES"
Private Const IDB_BUSINESS_ENTITY = "IDB_BUSINESS_ENTITY"
Private Const GLOBIX = "GLOBIX"
Private Const CLIPBOARD_WATCHER = "CLIPBOARD_WATCHER"
Private Logger As Logger
Private PrimaryKey As String = Nothing
Private SourceCommands As New Dictionary(Of String, SourceSql)
Private CurrentPage As String
@@ -28,8 +28,6 @@ Public Class frmAdmin_Start
End Class
Private Sub frmAdministration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Logger = My.LogConfig.GetLogger
Load_SourceSql()
TreeListMenu.ExpandAll()
@@ -62,7 +60,7 @@ Public Class frmAdmin_Start
End If
Next
Catch ex As Exception
Logger.Error(ex)
ShowError(ex)
End Try
End Sub
@@ -76,41 +74,46 @@ Public Class frmAdmin_Start
End If
Next
Catch ex As Exception
Logger.Error(ex)
ShowError(ex)
End Try
End Sub
Private Sub TreeList1_FocusedNodeChanged(sender As Object, e As DevExpress.XtraTreeList.FocusedNodeChangedEventArgs) Handles TreeListMenu.FocusedNodeChanged
If e.Node Is Nothing OrElse e.Node.Tag Is Nothing Then
Exit Sub
End If
Try
If e.Node Is Nothing OrElse e.Node.Tag Is Nothing Then
Exit Sub
End If
CurrentPage = e.Node.Tag.ToString
Dim oSource As SourceSql = SourceCommands.Item(CurrentPage)
CurrentPage = e.Node.Tag.ToString
Dim oSource As SourceSql = SourceCommands.Item(CurrentPage)
Select Case e.Node.Tag.ToString
Case IDB_START
Display_Tab(XtraTabPage_IDB, XtraTabControl)
Select Case e.Node.Tag.ToString
Case IDB_START
Display_Tab(XtraTabPage_IDB, XtraTabControl)
Case IDB_ATTRIBUTES
Display_Tab(XtraTabPage_IDB, XtraTabControl)
Display_Tab(XtraTabPageIDB_Attributes_New, XtraTabControlIDB)
Case IDB_ATTRIBUTES
Display_Tab(XtraTabPage_IDB, XtraTabControl)
Display_Tab(XtraTabPageIDB_Attributes_New, XtraTabControlIDB)
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
Load_Grid(oTable, oSource.PrimaryKey, GridAttributes)
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
Load_Grid(oTable, oSource.PrimaryKey, GridAttributes)
Case IDB_BUSINESS_ENTITY
Case IDB_BUSINESS_ENTITY
'DisplayTab(XtraTabPage_Entities)
Case GLOBIX
Display_Tab(XtraTabPage_GlobalIndexer, XtraTabControl)
Display_RibbonPage(RibbonPage_GlobalIndexer)
Case GLOBIX
Display_Tab(XtraTabPage_GlobalIndexer, XtraTabControl)
Display_RibbonPage(RibbonPage_GlobalIndexer)
Case CLIPBOARD_WATCHER
Display_Tab(XtraTabPage_ClipboardWatcher, XtraTabControl)
Display_RibbonPage(RibbonPage_ClipboardWatcher)
Case CLIPBOARD_WATCHER
Display_Tab(XtraTabPage_ClipboardWatcher, XtraTabControl)
Display_RibbonPage(RibbonPage_ClipboardWatcher)
End Select
Catch ex As Exception
ShowError(ex)
End Try
End Select
End Sub
Private Sub Load_Grid(DataSource As DataTable, PrimaryKey As String, GridControl As GridControl)
@@ -170,8 +173,7 @@ Public Class frmAdmin_Start
oGridView.BestFitColumns()
Catch ex As Exception
MsgBox("Fehler beim Laden.", MsgBoxStyle.Critical, Text)
Logger.Error(ex)
ShowError(ex)
End Try
End Sub
@@ -181,21 +183,40 @@ Public Class frmAdmin_Start
If hitInfo.InDataRow Then
Try
Dim oRow As DataRow = ViewAttributes.GetFocusedDataRow
Dim oPrimaryKey As Integer = oRow.Item(PrimaryKey)
Dim oForm As New frmAdmin_IDBAttribute(oPrimaryKey)
GridView1.ShowLoadingPanel()
oForm.ShowDialog()
GridView1.HideLoadingPanel()
If oForm.HasChanges Then
Dim oSource As SourceSql = SourceCommands.Item(CurrentPage)
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
Load_Grid(oTable, oSource.PrimaryKey, GridAttributes)
If oRow IsNot Nothing Then
Dim oPrimaryKey As Integer = oRow.Item(PrimaryKey)
LoadAttribute(oPrimaryKey)
End If
Catch ex As Exception
Logger.Error(ex)
ShowError(ex)
End Try
End If
End Sub
Private Sub LoadAttribute(PrimaryKey As Integer)
Try
Dim oForm As New frmAdmin_IDBAttribute(PrimaryKey)
oForm.ShowDialog()
If oForm.HasChanges Then
Dim oSource As SourceSql = SourceCommands.Item(CurrentPage)
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
Load_Grid(oTable, oSource.PrimaryKey, GridAttributes)
End If
Catch ex As Exception
ShowError(ex)
End Try
End Sub
Private Sub BarButtonItem7_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem7.ItemClick
Try
Dim oRow As DataRow = ViewAttributes.GetFocusedDataRow
If oRow IsNot Nothing Then
Dim oPrimaryKey As Integer = oRow.Item(PrimaryKey)
LoadAttribute(oPrimaryKey)
End If
Catch ex As Exception
ShowError(ex)
End Try
End Sub
End Class