MS
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
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
|
||||
@@ -45,8 +45,9 @@
|
||||
labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
|
||||
End Sub
|
||||
|
||||
Private Sub ShowStatus(Message As String)
|
||||
labelStatus.Caption = Message
|
||||
Private Sub ShowStatus(Message As String, ocolor As Color)
|
||||
labelStatus.Caption = $"{Message} - {Now.ToString}"
|
||||
labelStatus.ItemAppearance.Normal.BackColor = ocolor
|
||||
labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
|
||||
End Sub
|
||||
|
||||
@@ -81,7 +82,10 @@
|
||||
$"WHERE (GUID = {TextEdit1.Text})"
|
||||
|
||||
If My.DatabaseIDB.ExecuteNonQuery(oUpdate) = False Then
|
||||
ShowStatus($"Error saving Attribute {TextEdit2.Text} - Check Your log", Color.Red)
|
||||
Return False
|
||||
Else
|
||||
ShowStatus($"Attribute {TextEdit2.Text} saved successfully", Color.DodgerBlue)
|
||||
End If
|
||||
Else
|
||||
Dim oInsert As String = $"INSERT INTO TBIDB_ATTRIBUTE " &
|
||||
@@ -89,17 +93,20 @@
|
||||
$"VALUES ('{TextEdit2.Text}',{ComboBoxEdit1.EditValue},{SpinEdit1.Value},'{CheckEdit2.Checked}','{My.Application.User.UserName}', '{TextEdit3.Text}','{CheckEditMulticontext.Checked}')"
|
||||
|
||||
If My.DatabaseIDB.ExecuteNonQuery(oInsert) = True Then
|
||||
ShowStatus($"Attribute {TextEdit2.Text} added successfully", Color.DodgerBlue)
|
||||
IsInsert = False
|
||||
Else
|
||||
ShowStatus($"Error Insertung Attribute {TextEdit2.Text} - Check Your log", Color.Red)
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
' VWIDB_BE_ATTRIBUTETableAdapter.Update(DSIDB_Stammdaten.VWIDB_BE_ATTRIBUTE)
|
||||
End If
|
||||
|
||||
FillAttribute()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
ShowStatus($"Unexpeced error saving attribute {TextEdit2.Text} - {ex.Message}", Color.Red)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user