/// <summary> /// The login. /// </summary> private void Login() { try { this.loginInfo = new LoginInfo(); this.loginInfo.Login = this.LoginName; this.loginInfo.Password = this.Password; UserManager userManager = new UserManager(); User user = userManager.EnterTheSystem(this.loginInfo); Application.Current.Properties["UserID"] = user.UserID; ControlManager.GetInstance().Place("MainWindow", "mainRegion", "DashboardControl"); } catch (Exception exception) { // TODO create Exception Base this.View.ShowError(exception.ToString()); } }
/// <summary> /// The sign up. /// </summary> private void SignUp() { try { this.registerInfo = new RegisterInfo(); this.registerInfo.Login = this.LoginNameReg; this.registerInfo.Password = this.PasswordReg; UserManager userManager = new UserManager(); userManager.CreateUser(this.registerInfo); ControlManager.GetInstance().Place("MainWindow", "mainRegion", "DashboardControl"); } catch (Exception exception) { var message = exception.Message; this.View.ShowError(message); } }