MS 2.4.9.6 Zusätzliche Meldungen und @DisplayOnly Möglichkeit

This commit is contained in:
Developer01
2024-08-26 16:41:27 +02:00
parent 3b08bafa49
commit 1b04665e82
19 changed files with 1405 additions and 706 deletions

View File

@@ -1,4 +1,5 @@
Imports System.Globalization
Imports System.IO
Imports DigitalData.Modules.Database
Public Class frmKonfig
@@ -136,10 +137,7 @@ Public Class frmKonfig
End If
End Sub
Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles btnLogMail.Click
email.Send_Log_Mail("<b> Log-/SupportMail von Process-Manager DD.</b> <p>",
"Support-Mail Process-Manager", "support@didalog.de", "mail.triplew.de", "support@didalog.de", "ddemail40", "support@didalog.de", False, True)
End Sub
Private Sub TBPM_KONFIGURATIONBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Me.Validate()
@@ -176,13 +174,17 @@ Public Class frmKonfig
System.Diagnostics.Process.Start("http://www.didalog.de/Support")
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles btnOpenAppDataFolder.Click
Process.Start(USER_CONFIG_DIRECTORY)
End Sub
Private Sub btnopenlog_Click(sender As Object, e As EventArgs) Handles btnopenlog.Click
'Process.Start(ClassLogger.DateiSpeicherort)
Process.Start(LOGCONFIG.LogDirectory)
Private Sub btnopenlog_Click(sender As Object, e As EventArgs) Handles btnOpenLogFolder.Click
Try
Process.Start(LOGCONFIG.LogDirectory)
Catch ex As Exception
End Try
End Sub
Private Sub txtIntervall_TextChanged(sender As Object, e As EventArgs) Handles txtIntervall.TextChanged
@@ -251,4 +253,85 @@ Public Class frmKonfig
End Try
End Sub
Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged
Try
If TabControl1.SelectedIndex = 1 Then
If IsDirectoryAccessible(LOGCONFIG.LogDirectory) Then
btnOpenLogFolder.Enabled = True
Else
LOGGER.Info("Logpath is not accessible")
btnOpenLogFolder.Enabled = False
End If
If IsDirectoryAccessible(USER_CONFIG_DIRECTORY) Then
btnOpenAppDataFolder.Enabled = True
Else
LOGGER.Info("Appdata-Path is not accessible")
btnOpenAppDataFolder.Enabled = False
End If
End If
Catch ex As Exception
End Try
End Sub
Function IsDirectoryAccessible(pDirectoryPath As String) As Boolean
Try
' Prüfen, ob das Verzeichnis existiert
If Not Directory.Exists(pDirectoryPath) Then
Return False
End If
' Versuch, das Verzeichnis zu öffnen und seine Dateien aufzulisten
Dim files As String() = Directory.GetFiles(pDirectoryPath)
Return True
Catch ex As UnauthorizedAccessException
' Zugriff verweigert
Return False
Catch ex As IOException
' Ein allgemeiner E/A-Fehler
Return False
Catch ex As Exception
' Ein anderer Fehler
Return False
End Try
End Function
Private Sub BtnCreateLogfiles_Click(sender As Object, e As EventArgs) Handles BtnCreateLogfiles.Click
Try
If File.Exists(LOGCONFIG.LogFile) Then
SaveFileDialog1.Filter = "log file|*.log"
SaveFileDialog1.FileName = Path.GetFileName(LOGCONFIG.LogFile)
If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
If File.Exists(SaveFileDialog1.FileName) Then
File.Delete(SaveFileDialog1.FileName)
End If
File.Copy(LOGCONFIG.LogFile, SaveFileDialog1.FileName)
End If
End If
If DEBUG = True Then
Dim oDebuglogFilename_only = Path.GetFileNameWithoutExtension(LOGCONFIG.LogFile) + "-Debug.log"
Dim oDebuglogFilename = LOGCONFIG.LogDirectory + "\" + oDebuglogFilename_only
If File.Exists(oDebuglogFilename) Then
SaveFileDialog1.Filter = "log file|*.log"
SaveFileDialog1.FileName = oDebuglogFilename_only
If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
If File.Exists(SaveFileDialog1.FileName) Then
File.Delete(SaveFileDialog1.FileName)
End If
File.Copy(oDebuglogFilename, SaveFileDialog1.FileName)
End If
End If
End If
Dim oTitle = "Logfiles erfolgreich gespeichert! Bitte senden Sie diese nun als Anhang an support-flow@digitaldata.works"
If USER_LANGUAGE <> "de-DE" Then
oTitle = "Logfiles exported successfully. Please send them as attachments to support-flow@digitaldata.works"
End If
MsgBox(oTitle, MsgBoxStyle.Information, ADDITIONAL_TITLE)
Catch ex As Exception
MsgBox(ex.Message, "Error saving log file")
End Try
End Sub
End Class