コード例 #1
0
        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);
                });
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
            }
        }