ZooFlow: Fix DetailPage, Fix BaseForm, Tweak Appearance
This commit is contained in:
@@ -15,8 +15,15 @@ Public Class frmAdmin_Start
|
||||
|
||||
Private DetailForm As ClassDetailForm
|
||||
|
||||
Public Sub New()
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
InitializeBaseForm(My.LogConfig)
|
||||
End Sub
|
||||
|
||||
Private Sub frmAdministration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Init(My.LogConfig)
|
||||
DetailForm = New ClassDetailForm(My.LogConfig)
|
||||
AddHandler DetailForm.DetailFormClosed, AddressOf DetailForm_Closed
|
||||
|
||||
@@ -32,21 +39,21 @@ Public Class frmAdmin_Start
|
||||
End Sub
|
||||
|
||||
Private Function Handle_LoadPage(Page As String) As Boolean
|
||||
Dim oKey = $"{Page}-OVERVIEW"
|
||||
|
||||
If DetailForm.DetailSettingsList.ContainsKey(Page) Then
|
||||
Dim oNode = DetailForm.DetailSettingsList.Item(Page)
|
||||
CurrentModule = oNode.Module
|
||||
labelTitle.Text = oNode.GridTitle
|
||||
btnAddRecord.Caption = oNode.NewRecordTitle
|
||||
Else
|
||||
MsgBox($"Page [{Page}] not found in AdminNodes! Exiting." & vbNewLine &
|
||||
"Check your definitions in the TreeList NodeEditor and in SourceSQL", MsgBoxStyle.Critical, Text)
|
||||
MsgBox($"Page [{Page}] not found! Exiting." & vbNewLine &
|
||||
"Check the [ENTITY_TITLE] Column in Table [TBZF_ADMIN_SOURCE_SQL]. It must match with the Tag of the corresponding Tree List nodes!", MsgBoxStyle.Critical, Text)
|
||||
Return False
|
||||
End If
|
||||
|
||||
' This dictionary can contain the same entity multiple times to save
|
||||
' OVERVIEW, INSERT, UPDATE, etc. data records, so we specifically look for the overview key
|
||||
Dim oKey = $"{Page}-OVERVIEW"
|
||||
|
||||
If DetailForm.DetailDataList.ContainsKey(oKey) Then
|
||||
|
||||
Dim oItem = DetailForm.DetailDataList.Item(oKey)
|
||||
@@ -140,34 +147,36 @@ Public Class frmAdmin_Start
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
GridControl1.DataSource = Source.SQLResult
|
||||
GridControl1.ForceInitialize()
|
||||
GridView1.PopulateColumns()
|
||||
ViewMain.ShowLoadingPanel()
|
||||
|
||||
If GridView1.Columns.Item(COLUMN_NAME_ACTIVE) Is Nothing Then
|
||||
GridMain.DataSource = Source.SQLResult
|
||||
GridMain.ForceInitialize()
|
||||
ViewMain.PopulateColumns()
|
||||
|
||||
If ViewMain.Columns.Item(COLUMN_NAME_ACTIVE) Is Nothing Then
|
||||
Dim oActiveColumn = New GridColumn() With {.FieldName = COLUMN_NAME_ACTIVE}
|
||||
GridView1.Columns.Add(oActiveColumn)
|
||||
ViewMain.Columns.Add(oActiveColumn)
|
||||
Style_ActiveColumn(oActiveColumn)
|
||||
Else
|
||||
Style_ActiveColumn(GridView1.Columns.Item(COLUMN_NAME_ACTIVE))
|
||||
Style_ActiveColumn(ViewMain.Columns.Item(COLUMN_NAME_ACTIVE))
|
||||
End If
|
||||
|
||||
With GridView1.Appearance.EvenRow
|
||||
With ViewMain.Appearance.EvenRow
|
||||
.BackColor = Color.Snow
|
||||
.Options.UseBackColor = True
|
||||
End With
|
||||
|
||||
With GridView1.Appearance.FocusedCell
|
||||
With ViewMain.Appearance.FocusedCell
|
||||
.BackColor = Color.Gold
|
||||
.Options.UseBackColor = True
|
||||
End With
|
||||
|
||||
With GridView1.OptionsBehavior
|
||||
With ViewMain.OptionsBehavior
|
||||
.Editable = False
|
||||
.ReadOnly = True
|
||||
End With
|
||||
|
||||
With GridView1.OptionsView
|
||||
With ViewMain.OptionsView
|
||||
.ShowAutoFilterRow = True
|
||||
.EnableAppearanceEvenRow = True
|
||||
.ShowIndicator = False
|
||||
@@ -175,17 +184,18 @@ Public Class frmAdmin_Start
|
||||
.ShowVerticalLines = DefaultBoolean.True
|
||||
End With
|
||||
|
||||
With GridView1.OptionsClipboard
|
||||
With ViewMain.OptionsClipboard
|
||||
.CopyColumnHeaders = DefaultBoolean.False
|
||||
End With
|
||||
|
||||
With GridView1.OptionsFind
|
||||
With ViewMain.OptionsFind
|
||||
.AlwaysVisible = True
|
||||
End With
|
||||
|
||||
AddHandler GridView1.KeyDown, AddressOf GridView1_KeyDown
|
||||
AddHandler ViewMain.KeyDown, AddressOf GridView1_KeyDown
|
||||
|
||||
GridView1.BestFitColumns()
|
||||
ViewMain.BestFitColumns()
|
||||
ViewMain.HideLoadingPanel()
|
||||
End Sub
|
||||
|
||||
Public Sub GridView1_KeyDown(sender As GridView, e As KeyEventArgs)
|
||||
@@ -199,7 +209,7 @@ Public Class frmAdmin_Start
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GridView1_RowClick(sender As Object, e As RowClickEventArgs) Handles GridView1.RowClick
|
||||
Private Sub GridView1_RowClick(sender As Object, e As RowClickEventArgs) Handles ViewMain.RowClick
|
||||
Try
|
||||
If e.Clicks = 2 And e.Button = MouseButtons.Left Then
|
||||
Dim oPrimaryKey = Get_PrimaryKey(e.RowHandle)
|
||||
@@ -217,7 +227,7 @@ Public Class frmAdmin_Start
|
||||
|
||||
Private Function Get_PrimaryKey(RowHandle As Integer)
|
||||
Try
|
||||
Dim oView As GridView = GridView1
|
||||
Dim oView As GridView = ViewMain
|
||||
Dim oRowView As DataRowView = oView.GetRow(RowHandle)
|
||||
Dim oItem As ClassDetailForm.DetailData = CurrentItem
|
||||
Dim oGuid = oRowView.Row.Item(oItem.PrimaryKey)
|
||||
@@ -253,11 +263,11 @@ Public Class frmAdmin_Start
|
||||
|
||||
Private Sub btnEditRecord_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnEditRecord.ItemClick
|
||||
Try
|
||||
If GridView1.FocusedRowHandle = GridControl.InvalidRowHandle Then
|
||||
If ViewMain.FocusedRowHandle = GridControl.InvalidRowHandle Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oPrimaryKey = Get_PrimaryKey(GridView1.FocusedRowHandle)
|
||||
Dim oPrimaryKey = Get_PrimaryKey(ViewMain.FocusedRowHandle)
|
||||
|
||||
If oPrimaryKey IsNot Nothing Then
|
||||
DetailForm.Handle_OpenDetail(oPrimaryKey, CurrentPage, False)
|
||||
|
||||
Reference in New Issue
Block a user