MS Globix Admin

This commit is contained in:
2021-07-08 10:34:58 +02:00
parent ccd0e1d1fb
commit e254f7fa70
13 changed files with 1540 additions and 2571 deletions

View File

@@ -1,4 +1,5 @@
Imports DigitalData.Modules.Logging
Imports DevExpress.XtraLayout
Imports DigitalData.Modules.Logging
Public Class frmAdmin_Globix
Implements IAdminForm
@@ -6,6 +7,7 @@ Public Class frmAdmin_Globix
Public Property IsInsert As Boolean = False Implements IAdminForm.IsInsert
Public Property PrimaryKey As Integer Implements IAdminForm.PrimaryKey
Private Pages As ClassDetailPages
Public Sub New(PrimaryKey As Integer, Optional IsInsert As Boolean = False)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
@@ -15,23 +17,67 @@ Public Class frmAdmin_Globix
Me.IsInsert = IsInsert
End Sub
Private Sub frmAdmin_Attribute_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Private Sub frmAdmin_Globix_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Init(My.LogConfig)
Try
TBDD_DOKUMENTARTTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString
Me.TBDD_DOKUMENTARTTableAdapter.Fill(Me.GlobixDataset.TBDD_DOKUMENTART, PrimaryKey)
TBDD_INDEX_MANTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString
Load_TabData()
' Add Focus Handler to all controls in all LayoutControls
Dim oLayoutControls = New List(Of LayoutControl) From {LayoutControlProfile, LayoutControlManIndexe, LayoutControlAutoIndexe, LayoutControlRework}
Pages = New ClassDetailPages(My.LogConfig, Me, oLayoutControls)
Pages.AddRange({
New ClassDetailPages.PrimaryPage(IsInsert) With {
.Name = "Profil",
.TabPage = XtraTabPageProfile,
.BindingSource = TBDD_DOKUMENTARTBindingSource,
.DataTable = GlobixDataset.TBDD_DOKUMENTART,
.AddedWhoEdit = TextEditErstelltWer,
.ChangedWhoEdit = TextEditGeandertWer
},
New ClassDetailPages.DetailPage With {
.Name = "ManIndexe",
.TabPage = XtraTabPageManIndexe,
.BindingSource = TBDD_INDEX_MANBindingSource,
.DataTable = GlobixDataset.TBDD_INDEX_MAN,
.AddedWhoEdit = TextEditAddedWho_ManIndex,
.ChangedWhoEdit = TextEditChangedWho_ManIndex
}
})
Pages.PrepareLoad()
AddHandler Pages.CurrentPage_Changed, AddressOf CurrentPage_Changed
Catch ex As Exception
ShowErrorMessage(ex)
End Try
End Sub
Sub Load_TabData()
Load_INDEXMAN()
End Sub
Private Sub Load_INDEXMAN()
Try
Me.TBDD_INDEX_MANTableAdapter.Fill(Me.GlobixDataset.TBDD_INDEX_MAN, PrimaryKey)
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonSave.ItemClick
ResetMessages()
Catch ex As System.Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Load IndexeManuell: ")
End Try
End Sub
Private Sub CurrentPage_Changed(sender As Object, e As ClassDetailPages.DetailPageEventArgs)
If Not IsNothing(e.Page) Then
If e.Page.IsPrimary = True Then
BarButtonNew.Enabled = False
Else
BarButtonNew.Enabled = True
End If
If SaveData() And HasChanges Then
ShowStatus("Attribute gespeichert!")
RibbonPageGroup1.Text = e.Page.Name
End If
End Sub
Private Sub ResetMessages()
labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End Sub
@@ -41,39 +87,76 @@ Public Class frmAdmin_Globix
labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonSaveExit.ItemClick
ResetMessages()
If SaveData() Then
Close()
End If
End Sub
Public Function SaveData() As Boolean
Try
TBDD_DOKUMENTARTBindingSource.EndEdit()
If DSIDB_Stammdaten.VWIDB_BE_ATTRIBUTE.GetChanges() IsNot Nothing Then
HasChanges = True
If IsInsert Then
txtAddedWho.EditValue = My.Application.User.UserName
Else
txtChangedWho.EditValue = My.Application.User.UserName
End If
TBDD_DOKUMENTARTBindingSource.EndEdit()
TBDD_DOKUMENTARTTableAdapter.Update(GlobixDataset.TBDD_DOKUMENTART)
End If
Return True
Catch ex As Exception
ShowErrorMessage(ex)
Return False
End Try
End Function
Public Function DeleteData() As Boolean Implements IAdminForm.DeleteData
Throw New NotImplementedException()
End Function
Private Sub SimpleButton2_Click(sender As Object, e As EventArgs)
End Sub
Private Sub XtraTabControl1_Click(sender As Object, e As EventArgs) Handles XtraTabControl1.Click
End Sub
Private Sub SUGGESTIONCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles SUGGESTIONCheckBox.CheckedChanged
If SUGGESTIONCheckBox.CheckState = CheckState.Checked Then
btneditSQLmanIndex.Enabled = True
Else
btneditSQLmanIndex.Enabled = False
End If
End Sub
Private Sub BarButtonSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonSave.ItemClick
ResetMessages()
If Pages.PrepareSave() = True Then
Try
Dim oPage = Pages.Current
Select Case oPage.TabPage.Name
Case XtraTabPageProfile.Name
TBDD_INDEX_MANTableAdapter.Update(oPage.DataTable)
Case XtraTabPageManIndexe.Name
TBDD_INDEX_MANTableAdapter.Update(oPage.DataTable)
End Select
oPage.IsInsert = False
ShowStatus($"{oPage.Name} gespeichert!")
Catch ex As Exception
ShowErrorMessage(ex)
End Try
Else
ShowStatus("Keine Änderungen!")
End If
End Sub
Private Sub BarButtonNew_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonNew.ItemClick
Pages.Current.IsInsert = True
AddData()
End Sub
Public Function AddData() As Boolean
Dim oPage = Pages.Current
If Pages.Current Is Nothing Then
Return False
End If
If oPage.IsPrimary = False Then
oPage.DataTable.Columns.Item("DOK_ID").DefaultValue = PrimaryKey
End If
Dim oNewRecord As DataRowView = oPage.BindingSource.AddNew()
Return True
End Function
End Class