merge administration
This commit is contained in:
@@ -13,9 +13,9 @@ Public Class frmAdmin_Start
|
||||
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 Const SOURCE_SQL = "SOURCE_SQL"
|
||||
Private Const IDB_SOURCE_SQL = "IDB_SOURCE_SQL"
|
||||
Private Const GLOBIX_PROFILES = "GLOBIX_PROFILES"
|
||||
Private Const CW_PROFILES = "CW_PROFILES"
|
||||
|
||||
Private PrimaryKey As String = Nothing
|
||||
Private SourceCommands As New Dictionary(Of String, SourceSql)
|
||||
@@ -37,23 +37,34 @@ Public Class frmAdmin_Start
|
||||
XtraTabControl.ShowTabHeader = DefaultBoolean.False
|
||||
End Sub
|
||||
|
||||
Private Sub Load_SQLData()
|
||||
Dim oTable As DataTable = My.Database.GetDatatable("SELECT * FROM TBZF_ADMIN_SOURCE_SQL")
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oSource As New SourceSql With {
|
||||
.PrimaryKey = oRow.Item("PK_COLUMN"),
|
||||
.SQL = oRow.Item("SQL_COMMAND"),
|
||||
.Title = oRow.Item("ENTITY_TITLE")
|
||||
}
|
||||
|
||||
SourceCommands.Add(oRow.Item("ENTITY_TITLE"), oSource)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub Display_Tab(pPageToDisplay As XtraTabPage, pTabControl As XtraTabControl)
|
||||
Private Function Load_SQLData() As Boolean
|
||||
Try
|
||||
For Each oDocument As XtraTabPage In pTabControl.TabPages
|
||||
Dim oTable As DataTable = My.Database.GetDatatable("SELECT * FROM TBZF_ADMIN_SOURCE_SQL")
|
||||
SourceCommands.Clear()
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oSource As New SourceSql With {
|
||||
.PrimaryKey = oRow.Item("PK_COLUMN"),
|
||||
.SQL = oRow.Item("SQL_COMMAND"),
|
||||
.Title = oRow.Item("ENTITY_TITLE")
|
||||
}
|
||||
|
||||
SourceCommands.Add(oRow.Item("ENTITY_TITLE"), oSource)
|
||||
Next
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Sub Display_Tab(pPageToDisplay As XtraTabPage)
|
||||
Try
|
||||
If pPageToDisplay.TabControl Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
For Each oDocument As XtraTabPage In pPageToDisplay.TabControl.TabPages
|
||||
If oDocument.Name = pPageToDisplay.Name Then
|
||||
oDocument.PageVisible = True
|
||||
Else
|
||||
@@ -69,9 +80,7 @@ Public Class frmAdmin_Start
|
||||
Try
|
||||
For Each oPage As RibbonPage In RibbonControl1.Pages
|
||||
If oPage.Name = PageToDisplay.Name Then
|
||||
oPage.Visible = True
|
||||
Else
|
||||
oPage.Visible = False
|
||||
RibbonControl1.SelectedPage = PageToDisplay
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
@@ -86,15 +95,19 @@ Public Class frmAdmin_Start
|
||||
End If
|
||||
|
||||
CurrentPage = e.Node.Tag.ToString
|
||||
Dim oSource As SourceSql = SourceCommands.Item(CurrentPage)
|
||||
|
||||
Dim oSource As SourceSql
|
||||
If SourceCommands.ContainsKey(CurrentPage) Then
|
||||
oSource = SourceCommands.Item(CurrentPage)
|
||||
End If
|
||||
|
||||
Select Case e.Node.Tag.ToString
|
||||
Case IDB_START
|
||||
Display_Tab(XtraTabPage_IDB, XtraTabControl)
|
||||
Display_Tab(XtraTabPage_IDB)
|
||||
|
||||
Case IDB_ATTRIBUTES
|
||||
Display_Tab(XtraTabPage_IDB, XtraTabControl)
|
||||
Display_Tab(XtraTabPageIDB_Attributes_New, XtraTabControlIDB)
|
||||
Display_Tab(XtraTabPage_IDB)
|
||||
Display_Tab(XtraTabPageIDB_Attributes_New)
|
||||
|
||||
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
|
||||
Load_Grid(oTable, oSource.PrimaryKey, GridAttributes)
|
||||
@@ -102,17 +115,21 @@ Public Class frmAdmin_Start
|
||||
Case IDB_BUSINESS_ENTITY
|
||||
'DisplayTab(XtraTabPage_Entities)
|
||||
|
||||
Case GLOBIX
|
||||
Display_Tab(XtraTabPage_GlobalIndexer, XtraTabControl)
|
||||
Case GLOBIX_PROFILES
|
||||
Display_Tab(XtraTabPage_GlobalIndexer)
|
||||
Display_RibbonPage(RibbonPage_GlobalIndexer)
|
||||
|
||||
Case CLIPBOARD_WATCHER
|
||||
Display_Tab(XtraTabPage_ClipboardWatcher, XtraTabControl)
|
||||
Case CW_PROFILES
|
||||
Display_Tab(XtraTabPage_ClipboardWatcher)
|
||||
Display_Tab(XtraTabPageCWProfiles)
|
||||
Display_RibbonPage(RibbonPage_ClipboardWatcher)
|
||||
|
||||
Case SOURCE_SQL
|
||||
Display_Tab(XtraTabPage_IDB, XtraTabControl)
|
||||
Display_Tab(XtraTabPageIDB_SourceSQL, XtraTabControlIDB)
|
||||
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
|
||||
Load_Grid(oTable, oSource.PrimaryKey, GridControl2)
|
||||
|
||||
Case IDB_SOURCE_SQL
|
||||
Display_Tab(XtraTabPage_IDB)
|
||||
Display_Tab(XtraTabPageIDB_SourceSQL)
|
||||
|
||||
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
|
||||
Load_Grid(oTable, oSource.PrimaryKey, GridSourceSQL)
|
||||
@@ -251,4 +268,18 @@ Public Class frmAdmin_Start
|
||||
ShowError(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem9_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem9.ItemClick
|
||||
Load_SQLData()
|
||||
ShowStatus("Source SQL neu geladen")
|
||||
End Sub
|
||||
|
||||
Private Sub ShowStatus(v As String)
|
||||
labelStatus.Caption = v
|
||||
labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
|
||||
End Sub
|
||||
|
||||
Private Sub ResetStatus()
|
||||
labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user