aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-12-24 09:08:25 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-12-24 09:08:25 +0200
commit2f77ad3cebf771bdf02188174c9712027b004d41 (patch)
tree32d819fbbb57063b9289d39f1cacf4febb83ea28 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
parent0cc8f5b14286302880f56aaa20a7078b92579a97 (diff)
parent99a48d7c388792c96ce7ac1b4e1436d395c4aec1 (diff)
downloadTango-2f77ad3cebf771bdf02188174c9712027b004d41.tar.gz
Tango-2f77ad3cebf771bdf02188174c9712027b004d41.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
index a37879a5e..4e659d46a 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
@@ -6,6 +6,8 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.BL;
+using Tango.BL.Enumerations;
using Tango.Core.Commands;
using Tango.Core.Cryptography;
using Tango.MachineStudio.Common;
@@ -90,7 +92,7 @@ namespace Tango.MachineStudio.UI.ViewModels
_navigationManager = navigationManager;
_authenticationProvider = authenticationProvider;
_eventLogger = eventLogger;
- LoginCommand = new RelayCommand(Login,() => !IsLogging);
+ LoginCommand = new RelayCommand(Login, () => !IsLogging);
cryptographer = new Rfc2898Cryptographer();
Email = _settings.LastLoginEmail;
@@ -121,6 +123,10 @@ namespace Tango.MachineStudio.UI.ViewModels
await Task.Factory.StartNew(() =>
{
_authenticationProvider.Login(Email, Password);
+
+ ObservablesStaticCollections.Instance.Initialize();
+ _eventLogger.Log(EventTypes.ApplicationStarted, "Application Started!");
+
_navigationManager.NavigateTo(NavigationView.MainView);
_settings.LastLoginEmail = Email;
_settings.RememberMe = RememberMe;
@@ -128,13 +134,13 @@ namespace Tango.MachineStudio.UI.ViewModels
_settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null;
_settings.Save();
- _eventLogger.Log("User logged in");
+ _eventLogger.Log("User logged in.");
});
}
- catch (Exception)
+ catch (Exception ex)
{
-
- _notificationProvider.ShowError("Invalid credentials. Please try again.");
+ LogManager.Log(ex, "Login Error.");
+ _notificationProvider.ShowError($"The specified email or password was incorrect, or you don't have a permission to run this application.\nError: {ex.Message}");
}
finally
{