ZooFlow: Add Attribute Edit Form
This commit is contained in:
@@ -18,6 +18,8 @@ Public Class frmAdmin_Start
|
||||
Private PrimaryKey As String = Nothing
|
||||
|
||||
Private SourceCommands As New Dictionary(Of String, SourceSql)
|
||||
Private CurrentPage As String
|
||||
|
||||
|
||||
Private Class SourceSql
|
||||
Public Title As String
|
||||
@@ -83,6 +85,9 @@ Public Class frmAdmin_Start
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
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)
|
||||
@@ -91,7 +96,6 @@ Public Class frmAdmin_Start
|
||||
Display_Tab(XtraTabPage_IDB, XtraTabControl)
|
||||
Display_Tab(XtraTabPageIDB_Attributes_New, XtraTabControlIDB)
|
||||
|
||||
Dim oSource As SourceSql = SourceCommands.Item(e.Node.Tag.ToString)
|
||||
Dim oTable As DataTable = My.Database.GetDatatable(oSource.SQL)
|
||||
Load_Grid(oTable, oSource.PrimaryKey, GridAttributes)
|
||||
|
||||
@@ -135,29 +139,6 @@ Public Class frmAdmin_Start
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub TBIDB_ATTRIBUTEBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
|
||||
Validate()
|
||||
TBIDB_ATTRIBUTEBindingSource.EndEdit()
|
||||
TableAdapterManager.UpdateAll(DSIDB_Stammdaten)
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItemSaveAttribute_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemSaveAttribute.ItemClick
|
||||
'Save_Attribute()
|
||||
End Sub
|
||||
'Sub Save_Attribute()
|
||||
' Try
|
||||
' TBIDB_ATTRIBUTEBindingSource.EndEdit()
|
||||
' If Not IsNothing(DSIDB_Stammdaten.GetChanges) Then
|
||||
' CHANGED_WHOTextBox.Text = My.Application.User.UserName
|
||||
' TBIDB_ATTRIBUTEBindingSource.EndEdit()
|
||||
' TBIDB_ATTRIBUTETableAdapter.Update(DSIDB_Stammdaten.TBIDB_ATTRIBUTE)
|
||||
' labelStatus.Caption = $"IDB Attribute saved - {Now.ToLongTimeString}"
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' 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)
|
||||
@@ -166,7 +147,16 @@ Public Class frmAdmin_Start
|
||||
Dim oRow As DataRow = ViewAttributes.GetFocusedDataRow
|
||||
Dim oPrimaryKey As Integer = oRow.Item(PrimaryKey)
|
||||
Dim oForm As New frmAdmin_Attribute(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)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
|
||||
Reference in New Issue
Block a user