Exemplo n.º 1
0
        async void LabelForgot_TappedAsync(object sender, System.EventArgs e)
        {
            try
            {
                await _viewModel.AuthViewModel.RequestEmailConfirmationAsync();

                var page = new UserConfirmPage();
                page.UiLayout = UserConfirmPage.Configuration.MakePassword;

                await NextModalStepAsync(page);
            }
            catch (Exception ex)
            {
                this.ShowAlert(ex);
            }
        }
Exemplo n.º 2
0
        private async void ButtonOkay_ClickedAsync(object sender, EventArgs e)
        {
            try
            {
                if (_viewModel.UserViewModel.MakePassword)
                {
                    if (EntryPassword.Text != EntryPasswordConfirm.Text)
                    {
                        this.ShowAlert("Passwords do not match");
                        return;
                    }

                    if (_viewModel.Backend.Permit.User.DateJoined > DateTime.Today)
                    {
                        this.ShowAlert("Date joined cannot be in the future");
                        return;
                    }
                }

                if (_viewModel.UserViewModel.NewUser)
                {
                    var result = await _viewModel
                                 .UserViewModel.RegisterUserAsync();

                    if (result.Code >= 0)
                    {
                        var page = new UserConfirmPage();
                        page.UiLayout = UserConfirmPage.Configuration.ConfirmEmail;
                        _viewModel.UserViewModel.Password = string.Empty;

                        await ScheduleNextModalStepAsync(page);
                    }
                }
            }
            catch (Exception ex)
            {
                this.ShowAlert(ex);
            }
        }
Exemplo n.º 3
0
        async void ButtonLogin_ClickedAsync(object sender, EventArgs e)
        {
            try
            {
                ResultSingle <Trader> result = await _viewModel
                                               .UserViewModel.QueryUserAsync(_viewModel.Backend.Permit.User.Email, false);

                if (result.Code < 0)
                {
                    this.ShowAlert("This is an unknown email address");
                }
                else
                {
                    var page = new UserConfirmPage();
                    page.UiLayout = UserConfirmPage.Configuration.EnterPassword;

                    await NextModalStepAsync(page);
                }
            }
            catch (Exception ex)
            {
                this.ShowAlert(ex);
            }
        }