ZooFlow: Add frmAdmin_SourceSQL
This commit is contained in:
@@ -15,6 +15,7 @@ Public Class frmAdmin_Start
|
||||
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 PrimaryKey As String = Nothing
|
||||
Private SourceCommands As New Dictionary(Of String, SourceSql)
|
||||
@@ -28,7 +29,7 @@ Public Class frmAdmin_Start
|
||||
End Class
|
||||
|
||||
Private Sub frmAdministration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Load_SourceSql()
|
||||
Load_SQLData()
|
||||
|
||||
TreeListMenu.ExpandAll()
|
||||
|
||||
@@ -36,7 +37,7 @@ Public Class frmAdmin_Start
|
||||
XtraTabControl.ShowTabHeader = DefaultBoolean.False
|
||||
End Sub
|
||||
|
||||
Private Sub Load_SourceSql()
|
||||
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
|
||||
@@ -109,6 +110,13 @@ Public Class frmAdmin_Start
|
||||
Display_Tab(XtraTabPage_ClipboardWatcher, XtraTabControl)
|
||||
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, GridSourceSQL)
|
||||
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ShowError(ex)
|
||||
@@ -177,15 +185,24 @@ Public Class frmAdmin_Start
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub ViewAttributes_DoubleClick(sender As Object, e As EventArgs) Handles ViewAttributes.DoubleClick
|
||||
Dim view As GridView = TryCast(sender, GridView)
|
||||
Dim hitInfo As GridHitInfo = view.CalcHitInfo((TryCast(e, DXMouseEventArgs)).Location)
|
||||
Private Sub View_DoubleClick(sender As Object, e As EventArgs) Handles ViewAttributes.DoubleClick, ViewSourceSQL.DoubleClick
|
||||
Dim oView As GridView = TryCast(sender, GridView)
|
||||
Dim hitInfo As GridHitInfo = oView.CalcHitInfo(TryCast(e, DXMouseEventArgs).Location)
|
||||
If hitInfo.InDataRow Then
|
||||
Try
|
||||
Dim oRow As DataRow = ViewAttributes.GetFocusedDataRow
|
||||
Dim oRow As DataRow = oView.GetFocusedDataRow
|
||||
If oRow IsNot Nothing Then
|
||||
Dim oPrimaryKey As Integer = oRow.Item(PrimaryKey)
|
||||
LoadAttribute(oPrimaryKey)
|
||||
|
||||
Select Case oView.Name
|
||||
Case ViewAttributes.Name
|
||||
Load_Attributes(oPrimaryKey)
|
||||
|
||||
Case ViewSourceSQL.Name
|
||||
Load_SourceSql(oPrimaryKey)
|
||||
|
||||
End Select
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ShowError(ex)
|
||||
@@ -193,7 +210,7 @@ Public Class frmAdmin_Start
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LoadAttribute(PrimaryKey As Integer)
|
||||
Private Sub Load_Attributes(PrimaryKey As Integer)
|
||||
Try
|
||||
Dim oForm As New frmAdmin_IDBAttribute(PrimaryKey)
|
||||
oForm.ShowDialog()
|
||||
@@ -208,12 +225,27 @@ Public Class frmAdmin_Start
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub Load_SourceSql(PrimaryKey As Integer)
|
||||
Try
|
||||
Dim oForm As New frmAdmin_SourceSQL(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, GridSourceSQL)
|
||||
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)
|
||||
Load_Attributes(oPrimaryKey)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ShowError(ex)
|
||||
|
||||
Reference in New Issue
Block a user