Imports DigitalData.Modules.Base

Public NotInheritable Class frmAbout

    Private Sub AboutBox1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Legen Sie den Titel des Formulars fest.
        Dim ApplicationTitle As String
        If My.Application.Info.Title <> "" Then
            ApplicationTitle = My.Application.Info.Title
        Else
            ApplicationTitle = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If

        If USER_LANGUAGE = "de-DE" Then
            Me.Text = String.Format("Information zu: {0}", ApplicationTitle)
        Else
            Me.Text = String.Format("Information about: {0}", ApplicationTitle)
        End If

        lblProduktname.Text = My.Application.Info.ProductName
        lblVersion.Text = String.Format("Version {0}", My.Application.Info.Version.ToString)
        lblCompanyName.Text = My.Application.Info.CompanyName
        txtDescription.Text = My.Application.Info.Description
    End Sub

    Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
        Me.Close()
    End Sub


    Private Sub LinkLabel_SupportPortal_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel_SupportPortal.LinkClicked
        Try
            Me.LinkLabel_SupportPortal.LinkVisited = True

            Dim oSql As String = "SELECT CAT_STRING FROM TBDD_CATALOG WHERE CAT_TITLE = 'DDSUPPORT_PORTAL'"
            Dim oSupportLink As String = DATABASE_ECM.GetScalarValue(oSql)?.ToString()

            If Not String.IsNullOrEmpty(oSupportLink) Then
                Process.Start(oSupportLink)
            Else
                MsgBox("Support-Link nicht gefunden.", MsgBoxStyle.Information)
            End If

        Catch ex As Exception
            MsgBox("Fehler beim Öffnen des Support-Links: " & ex.Message, MsgBoxStyle.Critical)
        End Try
    End Sub
End Class
