예제 #1
0
        private async Task SubmitAsync()
        {
            if (string.IsNullOrWhiteSpace(EmailCell.Entry.Text))
            {
                await DisplayAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired,
                                                                                  AppResources.EmailAddress), AppResources.Ok);

                return;
            }

            var request = new PasswordHintRequest
            {
                Email = EmailCell.Entry.Text
            };

            await _deviceActionService.ShowLoadingAsync(AppResources.Submitting);

            var response = await _accountApiRepository.PostPasswordHintAsync(request);

            await _deviceActionService.HideLoadingAsync();

            if (!response.Succeeded)
            {
                await DisplayAlert(AppResources.AnErrorHasOccurred, response.Errors.FirstOrDefault()?.Message, AppResources.Ok);

                return;
            }
            else
            {
                await DisplayAlert(null, AppResources.PasswordHintAlert, AppResources.Ok);
            }

            await Navigation.PopAsync();
        }
예제 #2
0
        private async Task SubmitAsync()
        {
            if (string.IsNullOrWhiteSpace(EmailCell.Entry.Text))
            {
                await DisplayAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired,
                                                                                  AppResources.EmailAddress), AppResources.Ok);

                return;
            }

            var request = new PasswordHintRequest
            {
                Email = EmailCell.Entry.Text
            };

            _userDialogs.ShowLoading("Submitting...", MaskType.Black);
            var response = await _accountApiRepository.PostPasswordHintAsync(request);

            _userDialogs.HideLoading();
            if (!response.Succeeded)
            {
                await DisplayAlert(AppResources.AnErrorHasOccurred, response.Errors.FirstOrDefault()?.Message, AppResources.Ok);

                return;
            }
            else
            {
                await DisplayAlert(null, "We've sent you an email with your master password hint. ", AppResources.Ok);
            }

            await Navigation.PopAsync();
        }