ZooFlow: Admin

This commit is contained in:
Jonathan Jenne
2021-02-19 16:13:03 +01:00
parent 07d3db4741
commit d63d90f0d2
21 changed files with 594 additions and 412 deletions

View File

@@ -44,12 +44,12 @@ Public Class frmAdmin_Start
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")
.PrimaryKey = oRow.Item("PK_COLUMN").ToString,
.SQL = oRow.Item("SQL_COMMAND").ToString,
.Title = oRow.Item("ENTITY_TITLE").ToString
}
SourceCommands.Add(oRow.Item("ENTITY_TITLE"), oSource)
SourceCommands.Add(oRow.Item("ENTITY_TITLE").ToString, oSource)
Next
Return True
Catch ex As Exception
@@ -125,7 +125,7 @@ Public Class frmAdmin_Start
Display_RibbonPage(RibbonPage_ClipboardWatcher)
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
Load_Grid(oTable, oSource.PrimaryKey, GridControl2)
Load_Grid(oTable, oSource.PrimaryKey, GridCWProfiles)
Case IDB_SOURCE_SQL
Display_Tab(XtraTabPage_IDB)
@@ -202,7 +202,8 @@ Public Class frmAdmin_Start
End Try
End Sub
Private Sub View_DoubleClick(sender As Object, e As EventArgs) Handles ViewAttributes.DoubleClick, ViewSourceSQL.DoubleClick
Private Sub View_DoubleClick(sender As Object, e As EventArgs) Handles _
ViewAttributes.DoubleClick, ViewSourceSQL.DoubleClick, ViewCWProfiles.DoubleClick
Dim oView As GridView = TryCast(sender, GridView)
Dim hitInfo As GridHitInfo = oView.CalcHitInfo(TryCast(e, DXMouseEventArgs).Location)
If hitInfo.InDataRow Then
@@ -213,11 +214,14 @@ Public Class frmAdmin_Start
Select Case oView.Name
Case ViewAttributes.Name
Load_Attributes(oPrimaryKey)
Load_Attribute(oPrimaryKey)
Case ViewSourceSQL.Name
Load_SourceSql(oPrimaryKey)
Case ViewCWProfiles.Name
Load_CWProfile(oPrimaryKey)
End Select
End If
@@ -227,7 +231,7 @@ Public Class frmAdmin_Start
End If
End Sub
Private Sub Load_Attributes(PrimaryKey As Integer)
Private Sub Load_Attribute(PrimaryKey As Integer)
Try
Dim oForm As New frmAdmin_IDBAttribute(PrimaryKey)
oForm.ShowDialog()
@@ -257,12 +261,27 @@ Public Class frmAdmin_Start
End Try
End Sub
Private Sub Load_CWProfile(PrimaryKey As Integer)
Try
Dim oForm As New frmAdmin_CWProfile(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, GridCWProfiles)
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)
Load_Attributes(oPrimaryKey)
Load_Attribute(oPrimaryKey)
End If
Catch ex As Exception
ShowError(ex)