MS24112015
This commit is contained in:
@@ -1,12 +1,29 @@
|
||||
Imports System.IO
|
||||
Imports System.Threading
|
||||
Imports System.Globalization
|
||||
|
||||
Public Class frmConfig_Basic
|
||||
Dim formloaded = False
|
||||
Public Sub SetLanguage()
|
||||
Dim sz = Me.Size
|
||||
Dim pt = Me.Location
|
||||
Dim de = System.Globalization.CultureInfo.CurrentUICulture
|
||||
'Neue Sprache festlegen und entfernen aller Controls
|
||||
Thread.CurrentThread.CurrentUICulture = New CultureInfo(USER_LANGUAGE)
|
||||
Me.Controls.Clear()
|
||||
'Me.Events.Dispose()
|
||||
InitializeComponent()
|
||||
|
||||
'Wiederherstellen der Fensterposition
|
||||
Me.Size = sz
|
||||
Me.Location = pt
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConnect_Click(sender As Object, e As EventArgs) Handles BtnConnect.Click
|
||||
Try
|
||||
Dim constring As String
|
||||
If chkbxUserAut.Checked Then
|
||||
constring = "Data Source=" & Me.txtServer.Text & ";Initial Catalog=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;"
|
||||
constring = "Data Source=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;"
|
||||
Else
|
||||
constring = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";"
|
||||
End If
|
||||
@@ -19,7 +36,12 @@ Public Class frmConfig_Basic
|
||||
Cursor = Cursors.Default
|
||||
'DialogResult = Windows.Forms.DialogResult.OK
|
||||
Dim result As MsgBoxResult
|
||||
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 USER_LANGUAGE = "de-DE" Then
|
||||
result = MessageBox.Show("Die Verbindung wurde erfolgreich aufgebaut!" & vbNewLine & "Möchten Sie diese Verbindung nun in der Anwendung speichern?", "Erfolgsmeldung:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
Else
|
||||
result = MessageBox.Show("Connection was created successfull!" & vbNewLine & "Do You wnat to save this connection now in the application?", "Success:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
End If
|
||||
|
||||
If result = MsgBoxResult.Yes Then
|
||||
'Set the construction string
|
||||
MyConnectionString = constring 'csb.ConnectionString
|
||||
@@ -39,7 +61,7 @@ Public Class frmConfig_Basic
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Cursor = Cursors.Default
|
||||
MsgBox("Fehler beim Verbindungsaufbau: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
|
||||
MsgBox("Error in Connection Build: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -72,7 +94,7 @@ Public Class frmConfig_Basic
|
||||
End If
|
||||
connection.Close()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Datenbank-Connect:")
|
||||
MsgBox("Error in Show Databases: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
|
||||
End Try
|
||||
Cursor = Cursors.Default
|
||||
End Sub
|
||||
@@ -80,31 +102,42 @@ Public Class frmConfig_Basic
|
||||
Private Sub frmConfig_Basic_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
SaveConfigValue("UniversalViewer", txtuniversalViewer.Text)
|
||||
End Sub
|
||||
|
||||
<STAThread()> _
|
||||
Private Sub frmConfig_Basic_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
<STAThread()> _
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
With OpenFileDialog1
|
||||
' Do
|
||||
.Filter = "Viewer.Exe|*.exe"
|
||||
.FilterIndex = 1
|
||||
.Title = "Pfad zu Universal Viewer.exe:"
|
||||
If .ShowDialog() = DialogResult.OK Then
|
||||
Me.txtuniversalViewer.Text = .FileName
|
||||
SaveConfigValue("UniversalViewer", txtuniversalViewer.Text)
|
||||
UniversalViewer = txtuniversalViewer.Text
|
||||
Try
|
||||
With OpenFileDialog1
|
||||
' Do
|
||||
.Filter = "Viewer.Exe|*.exe"
|
||||
.FilterIndex = 1
|
||||
.Title = "Pfad zu Universal Viewer.exe:"
|
||||
If .ShowDialog() = DialogResult.OK Then
|
||||
Me.txtuniversalViewer.Text = .FileName
|
||||
SaveConfigValue("UniversalViewer", txtuniversalViewer.Text)
|
||||
UniversalViewer_Path = txtuniversalViewer.Text
|
||||
End If
|
||||
End With
|
||||
Catch ex As Exception
|
||||
If ex.Message.Contains("aktuellen Thread muss der STA-Modus") Then
|
||||
MsgBox("Diese Eisntellung kann während des Starts nicht geändert werden!" & vbNewLine & "Schliessen Sie das Formular. Sie weren in Folge erneut aufgefordert den PFad zu UViewer einzugeben!", MsgBoxStyle.Information)
|
||||
Else
|
||||
MsgBox("Unexpected error in Add UViewer-Path:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End If
|
||||
End With
|
||||
End Sub
|
||||
|
||||
Private Sub Label6_Click(sender As Object, e As EventArgs) Handles Label6.Click
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Dim reload As Boolean = False
|
||||
Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged
|
||||
Select Case TabControl1.SelectedIndex
|
||||
Case 1
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
cmbLanguage.SelectedIndex = 0
|
||||
Else
|
||||
cmbLanguage.SelectedIndex = 1
|
||||
End If
|
||||
Case 2
|
||||
reload = True
|
||||
Dim folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & CURRENT_USERID, MyConnectionString)
|
||||
@@ -121,10 +154,20 @@ Public Class frmConfig_Basic
|
||||
|
||||
If Not ClassFolderWatcher.FolderWatcher Is Nothing Then
|
||||
If ClassFolderWatcher.FolderWatcher.EnableRaisingEvents = True Then
|
||||
btnstartstop1.Text = "Überwachung stoppen"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop1.Text = "Überwachung stoppen"
|
||||
Else
|
||||
btnstartstop1.Text = "Stop hotfolder"
|
||||
End If
|
||||
|
||||
btnstartstop1.Image = My.Resources.bell_delete
|
||||
Else
|
||||
btnstartstop1.Text = "Überwachung starten"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop1.Text = "Überwachung starten"
|
||||
Else
|
||||
btnstartstop1.Text = "Start hotfolder"
|
||||
End If
|
||||
|
||||
btnstartstop1.Image = My.Resources.bell_go
|
||||
End If
|
||||
Else
|
||||
@@ -134,14 +177,29 @@ Public Class frmConfig_Basic
|
||||
|
||||
If Not ClassFolderWatcher.FolderWatcher_SCAN Is Nothing Then
|
||||
If ClassFolderWatcher.FolderWatcher_SCAN.EnableRaisingEvents = True Then
|
||||
btnstartstop2.Text = "Überwachung stoppen"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop2.Text = "Überwachung stoppen"
|
||||
Else
|
||||
btnstartstop2.Text = "Stop hotfolder"
|
||||
End If
|
||||
|
||||
btnstartstop2.Image = My.Resources.bell_delete
|
||||
Else
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
Else
|
||||
btnstartstop2.Text = "Stop hotfolder"
|
||||
End If
|
||||
|
||||
btnstartstop2.Image = My.Resources.bell_go
|
||||
End If
|
||||
Else
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
Else
|
||||
btnstartstop2.Text = "Stop hotfolder"
|
||||
End If
|
||||
|
||||
btnstartstop2.Image = My.Resources.bell_go
|
||||
End If
|
||||
reload = False
|
||||
@@ -162,10 +220,15 @@ Public Class frmConfig_Basic
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" >> Fehler beim Erstellen des Folderwatchordners: " & mypath, False)
|
||||
ClassLogger.Add(" >> " & ex.Message, False)
|
||||
MsgBox("Fehler beim Erstellen des Folderwatchordners: " & mypath & vbNewLine & "Bitte überprüfen Sie die Rechte!" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Fehler beim Erstellen des Folderwatchordners: " & mypath & vbNewLine & "Bitte überprüfen Sie die Rechte!" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Else
|
||||
MsgBox("Error in creating Hotfolder: " & mypath & vbNewLine & "Please check the rights!" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End If
|
||||
|
||||
Exit Sub
|
||||
End Try
|
||||
|
||||
|
||||
Dim folderwatch = ClassDatabase.Execute_Scalar("SELECT GUID FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & CURRENT_USERID & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'", MyConnectionString)
|
||||
Dim sql As String
|
||||
If folderwatch Is Nothing Then
|
||||
@@ -201,7 +264,6 @@ Public Class frmConfig_Basic
|
||||
CheckFolder(CURRENT_FOLDERWATCH, "DEFAULT")
|
||||
End Sub
|
||||
|
||||
<STAThread()> _
|
||||
Private Sub btnstartstop1_Click(sender As Object, e As EventArgs) Handles btnstartstop1.Click
|
||||
If CURRENT_FOLDERWATCH <> "" Then
|
||||
CheckFW_State()
|
||||
@@ -211,20 +273,38 @@ Public Class frmConfig_Basic
|
||||
Sub CheckFW_State()
|
||||
Select Case ClassFolderWatcher.StartStop_FolderWatch()
|
||||
Case 1
|
||||
btnstartstop1.Text = "Überwachung stoppen"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop1.Text = "Überwachung stoppen"
|
||||
Else
|
||||
btnstartstop1.Text = "Stop Hotfolder"
|
||||
End If
|
||||
|
||||
btnstartstop1.Image = My.Resources.bell_delete
|
||||
Case 0
|
||||
btnstartstop1.Text = "Überwachung starten"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop1.Text = "Überwachung starten"
|
||||
Else
|
||||
btnstartstop1.Text = "Stop Hotfolder"
|
||||
End If
|
||||
|
||||
btnstartstop1.Image = My.Resources.bell_go
|
||||
End Select
|
||||
End Sub
|
||||
Sub CheckFWSCAN_State()
|
||||
Select Case ClassFolderWatcher.StartStop_FolderWatchSCAN()
|
||||
Case 1
|
||||
btnstartstop2.Text = "Überwachung stoppen"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop2.Text = "Überwachung stoppen"
|
||||
Else
|
||||
btnstartstop2.Text = "Stop Hotfolder"
|
||||
End If
|
||||
btnstartstop2.Image = My.Resources.bell_delete
|
||||
Case 0
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
Else
|
||||
btnstartstop2.Text = "Start Hotfolder"
|
||||
End If
|
||||
btnstartstop2.Image = My.Resources.bell_go
|
||||
End Select
|
||||
End Sub
|
||||
@@ -239,12 +319,17 @@ Public Class frmConfig_Basic
|
||||
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged
|
||||
If formloaded = True Then
|
||||
SaveConfigValue("LogErrorsOnly", chkLogErrorsOnly.Checked)
|
||||
ClassLogger.Add(" >> LogErrorsOnly auf '" & chkLogErrorsOnly.Checked & "' umgestellt", False)
|
||||
ClassLogger.Add(" >> LogErrorsOnly changed to '" & chkLogErrorsOnly.Checked, False)
|
||||
LogErrorsOnly = chkLogErrorsOnly.Checked
|
||||
End If
|
||||
End Sub
|
||||
|
||||
<STAThread()> _
|
||||
Private Sub frmConfig_Basic_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
||||
Load_Basics()
|
||||
formloaded = True
|
||||
|
||||
End Sub
|
||||
Sub Load_Basics()
|
||||
If Not MyConnectionString = String.Empty Then
|
||||
Dim csb As New SqlClient.SqlConnectionStringBuilder
|
||||
csb.ConnectionString = MyConnectionString
|
||||
@@ -253,16 +338,14 @@ Public Class frmConfig_Basic
|
||||
constr = constr.Replace(csb.Password, "XXXXX")
|
||||
Me.txtActualConnection.Text = constr
|
||||
End If
|
||||
Me.txtuniversalViewer.Text = UniversalViewer
|
||||
Me.txtuniversalViewer.Text = UniversalViewer_Path
|
||||
chkLogErrorsOnly.Checked = LogErrorsOnly
|
||||
|
||||
If ERROR_STATE = "FAILED CONNECTION" Then
|
||||
If ERROR_STATE = "FAILED DBCONNECTION" Then
|
||||
Me.TabControl1.SelectedIndex = 0
|
||||
ElseIf ERROR_STATE = "NO UV" Then
|
||||
Me.TabControl1.SelectedIndex = 1
|
||||
End If
|
||||
formloaded = True
|
||||
|
||||
End Sub
|
||||
Private Sub btnopenlog_Click(sender As Object, e As EventArgs) Handles btnopenlog.Click
|
||||
Process.Start(ClassLogger.DateiSpeicherort)
|
||||
@@ -305,6 +388,56 @@ Public Class frmConfig_Basic
|
||||
Private Sub btnSaveExclusionFiles_Click(sender As Object, e As EventArgs) Handles btnSaveExclusionFiles.Click
|
||||
DTEXCLUDE_FILES.AcceptChanges()
|
||||
DTEXCLUDE_FILES.WriteXml(PATH_FileExclusions)
|
||||
MsgBox("Änderungen gespeichert!", MsgBoxStyle.Information)
|
||||
MsgBox("Changes saved.", MsgBoxStyle.Information)
|
||||
End Sub
|
||||
|
||||
Private Sub btnLogMail_Click(sender As Object, e As EventArgs) Handles btnLogMail.Click
|
||||
ClassEmail.Send_Log_Mail("<b> Log-/SupportMail von DD GLOBIX.</b> <p>", _
|
||||
"Support-Mail GLOBIX", "support@didalog.de", "mail.triplew.de", "support@didalog.de", "ddemail40", "support@didalog.de", False, True)
|
||||
End Sub
|
||||
|
||||
Private Sub cmbLanguage_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbLanguage.SelectedIndexChanged
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button3_Click_1(sender As Object, e As EventArgs) Handles Button3.Click
|
||||
Dim result As MsgBoxResult
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
result = MessageBox.Show("Wollen Sie die Applikationssprache nun auf '" & cmbLanguage.Text & "' ändern?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
Else
|
||||
result = MessageBox.Show("Would You like to change Your application language to '" & cmbLanguage.Text & "' ?", "Confirmation required:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
End If
|
||||
|
||||
If result = MsgBoxResult.Yes Then
|
||||
formloaded = False
|
||||
Try
|
||||
Dim lang As String
|
||||
Select Case cmbLanguage.SelectedIndex
|
||||
Case 0
|
||||
lang = "de-DE"
|
||||
Case 1
|
||||
lang = "en-GB"
|
||||
End Select
|
||||
|
||||
Dim update As String = "UPDATE TBDD_USER SET [LANGUAGE] = '" & lang & "' WHERE GUID = " & CURRENT_USERID
|
||||
USER_LANGUAGE = lang
|
||||
|
||||
If ClassDatabase.Execute_non_Query(update, True) = True Then
|
||||
SetLanguage()
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Die Sprache wurde erfolgreich geändert!", MsgBoxStyle.Information)
|
||||
Else
|
||||
MsgBox("The language was changed successfully!", MsgBoxStyle.Information)
|
||||
|
||||
End If
|
||||
LANGUAGE_CHANGED = True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
formloaded = True
|
||||
Load_Basics()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user