Public Class frmAdmin_DoctypeConfig
    Public Property IsInsert As Boolean = False
    Public Property PrimaryKey As Integer
    Public Sub New(PrimaryKey As Integer, Optional IsInsert As Boolean = False)
        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()


        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
        Me.PrimaryKey = PrimaryKey
        Me.IsInsert = IsInsert
    End Sub

    Private Sub TBIDB_DOCTYPE_HANDLINGBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
        Me.Validate()
        Me.TBIDB_DOCTYPE_HANDLINGBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DSIDB_Stammdaten)

    End Sub





    Private Sub frmAdmin_DoctypeConfig_HandleDestroyed(sender As Object, e As EventArgs) Handles Me.HandleDestroyed
        Try

        Catch ex As Exception

        End Try
    End Sub

    Private Sub frmAdmin_DoctypeConfig_Load(sender As Object, e As EventArgs) Handles Me.Load
        Try
            TBIDB_CATALOGTableAdapter.Connection.ConnectionString = My.DatabaseIDB.CurrentSQLConnectionString
            TBIDB_DOCTYPE_HANDLINGTableAdapter.Connection.ConnectionString = My.DatabaseIDB.CurrentSQLConnectionString
            Me.TBIDB_CATALOGTableAdapter.FillByDOCTYPE_CHANGED(Me.DSIDB_Stammdaten.TBIDB_CATALOG)
            Me.TBIDB_DOCTYPE_HANDLINGTableAdapter.Fill(Me.DSIDB_Stammdaten.TBIDB_DOCTYPE_HANDLING, PrimaryKey)
        Catch ex As Exception

        End Try

    End Sub

    Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
        ResetMessages()

        If SaveData() Then
            ShowStatus("Action Handling saved!")
        End If
    End Sub
    Public Function SaveData() As Boolean
        Try
            Me.TBIDB_DOCTYPE_HANDLINGBindingSource.EndEdit()
            If Me.DSIDB_Stammdaten.TBIDB_DOCTYPE_HANDLING.GetChanges Is Nothing = False Then
                TextEdit4.Text = My.Application.User.UserName
                TBIDB_DOCTYPE_HANDLINGBindingSource.EndEdit()
                TBIDB_DOCTYPE_HANDLINGTableAdapter.Update(DSIDB_Stammdaten.TBIDB_DOCTYPE_HANDLING)
                Return True
            End If
        Catch ex As Exception
            Return False
        End Try
    End Function
    Private Sub ResetMessages()
        labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
    End Sub
    Private Sub ShowStatus(Message As String)
        labelStatus.Caption = Message
        labelStatus.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
    End Sub
End Class