MS anpassungen

This commit is contained in:
2022-02-15 17:28:32 +01:00
parent c2b81af556
commit 5f69002668
20 changed files with 707 additions and 484 deletions

View File

@@ -20,7 +20,8 @@
TBWH_ATTRIBUTE_TYPETableAdapter.Connection.ConnectionString = My.DatabaseIDB.CurrentSQLConnectionString
TBWH_ATTRIBUTE_TYPETableAdapter.Fill(DSIDB_Stammdaten.TBWH_ATTRIBUTE_TYPE)
VWIDB_BE_ATTRIBUTETableAdapter.Connection.ConnectionString = My.DatabaseIDB.CurrentSQLConnectionString
VWIDB_BE_ATTRIBUTETableAdapter.FillByAttributeId(DSIDB_Stammdaten.VWIDB_BE_ATTRIBUTE, PrimaryKey, 1)
FillAttribute()
If IsInsert Then
VWIDB_BE_ATTRIBUTEBindingSource.AddNew()
DSIDB_Stammdaten.VWIDB_BE_ATTRIBUTE.ADDED_WHOColumn.DefaultValue = My.Application.User.UserName
@@ -29,11 +30,14 @@
ShowErrorMessage(ex)
End Try
End Sub
Private Sub FillAttribute()
VWIDB_BE_ATTRIBUTETableAdapter.FillByAttributeId(DSIDB_Stammdaten.VWIDB_BE_ATTRIBUTE, PrimaryKey, 1)
End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
ResetMessages()
If SaveData() And HasChanges Then
ShowStatus("Attribute saved!")
FillAttribute()
End If
End Sub
@@ -73,7 +77,7 @@
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}'" &
$", COMMENT = '{TextEdit3.Text}', CHANGED_WHO = '{My.Application.User.UserName}' " &
$",MULTI_CONTEXT = '{CheckEditMulticontext.Checked}', COMMENT = '{TextEdit3.Text}', CHANGED_WHO = '{My.Application.User.UserName}' " &
$"WHERE (GUID = {TextEdit1.Text})"
If My.DatabaseIDB.ExecuteNonQuery(oUpdate) = False Then
@@ -90,7 +94,7 @@
Return False
End If
End If
VWIDB_BE_ATTRIBUTETableAdapter.Update(DSIDB_Stammdaten.VWIDB_BE_ATTRIBUTE)
' VWIDB_BE_ATTRIBUTETableAdapter.Update(DSIDB_Stammdaten.VWIDB_BE_ATTRIBUTE)
'End If
Return True
@@ -101,10 +105,13 @@
End Function
Public Function DeleteData() As Boolean Implements IAdminForm.DeleteData
Public Function DeleteAttribute() As Boolean Implements IAdminForm.DeleteData
Try
'VWIDB_BE_ATTRIBUTETableAdapter.Delete(PrimaryKey)
Return True
Dim oproc = $"EXEC PRIDB_DELETE_ATTRIBUTE {PrimaryKey}, '{My.Application.User.UserName}' "
If My.DatabaseIDB.ExecuteNonQuery(oproc) = True Then
Return True
End If
Catch ex As Exception
ShowErrorMessage(ex)
Return False
@@ -112,8 +119,12 @@
End Function
Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick
If MsgBox($"Wollen Sie das Attribut [{PrimaryKey}] wirklich löschen?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) = MsgBoxResult.Yes Then
If DeleteData() Then
End Sub
Private Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick
If MsgBox($"Do You really want to delete the attribute [{PrimaryKey}]? All Metadata related to the Attribute will be deleted!", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) = MsgBoxResult.Yes Then
If DeleteAttribute() Then
Close()
End If
End If