ZooFlow: Admin
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
Public Class frmAdmin_SourceSQL
|
||||
Imports DevExpress.XtraEditors.DXErrorProvider
|
||||
Imports DevExpress.XtraLayout
|
||||
|
||||
Public Class frmAdmin_SourceSQL
|
||||
Implements frmAdmin_Interface
|
||||
|
||||
Public Property PrimaryKey As Integer Implements frmAdmin_Interface.PrimaryKey
|
||||
@@ -15,6 +18,57 @@
|
||||
Me.PrimaryKey = PrimaryKey
|
||||
End Sub
|
||||
|
||||
Private Sub frmAdmin_SourceSQL_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Try
|
||||
If IsInsert Then
|
||||
TBZF_ADMIN_SOURCE_SQLBindingSource.AddNew()
|
||||
Else
|
||||
TBZF_ADMIN_SOURCE_SQLTableAdapter.Fill(DSIDB_Stammdaten.TBZF_ADMIN_SOURCE_SQL, PrimaryKey)
|
||||
End If
|
||||
|
||||
ValidationHelper()
|
||||
Catch ex As Exception
|
||||
ShowError(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub ValidationHelper()
|
||||
Dim oTable As DataTable = DSIDB_Stammdaten.TBZF_ADMIN_SOURCE_SQL
|
||||
Dim oProvider As DXValidationProvider = DxValidationProvider1
|
||||
Dim oRootControl As Control = LayoutControl1
|
||||
Dim oControls As List(Of Control) = oRootControl.Controls.
|
||||
OfType(Of Control).
|
||||
ToList()
|
||||
|
||||
Dim oBoundControls = ListBoundControls(oControls)
|
||||
|
||||
Console.WriteLine(oBoundControls.Count)
|
||||
|
||||
For Each oControl As Control In oBoundControls
|
||||
Dim oBinding As Binding = oControl.DataBindings.Item(0)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
Public Function ListBoundControls(Controls As List(Of Control)) As List(Of Control)
|
||||
Dim oControlList As New List(Of Control)
|
||||
|
||||
For Each oControl As Control In Controls
|
||||
If oControl.DataBindings IsNot Nothing AndAlso oControl.DataBindings.Count > 0 Then
|
||||
oControlList.Add(oControl)
|
||||
End If
|
||||
|
||||
If oControl.Controls IsNot Nothing AndAlso oControl.Controls.Count > 0 Then
|
||||
Dim oControls As New List(Of Control)
|
||||
oControls.AddRange(oControl.Controls.OfType(Of Control))
|
||||
|
||||
oControlList.AddRange(ListBoundControls(oControls))
|
||||
End If
|
||||
Next
|
||||
|
||||
Return oControlList
|
||||
End Function
|
||||
|
||||
Public Function SaveData() As Boolean Implements frmAdmin_Interface.SaveData
|
||||
Try
|
||||
|
||||
@@ -51,17 +105,7 @@
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub frmAdmin_SourceSQL_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Try
|
||||
If IsInsert Then
|
||||
TBZF_ADMIN_SOURCE_SQLBindingSource.AddNew()
|
||||
Else
|
||||
TBZF_ADMIN_SOURCE_SQLTableAdapter.Fill(DSIDB_Stammdaten.TBZF_ADMIN_SOURCE_SQL, PrimaryKey)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ShowError(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ResetMessages()
|
||||
labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
|
||||
|
||||
Reference in New Issue
Block a user