Download Manager + Download Controller aufgeräumt

This commit is contained in:
2024-06-06 13:02:19 +02:00
parent 6f0c28a7c7
commit e2cf258f36
22 changed files with 277 additions and 131 deletions

View File

@@ -63,6 +63,9 @@
<setting name="FirstInstallationSuccess" serializeAs="String">
<value>False</value>
</setting>
<setting name="InstallLocationSetSuccess" serializeAs="String">
<value>False</value>
</setting>
</BeWoLauncher.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -14,7 +14,7 @@
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>D:\Test\Launcher\</PublishUrl>
<PublishUrl>C:\Test\Launcher\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
@@ -25,7 +25,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>

View File

@@ -81,6 +81,8 @@ namespace BeWoLauncher
}
public static void ShowError(string message, string ex, bool showDetails)
{
ViewController.EndWaiting();
if (ViewController.CurrentWindow is null)
{
MessageBox.Show(ex, message);

View File

@@ -4,6 +4,7 @@ using BeWoLauncher.Logic.Utils;
using BS.SharedLauncher.Extensions;
using BS.SharedLauncher.Information;
using System;
using System.IO;
using System.Threading.Tasks;
using static BeWoLauncher.Logic.Controller.ViewController;
@@ -18,10 +19,7 @@ namespace BeWoLauncher.Logic.Behavior
}
/// <summary>
/// Waiting aktiv, Nutzer wurde erfolgreich angemeldet
/// </summary>
public void LaunchUpdatePhase()
public void LoginSuccessful()
{
#region confirm demo
#if DEBUG
@@ -39,60 +37,94 @@ namespace BeWoLauncher.Logic.Behavior
#endif
#endregion
var path = LauncherPaths.GetInstallLocationFromSetting();
DownloadController.Start(LauncherPaths.GetLoggerPath());
LauncherPaths.ActualPlanerLocation = path;
var planer_location_set = LauncherAppdataConfig.GetInstallLocationSetSuccess();
if (!string.IsNullOrWhiteSpace(path) && !CheckForPermissions(path))
var path_to_check = planer_location_set
? LauncherAppdataConfig.GetPlanerLocation()
: LauncherPaths.GetPlanerLocationFromSettingOrDefault();
var check = IsDirectoryWritable(path_to_check);
if (!check)
{
ViewBehavior.ShowNoPermissions(path);
ViewBehavior.ShowNoPermissions(path_to_check);
return;
}
LauncherPaths.PlanerLocation = path_to_check;
if (planer_location_set)
{
if (UninstallMode)
{
// optional: Hier kann man ggf zusatzlich prüfen, ob InstallLocationSetSuccess gesetzt ist
// Ziel: Erweiterte Fehler/Rechte Erkennung
StartUninstallInfoPhase();
}
else
{
StartUpdateInfoPhase();
}
}
else
{
DownloadController.Start();
if (UninstallMode)
LaunchUninstall();
else
LoadUpdates();
// Install
StartInstallInfoPhase();
}
EndWaiting();
}
public void LaunchUninstall()
public void StartInstallInfoPhase()
{
DownloadController.GetDeletePlan();
ViewBehavior.ShowUninstallInfo();
}
var error = DownloadController.TryLoadInstallPlan();
public void LoadUpdates()
{
var handled = DownloadController.GetUpdatePlan();
if (handled)
return;
if (DownloadController.CanQuickStartLauncher())
if(error is null)
{
if (DownloadController.DoesPlanerExeExists())
{
GenericTextLogger.Post("Launcher ist aktuell oder Download Server nicht erreichbar.");
ViewBehavior.ShowLoading();
}
else
{
GenericTextLogger.Post("BewoPlaner.exe nicht gefunden.");
ViewBehavior.ShowError("BewoPlaner.exe nicht gefunden.");
}
ViewBehavior.ShowInfo(false);
}
else
{
GenericTextLogger.Post("Launcher hat etwas zu tun.");
GenericTextLogger.Post(error);
ViewBehavior.ShowInfo();
ViewBehavior.ShowError(error);
}
}
public void StartUpdateInfoPhase()
{
var error = DownloadController.TryLoadUpdatePlan(out bool can_quick_start);
if (error is null)
{
if (can_quick_start)
ViewBehavior.ShowLoading();
else
ViewBehavior.ShowInfo(true);
}
else
{
GenericTextLogger.Post(error);
ViewBehavior.ShowError(error);
}
}
public void StartUninstallInfoPhase()
{
var error = DownloadController.TryLoadUninstallPlan();
if (error is null)
{
ViewBehavior.ShowUninstallInfo();
}
else
{
GenericTextLogger.Post(error);
ViewBehavior.ShowError(error);
}
}

View File

@@ -64,12 +64,11 @@ namespace BeWoLauncher.Logic.Behavior
CurrentFrame = ViewController.ViewBuilder.GetNewFrame(ft);
}
public void ShowInfo()
public void ShowInfo(bool is_update)
{
ViewController.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
{
if (LauncherAppdataConfig.GetFirstInstallationSuccess() &&
File.Exists(LauncherPaths.GetPlanerExePath()))
if (is_update)
{
ShowFrame(FrameType.UpdateInfo);
}
@@ -134,18 +133,16 @@ namespace BeWoLauncher.Logic.Behavior
}
public void LoginSuccessful(object sender, EventArgs e)
{
Task.Run(() => ViewController.LaunchBehavior.LaunchUpdatePhase());
Task.Run(() => ViewController.LaunchBehavior.LoginSuccessful());
}
public void InstallInfoAccept(object sender, EventArgs e)
{
var install = sender as InstallInfoFrame;
if (CheckForPermissions(install.InstallLocation))
if (IsDirectoryWritable(install.InstallLocation))
{
DownloadController.InitLogger();
LauncherPaths.SetAndSaveInstallLocation(install.InstallLocation);
LauncherAppdataConfig.SetFirstInstallationSuccess(true);
ShowFrame(FrameType.InstallProgress);
}
else

View File

@@ -2,6 +2,7 @@
using BeWoLauncher.Logic.Utils.Download;
using BS.SharedLauncher.Extensions;
using BS.SharedLauncher.Information;
using BS.SharedLauncher.Logic;
using BS.SharedLauncher.Utils;
using System;
using System.IO;
@@ -18,30 +19,29 @@ namespace BeWoLauncher.Logic.Controller
static DownloadController()
{
}
public static void Start()
public static void Start(string logger_path = null)
{
Manager = new DownloadManager();
if (LauncherAppdataConfig.GetFirstInstallationSuccess())
InitLogger();
if (!string.IsNullOrEmpty(logger_path))
{
GenericTextLogger.Init(logger_path);
}
}
public static void InitLogger()
/// <summary>
///
/// </summary>
/// <returns>Error string - null if successful</returns>
public static string TryLoadInstallPlan()
{
GenericTextLogger.Init(LauncherPaths.GetLoggerPath());
}
GenericTextLogger.PostImportantInfo("Starting Install Process");
public static bool GetUpdatePlan()
{
GenericTextLogger.PostImportantInfo("Starting Update Process");
Manager.CheckForConnection();
if (!Manager.IsDownloadServerUp)
return false;
if (!CheckConnection())
return "Download server is down";
try
{
@@ -55,24 +55,78 @@ namespace BeWoLauncher.Logic.Controller
GenericTextLogger.Post($"Anfrage wurde erfolgreich verarbeitet. Server gibt Version {client_version} vor.");
SessionInformation.Session.Version = client_version;
return null;
}
else
{
GenericTextLogger.Post($"Server gibt Fehler zurück. Fehler: {response.Error}");
ViewController.ShowError(response.Error);
return true;
return $"Server gibt Fehler zurück. Fehler: {response.Error}";
}
}
catch(Exception e)
catch (Exception e)
{
ViewController.ShowError(e);
return true;
return e.ToString();
}
}
public static string TryLoadUpdatePlan(out bool can_quick_start)
{
GenericTextLogger.PostImportantInfo($"Starting Update Process");
can_quick_start = false;
if (!CheckConnection())
{
if (DoesPlanerExeExists())
{
can_quick_start = true;
return null;
}
else
{
return "Download server is down & quickstart not possible";
}
}
return false;
try
{
Manager.GetUpdatePlan();
var response = Manager.UpdatePlanResponse;
if (response.Successful)
{
var client_version = response.CurrentPackage.Version;
GenericTextLogger.Post($"Anfrage wurde erfolgreich verarbeitet. Server gibt Version {client_version} vor.");
if (!response.HasToDo())
can_quick_start = true;
return null;
}
else
{
return $"Server gibt Fehler zurück. Fehler: {response.Error}";
}
}
catch (Exception e)
{
return e.ToString();
}
}
public static string TryLoadUninstallPlan()
{
try
{
Manager.GetDeletePlan();
return null;
}
catch (Exception e)
{
return e.ToString();
}
}
public static bool DoesPlanerExeExists()
@@ -86,28 +140,7 @@ namespace BeWoLauncher.Logic.Controller
}
return false;
}
public static void GetDeletePlan()
{
Manager.GetDeletePlan();
}
public static bool CanQuickStartLauncher()
{
try
{
if (!Manager.IsDownloadServerUp)
return true;
if (!Manager.UpdatePlanResponse.HasToDo())
return true;
}
catch
{
}
return false;
}
@@ -123,5 +156,17 @@ namespace BeWoLauncher.Logic.Controller
else
return "error";
}
private static bool CheckConnection()
{
GenericTextLogger.Post("Checking download server connection...");
var check = Manager.CheckForConnection();
if (check)
GenericTextLogger.Post("Download server is up");
else
GenericTextLogger.Post("Download server is down");
return check;
}
}
}

View File

@@ -80,9 +80,9 @@ namespace BeWoLauncher.Logic.Controller
public static void StartWaiting() => CurrentWindow.StartWaiting();
public static void EndWaiting() => CurrentWindow.EndWaiting();
public static bool CheckForPermissions(string path)
public static bool IsDirectoryWritable(string path)
{
return FileController.IsDirectoryWritable(path, false);
return FileController.IsDirectoryWritable(path);
}
public static void CheckForAutoLogin(object sender, EventArgs e)
{

View File

@@ -61,7 +61,7 @@ namespace BeWoLauncher.Logic.Utils.Download
{
UpdatePlanResponse = new UpdatePlanResponse();
if (LauncherPaths.ActualPlanerLocation.Exists())
if (LauncherPaths.PlanerLocation.Exists())
{
if (ApplyFolder.Exists())
if (!ApplyFolder.IsFolderEmpty())
@@ -221,7 +221,7 @@ namespace BeWoLauncher.Logic.Utils.Download
{
UpdatePlanRequest = new UpdatePlanRequest();
if (UpdatePlanRequest.PlanerRootFolderExists = LauncherPaths.ActualPlanerLocation.Exists())
if (UpdatePlanRequest.PlanerRootFolderExists = LauncherPaths.PlanerLocation.Exists())
{
if (UpdatePlanRequest.DownloadFolderExists = DownloadFolder.Exists())
if (!(UpdatePlanRequest.DownloadFolderIsEmpty = DownloadFolder.IsFolderEmpty()))
@@ -254,7 +254,7 @@ namespace BeWoLauncher.Logic.Utils.Download
UpdatePlanResponse = LauncherServiceFacade.DoDownloadBeWoServiceSyncWithException(x => x.GetUpdatePlan(UpdatePlanRequest));
}
public void CheckForConnection()
public bool CheckForConnection()
{
bool test_connection = false;
@@ -268,6 +268,8 @@ namespace BeWoLauncher.Logic.Utils.Download
}
IsDownloadServerUp = test_connection;
return test_connection;
}
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -8,17 +9,39 @@ namespace BeWoLauncher.Logic.Utils
{
public static class LauncherAppdataConfig
{
public static string GetInstallLocation()
private static string _Location;
public static string Location
{
return Properties.Settings.Default.InstallLocation;
get => _Location ?? (_Location = GetLauncherAppdataConfigLocation());
set { _Location = value; }
}
public static void SetInstallLocation(string path)
public static string GetPlanerLocation()
{
var path = Properties.Settings.Default.InstallLocation;
return string.IsNullOrWhiteSpace(path) ? null : path;
}
public static void SetPlanerLocation(string path)
{
Properties.Settings.Default.InstallLocation = path;
Properties.Settings.Default.Save();
}
public static bool GetInstallLocationSetSuccess()
{
return Properties.Settings.Default.InstallLocationSetSuccess;
}
public static void SetInstallLocationSetSuccess(bool b)
{
Properties.Settings.Default.InstallLocationSetSuccess = b;
Properties.Settings.Default.Save();
}
public static bool GetFirstInstallationSuccess()
{
return Properties.Settings.Default.FirstInstallationSuccess;
@@ -29,5 +52,18 @@ namespace BeWoLauncher.Logic.Utils
Properties.Settings.Default.FirstInstallationSuccess = b;
Properties.Settings.Default.Save();
}
private static string GetLauncherAppdataConfigLocation()
{
try
{
var UserConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
return UserConfig.FilePath;
}
catch (ConfigurationException e)
{
return e.Filename;
}
}
}
}

View File

@@ -19,16 +19,16 @@ namespace BeWoLauncher.Logic.Utils
//private static readonly string versionXml = "bewo.version";
public static string LoginSelectionPlanerLocation { get; set; }
public static string ActualPlanerLocation { get; set; }
public static string PlanerLocation { get; set; }
/// <summary>
/// Holt den Install Ort aus den Properties Settings.
/// Sollte dieser nicht verfügbar sein, wird als default - "CurrentBaseDir"/BeWoPlaner - verwendet
/// </summary>
/// <returns></returns>
public static string GetInstallLocationFromSettingOrDefault()
public static string GetPlanerLocationFromSettingOrDefault()
{
var installLocation = GetInstallLocationFromSetting();
var installLocation = GetPlanerLocationFromSetting();
if (string.IsNullOrWhiteSpace(installLocation))
{
@@ -38,9 +38,9 @@ namespace BeWoLauncher.Logic.Utils
return installLocation;
}
public static string GetInstallLocationFromSetting()
public static string GetPlanerLocationFromSetting()
{
return LauncherAppdataConfig.GetInstallLocation();
return LauncherAppdataConfig.GetPlanerLocation();
}
/// <summary>
@@ -71,18 +71,19 @@ namespace BeWoLauncher.Logic.Utils
public static void SetAndSaveInstallLocation(string path)
{
ActualPlanerLocation = path;
PlanerLocation = path;
LauncherAppdataConfig.SetInstallLocation(path);
LauncherAppdataConfig.SetPlanerLocation(path);
LauncherAppdataConfig.SetInstallLocationSetSuccess(true);
}
public static string GetRootPath()
{
return ActualPlanerLocation;
return PlanerLocation;
}
public static string GetLoggerPath()
{
return Path.Combine(new string[] { GetRootPath(), "log" });
return Path.Combine(new string[] { LauncherAppdataConfig.Location, "log" });
}
public static string GetDownloadPath()
{

View File

@@ -12,7 +12,7 @@ namespace BeWoLauncher.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -46,5 +46,17 @@ namespace BeWoLauncher.Properties {
this["FirstInstallationSuccess"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool InstallLocationSetSuccess {
get {
return ((bool)(this["InstallLocationSetSuccess"]));
}
set {
this["InstallLocationSetSuccess"] = value;
}
}
}
}

View File

@@ -8,5 +8,8 @@
<Setting Name="FirstInstallationSuccess" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="InstallLocationSetSuccess" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -2,6 +2,7 @@
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markup="clr-namespace:BeWoLauncher.MultiLanguage.Markup"
Title="Proxy Einstellungen" Height="200" Width="300">
<Grid>
<Button x:Name="proxyOK" Content="OK" HorizontalAlignment="Left" Margin="75,120,0,0" VerticalAlignment="Top" Width="100" Click="proxyOK_Click"/>
@@ -9,8 +10,8 @@
<Label Content="Proxyname:" HorizontalAlignment="Left" Margin="10,15,0,0" VerticalAlignment="Top" Width="100"/>
<Label Content="Benutzername:" HorizontalAlignment="Left" Margin="10,45,0,0" VerticalAlignment="Top" Width="100"/>
<Label Content="Passwort:" HorizontalAlignment="Left" Margin="10,75,0,0" VerticalAlignment="Top" Width="100"/>
<Label Content="{markup:Translate Benutzername:}" HorizontalAlignment="Left" Margin="10,45,0,0" VerticalAlignment="Top" Width="100"/>
<Label Content="Passwort:" HorizontalAlignment="Left" Margin="10,75,0,0" VerticalAlignment="Top" Width="100"/>
<TextBox x:Name="proxynametxt" HorizontalAlignment="Left" Height="23" Margin="120,15,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="160" SelectionOpacity="0.5" />
<TextBox x:Name="proxybenutzer" HorizontalAlignment="Left" Height="23" Margin="120,45,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="160" SelectionOpacity="0.5"/>

View File

@@ -2,6 +2,7 @@
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markup="clr-namespace:BeWoLauncher.MultiLanguage.Markup"
Title="PwVergessenView" Height="135" Width="322" WindowStartupLocation="CenterScreen" WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
@@ -18,9 +19,9 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Red" Margin="3,8,3,3"/>
<Label Grid.Row="1" Grid.Column="0" Margin="3" Content="Benutzername" />
<TextBox x:Name="BenutzernamenTextBox" Grid.Row="1" Grid.Column="1" MaxLines="1" Margin="3" />
<TextBlock Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Red" Margin="3,8,3,3"/>
<Label Grid.Row="1" Grid.Column="0" Margin="3" Content="{markup:Translate Benutzername}" />
<TextBox x:Name="BenutzernamenTextBox" Grid.Row="1" Grid.Column="1" MaxLines="1" Margin="3" />
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Stretch">
<Button Margin="3" Content="Neues Passwort anfordern" Width="150" Click="AnfordernClick" IsDefault="True" VerticalContentAlignment="Center" />
<Button Margin="3" Content="Abbrechen" Width="150" Command="Close" />

View File

@@ -27,7 +27,7 @@ namespace BeWoLauncher.Components
var benutzername = BenutzernamenTextBox.Text;
if (benutzername.Equals(""))
{
MessageBox.Show("Bitte geben Sie einen Benutzernamen an", "Passwort anfordern fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
MessageBox.Show("Bitte geben Sie einen " + BS.SharedLauncher.Translation.Translator.Translate("Benutzernamen") + " an", "Passwort anfordern fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
@@ -38,7 +38,7 @@ namespace BeWoLauncher.Components
{
if(email.Equals("") || !hatEmail)
{
MessageBox.Show("Es konnte kein Benutzer mit diesem Namen gefunden werden oder der Benutzer hat keine E-Mail Adresse hinterlegt\nBitte wenden Sie sich an Ihren Systemadministrator", "Passwort anfordern fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
MessageBox.Show("Es konnte " + BS.SharedLauncher.Translation.Translator.Translate("kein Benutzer") + " mit diesem Namen gefunden werden oder " + BS.SharedLauncher.Translation.Translator.Translate("der Benutzer") + " hat keine E-Mail Adresse hinterlegt\nBitte wenden Sie sich an " + BS.SharedLauncher.Translation.Translator.Translate("Ihren Systemadministrator") + ".", "Passwort anfordern fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}

View File

@@ -21,7 +21,7 @@ namespace BeWoLauncher.View.Frames
{
InitializeComponent();
InstallLocation = LauncherPaths.GetInstallLocationFromSettingOrDefault();
InstallLocation = LauncherPaths.PlanerLocation;
var size = NonspecificTools.SizeSuffix((ulong)DownloadController.Manager.UpdatePlanResponse.DownloadSize).Split(' ');

View File

@@ -31,14 +31,12 @@ namespace BeWoLauncher.View.Frames
{
InitializeComponent();
LauncherPaths.ActualPlanerLocation = LauncherPaths.GetInstallLocationFromSetting();
var size = NonspecificTools.SizeSuffix((ulong)DownloadController.Manager.UpdatePlanResponse.DownloadSize).Split(' ');
lblErforderlich.Content = size[0];
lblErforderlichSize.Content = size[1];
var size2 = DownloadController.UpdateDiskSpace(LauncherPaths.ActualPlanerLocation).Split(' ');
var size2 = DownloadController.UpdateDiskSpace(LauncherPaths.PlanerLocation).Split(' ');
if(size2.Length > 1)
{

View File

@@ -173,10 +173,10 @@
</Hyperlink>
</TextBlock>
</StackPanel>
<TextBlock x:Name="txtCopyright" Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="10" Margin="10,5,0,5" Text="Copyright 2017 | beyondSoft GmbH" Foreground="#FF818181"/>
<TextBlock x:Name="txtCopyright" Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="10" Margin="10,5,0,5" Text="Copyright 2022 | ownSoft GmbH" Foreground="#FF818181"/>
<TextBlock Grid.Row="9" Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="10" Margin="0,5,12,5">
<Hyperlink x:Name="hyperlink" TargetName="newWindow" Foreground="#FF818181" NavigateUri="http://www.beyondsoft.de" RequestNavigate="Hyperlink_OnRequestNavigate">www.beyondsoft.de</Hyperlink>
<Hyperlink x:Name="hyperlink" TargetName="newWindow" Foreground="#FF818181" NavigateUri="https://www.ownsoft.de" RequestNavigate="Hyperlink_OnRequestNavigate">www.ownsoft.de</Hyperlink>
</TextBlock>
</Grid>
</Border>

View File

@@ -6,7 +6,7 @@ using BeWoLauncher.ServiceProxy;
using BeWoLauncher.WindowImp;
using BS.SharedLauncher.Enums;
using BS.SharedLauncher.Information;
using BS.SharedLauncher.Translation;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -335,7 +335,7 @@ namespace BeWoLauncher.View
if (DateTime.Now > dt)
dt = DateTime.Now;
txtCopyright.Text = String.Format("Copyright {0:yyyy} | beyondSoft GmbH", dt);
txtCopyright.Text = String.Format("Copyright {0:yyyy} | ownSoft GmbH", dt);
var checkPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\profiles.txt";
if (File.Exists(checkPath))
@@ -1056,7 +1056,16 @@ namespace BeWoLauncher.View
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)delegate
{
ViewController.EndWaiting();
MessageBox.Show("Anmeldeinformationen nicht bekannt. Bitte überprüfen Sie den Benutzernamen und das Passwort!", "Fehler bei der Anmeldung", MessageBoxButton.OK, MessageBoxImage.Exclamation);
MessageBox.Show("Anmeldeinformationen nicht bekannt. Bitte überprüfen Sie den " + BS.SharedLauncher.Translation.Translator.Translate("Benutzernamen") + " und das Passwort!", "Fehler bei der Anmeldung", MessageBoxButton.OK, MessageBoxImage.Exclamation);
});
}
if (result == UserValidationResult.EmployeeDeleted)
{
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)delegate
{
ViewController.EndWaiting();
MessageBox.Show("Der zugeordnete Mitarbeiterdatensatz wurde gelöscht oder archiviert! Anmeldung nicht möglich.", "Fehler bei der Anmeldung", MessageBoxButton.OK, MessageBoxImage.Exclamation);
MessageBox.Show("Der zugeordnete " + Translator.Translate("Mitarbeiterdatensatz") + " wurde gelöscht oder archiviert! Anmeldung nicht möglich.", "Fehler bei der Anmeldung", MessageBoxButton.OK, MessageBoxImage.Exclamation);
});
}
if (result == UserValidationResult.TenantUnknown)
@@ -1214,6 +1223,7 @@ namespace BeWoLauncher.View
});
}
}
public void ClickLogin() => button_login_Click(this, new RoutedEventArgs());
}
}

View File

@@ -47,6 +47,7 @@ namespace BeWo.Service.ServiceImplementations
{ BS.Shared.UserValidationResult.UnkownError, BS.SharedLauncher.Enums.UserValidationResult.UnknownError},
{ BS.Shared.UserValidationResult.UserValid, BS.SharedLauncher.Enums.UserValidationResult.UserValid},
{ BS.Shared.UserValidationResult.UserValidTwoFactorAuthenticationNeeded, BS.SharedLauncher.Enums.UserValidationResult.UnknownError},
{ BS.Shared.UserValidationResult.EmployeeDeleted, BS.SharedLauncher.Enums.UserValidationResult.EmployeeDeleted},
};
public PasswordValidationResult CheckPassword(long userOid, string pOldPassword, string pNewPassword)

View File

@@ -16,7 +16,9 @@ namespace BS.SharedLauncher.Enums
IncorrectPin = 4,
PinExpired = 5,
PinAlreadyUsed = 6,
PasswordExpired = 7
PasswordExpired = 7,
EmployeeDeleted = 8,
UserValidTwoFactorAuthenticationNeeded = 9
}
public enum LauncherPasswortSecurityStrength

View File

@@ -182,7 +182,7 @@ namespace BS.SharedLauncher.Logic
catch (Exception e)
{
if (throwIfFails)
throw;
throw e;
else
return false;
}