private void CreateMyAccountButtonCommandExecute(object obj) { IsActivated = false; validator.Refresh(true); if (OnSubmit != null) { OnSubmit(this, EventArgs.Empty); } if (validator.IsAnyError()) { IsActivated = true; return; } LogStep(MarketingActionType.Continue); //check if profile exists on local disk var authProfileExistsTuple = createAccountLayer.AuthenticateUser(UserEmailId, UserPasswordWrapper.Password); if (authProfileExistsTuple.Item1) // isAuthanticated { this.UserPasswordWrapper.Password = string.Empty; this.UserConfirmPasswordWrapper.Password = string.Empty; } if (authProfileExistsTuple.Item2) // is profile exists { Application.Current.Dispatcher.Invoke((Action)(() => { _accountExistingDialog = new AccountExistingDialog(this); _accountExistingDialog.Owner = ((PBApp)Application.Current).FindWindow <LoginWindow>();; RunDialogAction(() => { _accountExistingDialog.ShowDialog(); }); })); } else { RunDialogAction(() => { createAccountLayer.CreateAccount(UserEmailId, UserPasswordWrapper.Password); }); } }
private void CreateNewButtonCommandExecute(object elementObj) { if (_accountExistingDialog != null) { _accountExistingDialog.Close(); _accountExistingDialog = null; } UserEmailId = String.Empty; UserPasswordWrapper.Password = string.Empty; UserConfirmPasswordWrapper.Password = string.Empty; if (OnReset != null) { OnReset(this, EventArgs.Empty); } validator.SetValidAll(true); }
private void LoginExistingCommand(object elementObj) { //createAccountLayer.CancelBackgroundTasks(); try { LogStep(MarketingActionType.ExistingAccount); if (_accountExistingDialog != null) { _accountExistingDialog.Close(); _accountExistingDialog = null; } Login login = resolver.GetInstanceOf <Login>(); login.EmailTextBox.Text = UserEmailId; Navigator.NavigationService.Navigate(login); } catch (Exception ex) { MessageBox.Show((string)System.Windows.Application.Current.FindResource("GeneralErrorText")); logger.Error(ex.Message); } }