ZooFlow: Admin
This commit is contained in:
@@ -20,6 +20,7 @@ Public Class ClassDetailPages
|
||||
Public Event AnyControl_Changed As EventHandler(Of DetailPageEventArgs)
|
||||
Public Event CurrentPage_Changed As EventHandler(Of DetailPageEventArgs)
|
||||
|
||||
Private RaiseChangedEvents As Boolean = True
|
||||
Private CurrentPage As DetailPage
|
||||
|
||||
Public Property Current As DetailPage
|
||||
@@ -94,7 +95,9 @@ Public Class ClassDetailPages
|
||||
Items.Add(Page.TabPage.Name, Page)
|
||||
|
||||
AddHandler Page.BindingSource.AddingNew, Sub(sender As Object, e As EventArgs)
|
||||
RaiseChangedEvents = False
|
||||
Page.AddedWhoEdit.EditValue = Environment.UserName
|
||||
RaiseChangedEvents = True
|
||||
End Sub
|
||||
End Sub
|
||||
|
||||
@@ -122,6 +125,27 @@ Public Class ClassDetailPages
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function PrepareLoad() As Boolean
|
||||
Dim oItem = Items.
|
||||
Where(Function(Item) Item.Value.IsPrimary).
|
||||
FirstOrDefault()
|
||||
|
||||
Dim oPage = oItem.Value
|
||||
If oPage Is Nothing Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
If oPage.IsInsert Then
|
||||
RaiseChangedEvents = False
|
||||
oPage.BindingSource.AddNew()
|
||||
RaiseChangedEvents = True
|
||||
End If
|
||||
|
||||
CurrentPage = oPage
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Saves the pending changes to the binding source
|
||||
''' </summary>
|
||||
@@ -137,12 +161,17 @@ Public Class ClassDetailPages
|
||||
oPage.BindingSource.EndEdit()
|
||||
|
||||
If oPage.DataTable.GetChanges() IsNot Nothing Then
|
||||
RaiseChangedEvents = False
|
||||
HostForm.HasChanges = True
|
||||
|
||||
If oPage.IsInsert Then
|
||||
oPage.AddedWhoEdit.EditValue = My.Application.User.UserName
|
||||
Else
|
||||
oPage.ChangedWhoEdit.EditValue = My.Application.User.UserName
|
||||
End If
|
||||
|
||||
RaiseChangedEvents = True
|
||||
|
||||
oPage.BindingSource.EndEdit()
|
||||
Return True
|
||||
Else
|
||||
@@ -241,6 +270,10 @@ Public Class ClassDetailPages
|
||||
Private Sub Handle_EditValueChanged(sender As BaseEdit, e As EventArgs)
|
||||
Dim oControl As BaseEdit = sender
|
||||
|
||||
If RaiseChangedEvents = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
' Get the Layout Control containing the Edit Contol
|
||||
If TypeOf oControl.Parent Is LayoutControl Then
|
||||
Dim oLayoutControl As LayoutControl = oControl.Parent
|
||||
|
||||
@@ -125,6 +125,8 @@ Public Class frmAdmin_ClipboardWatcher
|
||||
}
|
||||
})
|
||||
|
||||
Pages.PrepareLoad()
|
||||
|
||||
AddHandler Pages.CurrentPage_Changed, AddressOf CurrentPage_Changed
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
@@ -156,22 +158,28 @@ Public Class frmAdmin_ClipboardWatcher
|
||||
ResetMessages()
|
||||
|
||||
If Pages.PrepareSave() = True Then
|
||||
Dim oPage = Pages.Current
|
||||
Try
|
||||
Dim oPage = Pages.Current
|
||||
|
||||
Select Case oPage.TabPage.Name
|
||||
Case PageProfile.Name
|
||||
TBCW_PROFILESTableAdapter.Update(oPage.DataTable)
|
||||
Select Case oPage.TabPage.Name
|
||||
Case PageProfile.Name
|
||||
TBCW_PROFILESTableAdapter.Update(oPage.DataTable)
|
||||
|
||||
Case PageDocumentSearch.Name
|
||||
TBCW_PROF_DOC_SEARCHTableAdapter.Update(oPage.DataTable)
|
||||
Case PageDocumentSearch.Name
|
||||
TBCW_PROF_DOC_SEARCHTableAdapter.Update(oPage.DataTable)
|
||||
|
||||
Case PageDataSearch.Name
|
||||
TBCW_PROF_DATA_SEARCHTableAdapter.Update(oPage.DataTable)
|
||||
End Select
|
||||
Case PageDataSearch.Name
|
||||
TBCW_PROF_DATA_SEARCHTableAdapter.Update(oPage.DataTable)
|
||||
End Select
|
||||
|
||||
oPage.IsInsert = False
|
||||
oPage.IsInsert = False
|
||||
|
||||
ShowStatus($"{oPage.Name} gespeichert!")
|
||||
ShowStatus($"{oPage.Name} gespeichert!")
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
End Try
|
||||
Else
|
||||
ShowStatus("Keine Änderungen!")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ Partial Class frmAdmin_Start
|
||||
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
|
||||
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
|
||||
Me.RibbonControl1.ShowToolbarCustomizeItem = False
|
||||
Me.RibbonControl1.Size = New System.Drawing.Size(1077, 159)
|
||||
Me.RibbonControl1.Size = New System.Drawing.Size(1077, 158)
|
||||
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
|
||||
Me.RibbonControl1.Toolbar.ShowCustomizeItem = False
|
||||
'
|
||||
@@ -381,10 +381,10 @@ Partial Class frmAdmin_Start
|
||||
'
|
||||
Me.RibbonStatusBar1.ItemLinks.Add(Me.labelStatus)
|
||||
Me.RibbonStatusBar1.ItemLinks.Add(Me.labelError)
|
||||
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 654)
|
||||
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 652)
|
||||
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
|
||||
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
|
||||
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1077, 22)
|
||||
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1077, 24)
|
||||
'
|
||||
'RibbonPage2
|
||||
'
|
||||
@@ -419,7 +419,7 @@ Partial Class frmAdmin_Start
|
||||
Me.TreeListMenu.OptionsView.ShowIndicator = False
|
||||
Me.TreeListMenu.OptionsView.ShowVertLines = False
|
||||
Me.TreeListMenu.SelectImageList = Me.MainTreeImages
|
||||
Me.TreeListMenu.Size = New System.Drawing.Size(193, 446)
|
||||
Me.TreeListMenu.Size = New System.Drawing.Size(193, 465)
|
||||
Me.TreeListMenu.TabIndex = 8
|
||||
'
|
||||
'TreeListColumn1
|
||||
@@ -450,18 +450,18 @@ Partial Class frmAdmin_Start
|
||||
Me.DockPanel1.Controls.Add(Me.DockPanel1_Container)
|
||||
Me.DockPanel1.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left
|
||||
Me.DockPanel1.ID = New System.Guid("ce81b5b5-eff5-4006-8018-548aa8413799")
|
||||
Me.DockPanel1.Location = New System.Drawing.Point(0, 159)
|
||||
Me.DockPanel1.Location = New System.Drawing.Point(0, 158)
|
||||
Me.DockPanel1.Name = "DockPanel1"
|
||||
Me.DockPanel1.OriginalSize = New System.Drawing.Size(200, 200)
|
||||
Me.DockPanel1.Size = New System.Drawing.Size(200, 495)
|
||||
Me.DockPanel1.Size = New System.Drawing.Size(200, 494)
|
||||
Me.DockPanel1.Text = "Übersicht"
|
||||
'
|
||||
'DockPanel1_Container
|
||||
'
|
||||
Me.DockPanel1_Container.Controls.Add(Me.TreeListMenu)
|
||||
Me.DockPanel1_Container.Location = New System.Drawing.Point(3, 46)
|
||||
Me.DockPanel1_Container.Location = New System.Drawing.Point(3, 26)
|
||||
Me.DockPanel1_Container.Name = "DockPanel1_Container"
|
||||
Me.DockPanel1_Container.Size = New System.Drawing.Size(193, 446)
|
||||
Me.DockPanel1_Container.Size = New System.Drawing.Size(193, 465)
|
||||
Me.DockPanel1_Container.TabIndex = 0
|
||||
'
|
||||
'TBIDB_ATTRIBUTEBindingSource
|
||||
@@ -511,9 +511,9 @@ Partial Class frmAdmin_Start
|
||||
'
|
||||
Me.Panel1.Controls.Add(Me.labelTitle)
|
||||
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
|
||||
Me.Panel1.Location = New System.Drawing.Point(200, 159)
|
||||
Me.Panel1.Location = New System.Drawing.Point(200, 158)
|
||||
Me.Panel1.Name = "Panel1"
|
||||
Me.Panel1.Size = New System.Drawing.Size(877, 9)
|
||||
Me.Panel1.Size = New System.Drawing.Size(877, 40)
|
||||
Me.Panel1.TabIndex = 8
|
||||
Me.Panel1.TabStop = True
|
||||
'
|
||||
@@ -524,7 +524,7 @@ Partial Class frmAdmin_Start
|
||||
Me.labelTitle.Location = New System.Drawing.Point(0, 0)
|
||||
Me.labelTitle.Name = "labelTitle"
|
||||
Me.labelTitle.Padding = New System.Windows.Forms.Padding(5, 0, 0, 0)
|
||||
Me.labelTitle.Size = New System.Drawing.Size(877, 9)
|
||||
Me.labelTitle.Size = New System.Drawing.Size(877, 40)
|
||||
Me.labelTitle.TabIndex = 0
|
||||
Me.labelTitle.Text = "labelTitle"
|
||||
Me.labelTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
@@ -714,11 +714,11 @@ Partial Class frmAdmin_Start
|
||||
'GridControl1
|
||||
'
|
||||
Me.GridControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GridControl1.Location = New System.Drawing.Point(200, 168)
|
||||
Me.GridControl1.Location = New System.Drawing.Point(200, 198)
|
||||
Me.GridControl1.MainView = Me.GridView1
|
||||
Me.GridControl1.MenuManager = Me.RibbonControl1
|
||||
Me.GridControl1.Name = "GridControl1"
|
||||
Me.GridControl1.Size = New System.Drawing.Size(877, 486)
|
||||
Me.GridControl1.Size = New System.Drawing.Size(877, 454)
|
||||
Me.GridControl1.TabIndex = 12
|
||||
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
|
||||
'
|
||||
@@ -785,7 +785,7 @@ Partial Class frmAdmin_Start
|
||||
Me.Controls.Add(Me.DockPanel1)
|
||||
Me.Controls.Add(Me.RibbonStatusBar1)
|
||||
Me.Controls.Add(Me.RibbonControl1)
|
||||
Me.IconOptions.SvgImage = CType(resources.GetObject("frmAdmin_Start.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
|
||||
Me.IconOptions.SvgImage = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources.actions_options
|
||||
Me.Name = "frmAdmin_Start"
|
||||
Me.Ribbon = Me.RibbonControl1
|
||||
Me.StatusBar = Me.RibbonStatusBar1
|
||||
|
||||
@@ -257,29 +257,6 @@
|
||||
<metadata name="DockManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>396, 17</value>
|
||||
</metadata>
|
||||
<data name="frmAdmin_Start.IconOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
|
||||
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
|
||||
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALoDAAAC77u/
|
||||
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
|
||||
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
|
||||
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
|
||||
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
|
||||
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlJlZHtmaWxsOiNEMTFDMUM7fQoJLkJs
|
||||
YWNre2ZpbGw6IzcyNzI3Mjt9CgkuQmx1ZXtmaWxsOiMxMTc3RDc7fQoJLkdyZWVue2ZpbGw6IzAzOUMy
|
||||
Mzt9CgkuWWVsbG93e2ZpbGw6I0ZGQjExNTt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh
|
||||
Y2l0eTowLjU7fQoJLnN0MXtvcGFjaXR5OjAuNzU7fQoJLnN0MntvcGFjaXR5OjAuMjU7fQo8L3N0eWxl
|
||||
Pg0KICA8ZyBpZD0iUGFnZVNldHVwIj4NCiAgICA8cGF0aCBkPSJNMTkuMiwyNkg4VjZoMTB2NWMwLDAu
|
||||
NiwwLjQsMSwxLDFoNXY5LjJsMiwyVjExbC03LTdIN0M2LjQsNCw2LDQuNCw2LDV2MjJjMCwwLjYsMC40
|
||||
LDEsMSwxaDE0LjJMMTkuMiwyNnoiIGNsYXNzPSJCbGFjayIgLz4NCiAgICA8cGF0aCBkPSJNMjcuNiwy
|
||||
Ny42bC02LjItNi4yYzAuNC0wLjcsMC42LTEuNSwwLjYtMi40YzAtMi44LTIuMi01LTUtNWMtMC44LDAt
|
||||
MS41LDAuMi0yLjEsMC41bDIuNywyLjcgICBjMC42LDAuNiwwLjYsMS43LDAsMi40cy0xLjcsMC42LTIu
|
||||
NCwwbC0yLjctMi43QzEyLjIsMTcuNSwxMiwxOC4yLDEyLDE5YzAsMi44LDIuMiw1LDUsNWMwLjksMCwx
|
||||
LjctMC4yLDIuNC0wLjZsNi4yLDYuMiAgIGMwLjYsMC42LDEuNCwwLjYsMiwwbDAsMEMyOC4xLDI5LDI4
|
||||
LjEsMjguMSwyNy42LDI3LjZ6IiBjbGFzcz0iQmx1ZSIgLz4NCiAgPC9nPg0KPC9zdmc+Cw==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="TBIDB_ATTRIBUTEBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>691, 17</value>
|
||||
</metadata>
|
||||
|
||||
@@ -15,6 +15,15 @@ Public Class frmAdmin_Start
|
||||
|
||||
Private DetailForm As ClassDetailForm
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New(My.LogConfig)
|
||||
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
End Sub
|
||||
|
||||
Private Sub frmAdministration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
DetailForm = New ClassDetailForm(My.LogConfig)
|
||||
AddHandler DetailForm.DetailFormClosed, AddressOf DetailForm_Closed
|
||||
@@ -200,6 +209,8 @@ Public Class frmAdmin_Start
|
||||
|
||||
If oPrimaryKey IsNot Nothing Then
|
||||
DetailForm.Handle_OpenDetail(oPrimaryKey, CurrentPage, False)
|
||||
Else
|
||||
Throw New ArgumentNullException("PrimaryKey")
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -239,7 +250,7 @@ Public Class frmAdmin_Start
|
||||
Try
|
||||
DetailForm.Handle_OpenDetail(Nothing, CurrentPage, True)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
ShowErrorMessage(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user