Exemple #1
0
        private async void ComfirmTapped(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Email.Text))
            {
                return;
            }
            if (!App.isValidEmail(Email.Text.ToLower()))
            {
                await DisplayAlert("Erreur", "Adresse email invalide", "Ok");

                return;
            }
            Email.IsEnabled        = false;
            ComfirmLabel.IsEnabled = false;
            ComfirmLabel.TextColor = Color.DarkGray;
            Indicator.IsVisible    = true;
            Indicator.IsRunning    = true;
            var userRC       = new UserRestClient();
            var pastryShopRC = new PastryShopRestClient();

            if ((await userRC.GetAsyncByEmail(Email.Text.ToLower()) == null) &&
                (await pastryShopRC.GetAsyncByEmail(Email.Text.ToLower()) == null))
            {
                await DisplayAlert("Erreur", "Utilisateur inexistant!", "Ok");

                await PopupNavigation.PopAsync();

                return;
            }
            await PopupNavigation.PopAsync();

            await PopupNavigation.PushAsync(new PasswordResetCodeVerification(Email.Text.ToLower()));
        }
        public async void ConfirmBt_Clicked(object sender, EventArgs e)
        {
            if (!await valid())
            {
                return;
            }
            PastryShopRestClient pastryShopRC = new PastryShopRestClient();
            UserRestClient       userRC       = new UserRestClient();

            if ((await pastryShopRC.GetAsyncByEmail(Email.Text.ToLower()) != null) || (await userRC.GetAsyncByEmail(Email.Text.ToLower()) != null))
            {
                await DisplayAlert("Erreur", "Cette adresse email est déjà utilisée!", "Ok");

                Email.Text = "";
                return;
            }
            await PopupNavigation.PushAsync(new EmailVerificationPopupPage(this, Email.Text.ToLower()));
        }