This commit is contained in:
2022-05-24 08:48:33 +02:00
parent 4f04ef9cc8
commit 1be949b1b6
6 changed files with 187 additions and 128 deletions

View File

@@ -4,6 +4,9 @@
Public Property HasChanges As Boolean = False Implements IAdminForm.HasChanges
Public Property IsInsert As Boolean = False Implements IAdminForm.IsInsert
Public Property PrimaryKey As Integer Implements IAdminForm.PrimaryKey
Private Const ConstDetail = "Detail"
Private Const ConstTranslate = "Translate"
Private Property oMode As String = "Detail"
Public Sub New(PrimaryKey As Integer, Optional IsInsert As Boolean = False)
' Dieser Aufruf ist für den Designer erforderlich.
@@ -35,7 +38,16 @@
End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
ResetMessages()
Dim oGetMax As Boolean = False
If IsInsert Then
oGetMax = True
End If
If SaveData() And HasChanges Then
If IsInsert Then
Dim oSQL = "Select MAX(GUID) FROM TBIDB_ATTRIBUTE"
PrimaryKey = My.DatabaseIDB.GetScalarValue(oSQL)
End If
FillAttribute()
End If
@@ -52,11 +64,7 @@
End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
ResetMessages()
If SaveData() Then
Close()
End If
Close()
End Sub
Public Function SaveData() As Boolean
@@ -77,7 +85,7 @@
' TODO: Update Database
If Not IsInsert Then
Dim oUpdate As String = $"UPDATE TBIDB_ATTRIBUTE " &
$"SET TITLE = '{TextEdit2.Text}', TYP_ID = {ComboBoxEdit1.EditValue}, VIEW_SEQUENCE = {SpinEdit1.Value}, VIEW_VISIBLE = '{CheckEdit2.Checked}'" &
$"Set TITLE = '{TextEdit2.Text}', TYP_ID = {ComboBoxEdit1.EditValue}, VIEW_SEQUENCE = {SpinEdit1.Value}, VIEW_VISIBLE = '{CheckEdit2.Checked}'" &
$",MULTI_CONTEXT = '{CheckEditMulticontext.Checked}', COMMENT = '{TextEdit3.Text}', CHANGED_WHO = '{My.Application.User.UserName}' " &
$"WHERE (GUID = {TextEdit1.Text})"
@@ -136,4 +144,12 @@
End If
End If
End Sub
Private Sub XtraTabControl1_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControl1.SelectedPageChanged
If XtraTabControl1.SelectedTabPageIndex = 1 Then
oMode = ConstTranslate
Else
oMode = ConstDetail
End If
End Sub
End Class