Use Logger Module
This commit is contained in:
@@ -46,6 +46,7 @@ Public Class frmKonfig
|
||||
Me.txtpdfxchange.Text = VIEWER_XCHANGE
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Formload Grundkonfig:")
|
||||
End Try
|
||||
End Sub
|
||||
@@ -112,6 +113,7 @@ Public Class frmKonfig
|
||||
End If
|
||||
connection.Close()
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Datenbank-Connect:")
|
||||
End Try
|
||||
Cursor = Cursors.Default
|
||||
@@ -119,14 +121,14 @@ Public Class frmKonfig
|
||||
|
||||
Private Sub BtnConnect_Click(sender As System.Object, e As System.EventArgs) Handles BtnConnect.Click
|
||||
Try
|
||||
Dim con As String
|
||||
Dim oPlainConnectionString, oEncryptedConnectionString As String
|
||||
If chkbxUserAut.Checked Then
|
||||
con = "Data Source=" & Me.txtServer.Text & ";Initial Catalog=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;"
|
||||
oPlainConnectionString = "Data Source=" & Me.txtServer.Text & ";Initial Catalog=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;"
|
||||
Else
|
||||
con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";"
|
||||
oPlainConnectionString = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";"
|
||||
End If
|
||||
|
||||
Dim connection As New SqlClient.SqlConnection(con) 'csb.ConnectionString)
|
||||
Dim connection As New SqlClient.SqlConnection(oPlainConnectionString) 'csb.ConnectionString)
|
||||
'während Verbindungsaufbau Sanduhr-Mauszeiger
|
||||
Cursor = Cursors.WaitCursor
|
||||
connection.Open()
|
||||
@@ -136,21 +138,23 @@ Public Class frmKonfig
|
||||
result = MessageBox.Show("Die Verbindung wurde erfolgreich aufgebaut!" & vbNewLine & "Möchten Sie diese Verbindung nun in der Anwendung speichern?", "Erfolgsmeldung:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
'ConnectionString in Anwendung speichern
|
||||
CONNECTION_STRING = con
|
||||
CONNECTION_STRING = oPlainConnectionString
|
||||
ClassDatabase.Init()
|
||||
'Das Passwort verschlüsseln
|
||||
If chkbxUserAut.Checked = False Then
|
||||
Dim wrapper As New ClassEncryption("!35452didalog=")
|
||||
Dim cipherText As String = wrapper.EncryptData(Me.txtPasswort.Text)
|
||||
Dim pw As String = cipherText
|
||||
con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";"
|
||||
oEncryptedConnectionString = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";"
|
||||
Else
|
||||
oEncryptedConnectionString = oPlainConnectionString
|
||||
End If
|
||||
|
||||
'SaveMySettingsValue("MyConnectionString", con)
|
||||
'My.Settings.Save()
|
||||
|
||||
CONNECTION_STRING = con
|
||||
CONFIG.Config.ConnectionString = con
|
||||
CONNECTION_STRING = oPlainConnectionString
|
||||
CONFIG.Config.ConnectionString = oEncryptedConnectionString
|
||||
CONFIG.Save()
|
||||
|
||||
Load_ConString(CONNECTION_STRING)
|
||||
@@ -158,6 +162,7 @@ Public Class frmKonfig
|
||||
Me.TBPM_KONFIGURATIONTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_KONFIGURATION)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Cursor = Cursors.Default
|
||||
MsgBox("Fehler beim Verbindungsaufbau: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
|
||||
End Try
|
||||
@@ -198,7 +203,6 @@ Public Class frmKonfig
|
||||
End If
|
||||
Case "system"
|
||||
rbSystem.Checked = True
|
||||
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -267,7 +271,6 @@ Public Class frmKonfig
|
||||
Me.Validate()
|
||||
Me.TBPM_KONFIGURATIONBindingSource.EndEdit()
|
||||
Me.TableAdapterManager.UpdateAll(Me.DD_DMSLiteDataSet)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click_3(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
@@ -338,7 +341,8 @@ Public Class frmKonfig
|
||||
End Sub
|
||||
|
||||
Private Sub btnopenlog_Click(sender As Object, e As EventArgs) Handles btnopenlog.Click
|
||||
Process.Start(ClassLogger.DateiSpeicherort)
|
||||
'Process.Start(ClassLogger.DateiSpeicherort)
|
||||
Process.Start(LOGCONFIG.LogDirectory)
|
||||
End Sub
|
||||
|
||||
Private Sub txtIntervall_TextChanged(sender As Object, e As EventArgs) Handles txtIntervall.TextChanged
|
||||
@@ -348,6 +352,7 @@ Public Class frmKonfig
|
||||
|
||||
Private Sub chkLogErrorsOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged
|
||||
LOG_ERRORS_ONLY = chkLogErrorsOnly.Checked
|
||||
LOGCONFIG.Debug = Not LOG_ERRORS_ONLY
|
||||
CONFIG.Config.LogErrorsOnly = LOG_ERRORS_ONLY
|
||||
CONFIG.Save()
|
||||
'SaveMySettingsValue("LogErrorsOnly", chkLogErrorsOnly.Checked)
|
||||
|
||||
Reference in New Issue
Block a user