524 lines
23 KiB
VB.net
524 lines
23 KiB
VB.net
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
|
|
If Me.txtServer.Text = String.Empty Then
|
|
MsgBox("Please specify SQL-Server Adress!", MsgBoxStyle.Information)
|
|
txtServer.Focus()
|
|
Exit Sub
|
|
End If
|
|
Try
|
|
Dim constring As String
|
|
If chkbxUserAut.Checked Then
|
|
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
|
|
|
|
|
|
Dim connection As New SqlClient.SqlConnection(constring) 'csb.ConnectionString)
|
|
'während Verbindungsaufbau Sanduhr-Mauszeiger
|
|
Cursor = Cursors.WaitCursor
|
|
connection.Open()
|
|
Cursor = Cursors.Default
|
|
'DialogResult = Windows.Forms.DialogResult.OK
|
|
Dim result As MsgBoxResult
|
|
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 successfully!" & vbNewLine & "Do You want 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
|
|
|
|
If chkbxUserAut.Checked = False Then
|
|
'Das Passwort verschlüsseln
|
|
Dim wrapper As New ClassEncryption("!35452didalog=")
|
|
Dim cipherText As String = wrapper.EncryptData(Me.txtPasswort.Text)
|
|
Dim pw As String = cipherText
|
|
constring = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";"
|
|
End If
|
|
'SaveConfigValue("MyConnectionString", constring)
|
|
CONFIG.Config.ConnectionString = constring
|
|
CONFIG.Save()
|
|
|
|
Me.txtActualConnection.Text = constring
|
|
|
|
Dim sql = "SELECT MAX(GUID) FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('@user'))"
|
|
sql = sql.Replace("@user", Environment.UserName)
|
|
LOGGER.Info(">> Username: " & Environment.UserName)
|
|
|
|
USER_ID = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True)
|
|
If IsDBNull(USER_ID) Then
|
|
MsgBox("Attention: Your Username '" & Environment.UserName & "' is not configured for Global Indexer. this might result in unhandled exceptions!", MsgBoxStyle.Exclamation)
|
|
LOGGER.Info("User '" & Environment.UserName & "' not configured for Global Indexer! (DBNull - frmConfigBasic)")
|
|
End If
|
|
|
|
|
|
'Me.TBPM_KONFIGURATIONTableAdapter.Connection.ConnectionString = My.Settings.ConfigConnectionString
|
|
'Me.TBPM_KONFIGURATIONTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_KONFIGURATION)
|
|
End If
|
|
Catch ex As Exception
|
|
Cursor = Cursors.Default
|
|
MsgBox("Error in Connection Build: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub cmbDatenbank_MouseClick(sender As Object, e As MouseEventArgs) Handles cmbDatenbank.MouseClick
|
|
Try
|
|
If Me.txtServer.Text = String.Empty Then
|
|
MsgBox("Please specify SQL-Server Adress!", MsgBoxStyle.Information)
|
|
txtServer.Focus()
|
|
Exit Sub
|
|
End If
|
|
Me.Cursor = Cursors.WaitCursor
|
|
Dim csb As New SqlClient.SqlConnectionStringBuilder
|
|
csb.DataSource = Me.txtServer.Text
|
|
csb.IntegratedSecurity = False
|
|
csb.UserID = Me.txtUser.Text
|
|
csb.Password = Me.txtPasswort.Text
|
|
|
|
Dim con As String
|
|
If chkbxUserAut.Checked Then
|
|
con = "Data Source=" & Me.txtServer.Text & ";Trusted_Connection=True;"
|
|
Else
|
|
con = "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)
|
|
connection.Open()
|
|
Dim cmd As New SqlClient.SqlCommand("sp_databases", connection)
|
|
cmd.CommandType = CommandType.StoredProcedure
|
|
' Ausführen und Ergebnis in einer ListBox anzeigen
|
|
Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader
|
|
If dr.HasRows Then
|
|
Do While dr.Read
|
|
cmbDatenbank.Items.Add(dr("Database_Name"))
|
|
Loop
|
|
cmbDatenbank.DroppedDown = True
|
|
End If
|
|
connection.Close()
|
|
Catch ex As Exception
|
|
MsgBox("Error in Show Databases: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
|
|
End Try
|
|
Cursor = Cursors.Default
|
|
End Sub
|
|
|
|
Private Sub frmConfig_Basic_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
CheckBoxIndexResult.Checked = CONFIG.Config.ShowIndexResult
|
|
CheckBoxPreviewDocs.Checked = CONFIG.Config.FilePreview
|
|
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 ERROR_STATE = "NO DB-CONNECTION" Then
|
|
MsgBox("Configurations only editable after Application started completely!", MsgBoxStyle.Exclamation)
|
|
Me.TabControl1.SelectedIndex = 0
|
|
Exit Sub
|
|
End If
|
|
If USER_LANGUAGE = "de-DE" Then
|
|
cmbLanguage.SelectedIndex = 0
|
|
Else
|
|
cmbLanguage.SelectedIndex = 1
|
|
End If
|
|
'chkdelete_origin.Checked = CURR_DELETE_ORIGIN
|
|
Case 2
|
|
If ERROR_STATE = "NO DB-CONNECTION" Then
|
|
MsgBox("Configurations only editable after Application started completely!", MsgBoxStyle.Exclamation)
|
|
Me.TabControl1.SelectedIndex = 0
|
|
Exit Sub
|
|
End If
|
|
reload = True
|
|
Dim folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & USER_ID, MyConnectionString)
|
|
If Not folderwatch Is Nothing Then
|
|
CURRENT_FOLDERWATCH = folderwatch
|
|
End If
|
|
Me.txtFolderWatch.Text = CURRENT_FOLDERWATCH
|
|
Dim SCAN_folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & USER_ID, MyConnectionString)
|
|
If Not SCAN_folderwatch Is Nothing Then
|
|
CURRENT_SCAN_FOLDERWATCH = SCAN_folderwatch
|
|
End If
|
|
Me.txtFolderWatch.Text = CURRENT_FOLDERWATCH
|
|
Me.txtScanFolderWatch.Text = CURRENT_SCAN_FOLDERWATCH
|
|
|
|
If Not ClassFolderWatcher.FolderWatcher Is Nothing Then
|
|
If ClassFolderWatcher.FolderWatcher.EnableRaisingEvents = True Then
|
|
If USER_LANGUAGE = "de-DE" Then
|
|
btnstartstop1.Text = "Überwachung stoppen"
|
|
Else
|
|
btnstartstop1.Text = "Stop hotfolder"
|
|
End If
|
|
|
|
btnstartstop1.Image = My.Resources.bell_delete
|
|
Else
|
|
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
|
|
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
|
|
|
|
If Not ClassFolderWatcher.FolderWatcher_SCAN Is Nothing Then
|
|
If ClassFolderWatcher.FolderWatcher_SCAN.EnableRaisingEvents = True Then
|
|
If USER_LANGUAGE = "de-DE" Then
|
|
btnstartstop2.Text = "Überwachung stoppen"
|
|
Else
|
|
btnstartstop2.Text = "Stop hotfolder"
|
|
End If
|
|
|
|
btnstartstop2.Image = My.Resources.bell_delete
|
|
Else
|
|
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
|
|
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
|
|
Me.DataGridView1.DataSource = DTEXCLUDE_FILES
|
|
End Select
|
|
End Sub
|
|
|
|
Private Sub btnFW_Desktop_Click(sender As Object, e As EventArgs) Handles btnFW_Desktop.Click
|
|
CURRENT_FOLDERWATCH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "GlobalIndexer")
|
|
CheckFolder(CURRENT_FOLDERWATCH, "DEFAULT")
|
|
End Sub
|
|
Sub CheckFolder(mypath As String, FOLDER_TYPE As String)
|
|
Try
|
|
If mypath = "" Then
|
|
ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & USER_ID & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'", True)
|
|
If FOLDER_TYPE = "SCAN" Then
|
|
CURRENT_SCAN_FOLDERWATCH = ""
|
|
CONFIG.Config.FolderWatchScanStarted = False
|
|
CONFIG.Save()
|
|
Else
|
|
FW_started = False
|
|
'SaveConfigValue("FW_started", "False")
|
|
CONFIG.Config.FolderWatchStarted = False
|
|
CONFIG.Save()
|
|
CURRENT_FOLDERWATCH = ""
|
|
End If
|
|
|
|
Exit Sub
|
|
End If
|
|
Try
|
|
If (Not System.IO.Directory.Exists(mypath)) Then
|
|
System.IO.Directory.CreateDirectory(mypath)
|
|
End If
|
|
Catch ex As Exception
|
|
LOGGER.Info(" >> Unexpected error in CheckFolder: " & mypath)
|
|
LOGGER.Error(ex)
|
|
LOGGER.Info(" >> " & ex.Message)
|
|
If USER_LANGUAGE = "de-DE" Then
|
|
MsgBox("Unexpected error in ECheckFolder: " & 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 = " & USER_ID & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'", MyConnectionString)
|
|
Dim sql As String
|
|
If folderwatch Is Nothing Then
|
|
sql = "INSERT INTO TBGI_FOLDERWATCH_USER (USER_ID, FOLDER_PATH, FOLDER_TYPE, ADDED_WHO) VALUES (" & USER_ID & ",'" & mypath & "','" & FOLDER_TYPE & "','" & Environment.UserName & "')"
|
|
Else
|
|
sql = "UPDATE TBGI_FOLDERWATCH_USER SET FOLDER_PATH = '" & mypath & "', CHANGED_WHO = '" & Environment.UserName & "' where GUID = " & folderwatch
|
|
End If
|
|
If ClassDatabase.Execute_non_Query(sql) Then
|
|
folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & USER_ID & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'", MyConnectionString)
|
|
|
|
If FOLDER_TYPE = "SCAN" Then
|
|
CURRENT_SCAN_FOLDERWATCH = folderwatch
|
|
Me.txtScanFolderWatch.Text = CURRENT_SCAN_FOLDERWATCH
|
|
Else
|
|
CURRENT_FOLDERWATCH = folderwatch
|
|
Me.txtFolderWatch.Text = CURRENT_FOLDERWATCH
|
|
End If
|
|
End If
|
|
If FW_started = True And FOLDER_TYPE = "DEFAULT" Then
|
|
ClassFolderWatcher.Restart_FolderWatch()
|
|
End If
|
|
If CONFIG.Config.FolderWatchScanStarted = True And FOLDER_TYPE = "SCAN" Then
|
|
ClassFolderWatcher.Restart_FolderWatchSCAN()
|
|
End If
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in CheckFolder:")
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Private Sub btnFW_OwnFiles_Click(sender As Object, e As EventArgs) Handles btnFW_OwnFiles.Click
|
|
CURRENT_FOLDERWATCH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "GlobalIndexer")
|
|
CheckFolder(CURRENT_FOLDERWATCH, "DEFAULT")
|
|
End Sub
|
|
|
|
Private Sub btnstartstop1_Click(sender As Object, e As EventArgs) Handles btnstartstop1.Click
|
|
If CURRENT_FOLDERWATCH <> "" Then
|
|
CheckFW_State()
|
|
End If
|
|
|
|
End Sub
|
|
Sub CheckFW_State()
|
|
Select Case ClassFolderWatcher.StartStop_FolderWatch()
|
|
Case 1
|
|
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
|
|
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
|
|
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
|
|
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
|
|
|
|
Private Sub btnsetFW_Folder_Click(sender As Object, e As EventArgs) Handles btnsetFW_Folder.Click
|
|
Dim fbdialog As New FolderBrowserDialog
|
|
If txtFolderWatch.Text <> "" Then
|
|
fbdialog.SelectedPath = txtFolderWatch.Text
|
|
End If
|
|
If fbdialog.ShowDialog() = DialogResult.OK Then
|
|
CheckFolder(fbdialog.SelectedPath, "DEFAULT")
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged
|
|
If formloaded = True Then
|
|
CONFIG.Config.LogErrorsOnly = chkLogErrorsOnly.Checked
|
|
CONFIG.Save()
|
|
'SaveConfigValue("LogErrorsOnly", chkLogErrorsOnly.Checked)
|
|
LOGGER.Info(" >> LogErrorsOnly changed to '" & chkLogErrorsOnly.Checked)
|
|
LogErrorsOnly = chkLogErrorsOnly.Checked
|
|
LOGCONFIG.Debug = Not 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()
|
|
Try
|
|
If Not MyConnectionString = String.Empty Then
|
|
Dim csb As New SqlClient.SqlConnectionStringBuilder
|
|
csb.ConnectionString = MyConnectionString
|
|
Dim constr = MyConnectionString
|
|
Try
|
|
If Not constr.Contains("Trusted_Connection") Then
|
|
Try
|
|
constr = constr.Replace(csb.Password, "XXXXX")
|
|
Catch ex As Exception
|
|
chkbxUserAut.Checked = False
|
|
End Try
|
|
Else
|
|
chkbxUserAut.Checked = True
|
|
End If
|
|
Catch ex As Exception
|
|
End Try
|
|
|
|
|
|
Me.txtActualConnection.Text = constr
|
|
End If
|
|
|
|
If ERROR_STATE = "FAILED DBCONNECTION" Then
|
|
Me.TabControl1.SelectedIndex = 0
|
|
ElseIf ERROR_STATE = "NO DB-CONNECTION" Then
|
|
Me.TabControl1.SelectedIndex = 0
|
|
End If
|
|
Catch ex As Exception
|
|
MsgBox("Unexpected Error in Load_Basics:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
|
End Try
|
|
|
|
End Sub
|
|
Private Sub btnopenlog_Click(sender As Object, e As EventArgs) Handles btnopenlog.Click
|
|
Process.Start(ClassLogger.DateiSpeicherort)
|
|
End Sub
|
|
Private Sub btnApplicationFolder_Click(sender As Object, e As EventArgs) Handles btnApplicationFolder.Click
|
|
Process.Start(Application.UserAppDataPath())
|
|
End Sub
|
|
|
|
Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxIndexResult.CheckedChanged
|
|
CONFIG.Config.ShowIndexResult = CheckBoxIndexResult.Checked
|
|
CONFIG.Save()
|
|
End Sub
|
|
|
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
|
Dim fbdialog As New FolderBrowserDialog
|
|
If txtScanFolderWatch.Text <> "" Then
|
|
fbdialog.SelectedPath = txtScanFolderWatch.Text
|
|
End If
|
|
If fbdialog.ShowDialog() = DialogResult.OK Then
|
|
CheckFolder(fbdialog.SelectedPath, "SCAN")
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles btnstartstop2.Click
|
|
If CURRENT_SCAN_FOLDERWATCH <> "" Then
|
|
CheckFWSCAN_State()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxPreviewDocs.CheckedChanged
|
|
CONFIG.Config.FilePreview = CheckBoxPreviewDocs.Checked
|
|
CONFIG.Save()
|
|
End Sub
|
|
|
|
Private Sub txtScanFolderWatch_TextChanged(sender As Object, e As EventArgs) Handles txtScanFolderWatch.TextChanged
|
|
If reload = True Then Exit Sub
|
|
CheckFolder(txtScanFolderWatch.Text, "SCAN")
|
|
End Sub
|
|
|
|
Private Sub txtFolderWatch_TextChanged(sender As Object, e As EventArgs) Handles txtFolderWatch.TextChanged
|
|
If reload = True Then Exit Sub
|
|
CheckFolder(txtFolderWatch.Text, "DEFAULT")
|
|
End Sub
|
|
|
|
Private Sub btnSaveExclusionFiles_Click(sender As Object, e As EventArgs) Handles btnSaveExclusionFiles.Click
|
|
DTEXCLUDE_FILES.AcceptChanges()
|
|
DTEXCLUDE_FILES.WriteXml(PATH_FileExclusions)
|
|
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-US"
|
|
End Select
|
|
|
|
Dim update As String = "UPDATE TBDD_USER SET [LANGUAGE] = '" & lang & "' WHERE GUID = " & USER_ID
|
|
USER_LANGUAGE = lang
|
|
|
|
If ClassDatabase.Execute_non_Query(update, True) = True Then
|
|
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
|
|
Private Sub chkbxUserAut_CheckedChanged(sender As Object, e As EventArgs) Handles chkbxUserAut.CheckedChanged
|
|
If chkbxUserAut.Checked Then
|
|
Me.txtPasswort.Enabled = False
|
|
Me.txtUser.Enabled = False
|
|
Else
|
|
Me.txtPasswort.Enabled = True
|
|
Me.txtUser.Enabled = True
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
|
|
' Specify that the link was visited.
|
|
Me.LinkLabel1.LinkVisited = True
|
|
' Navigate to a URL.
|
|
System.Diagnostics.Process.Start("http://www.didalog.de/Support")
|
|
End Sub
|
|
|
|
'Private Sub chkdelete_origin_CheckedChanged(sender As Object, e As EventArgs) Handles chkdelete_origin.CheckedChanged
|
|
' If CURR_DELETE_ORIGIN <> chkdelete_origin.Checked Then
|
|
' CURR_DELETE_ORIGIN = chkdelete_origin.Checked
|
|
' SaveConfigValue("Delete_OriginFile", CURR_DELETE_ORIGIN)
|
|
' End If
|
|
'End Sub
|
|
End Class |