diff --git a/ZKuP/MainWindow.xaml.cs b/ZKuP/MainWindow.xaml.cs index c6b1215..e125909 100644 --- a/ZKuP/MainWindow.xaml.cs +++ b/ZKuP/MainWindow.xaml.cs @@ -964,12 +964,16 @@ namespace ZKuP return true; } - else if(!SQL.isOnline && SQL.isOnline != lastConn) + else if (!SQL.isOnline && SQL.isOnline != lastConn) { //await Log.WriteLog(conn.Message); - if (!Helper.IsVPNConnected()) + if(Helper.IsVPNConnected()) + { + MessageBox.Show($"Verbindung zum Server konnte nicht hergestellt werden", "Fehler", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); + } + else if (!Helper.IsVPNConnected()) { if (connMsg) { @@ -977,11 +981,8 @@ namespace ZKuP MessageBox.Show("Sie haben keine Verbindung zur Datenbank und das DB VPN 'Ivanti Secure Access (ehem. Pulse Secure)' ist nicht verbunden\n\n" + "Befinden Sie sich außerhalb des BKU Netzes, bitte die Verbindung zum VPN sicherstellen\n\n" + - "Nach Herstellen der Verbindung erneut starten\n", "VPN verbunden?", MessageBoxButton.OK, MessageBoxImage.Information);/*"Die Anwendung wird jetzt geschlossen"*/ + "Nach Herstellen der Verbindung wird die Anwendung wieder freigegeben\n", "VPN verbunden?", MessageBoxButton.OK, MessageBoxImage.Information);/*"Die Anwendung wird jetzt geschlossen"*/ } - - //Application.Current.Shutdown(); - //Environment.Exit(0); } imgConnection.Source = (ImageSource)this.FindResource("NotConnectedIcon"); diff --git a/ZKuP/SQL.cs b/ZKuP/SQL.cs index 4d39b05..6017800 100644 --- a/ZKuP/SQL.cs +++ b/ZKuP/SQL.cs @@ -261,8 +261,8 @@ namespace ZKuP { isOnline = false; - System.Windows.MessageBox.Show($"Verbindung zum Server konnte nicht hergestellt werden\n\nInterne Meldung: {ex.Message}", "Fehler", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); - throw new InvalidOperationException("MySQL Server ist nicht erreichbar"); + //System.Windows.MessageBox.Show($"Verbindung zum Server konnte nicht hergestellt werden\n\nInterne Meldung: {ex.Message}", "Fehler", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); + //throw new InvalidOperationException("MySQL Server ist nicht erreichbar"); } return false; }