コード例 #1
0
        async void TapSiguiente_Tapped(object sender, EventArgs e)
        {
            //validar datos primero
            var pasa_validacion = true;

            if (!string.IsNullOrEmpty(txtMail.Text))
            {
                //si viene el mail entonces validar
                if (!string.IsNullOrEmpty((txtMail.Text)))
                {
                    if (!GlobalHelpers.EmailBienEscrito(txtMail.Text))
                    {
                        await DisplayAlert("¡Uh oh!", "Email no valido.", "Aceptar");

                        pasa_validacion = false;
                    }
                }
                if (pasa_validacion)
                {
                    Loading(true);
                    await SolicitarCambioContraseña(txtMail.Text);
                }
            }
            else
            {
                await DisplayAlert("¡Uh oh!", "Todos los datos son obligatorios.", "Aceptar");
            }
        }
コード例 #2
0
        async void TapSiguiente_Tapped(object sender, EventArgs e)
        {
            //validar datos primero
            var pasa_validacion = true;

            var aceptoTerminos = swicthTerminosYCondiciones.IsToggled;

            if (aceptoTerminos)
            {
                if (!string.IsNullOrEmpty(txtFullName.Text) && !string.IsNullOrEmpty(txtMail.Text) && !string.IsNullOrEmpty(txtPhone.Text))
                {
                    //si viene el mail entonces validar
                    if (!string.IsNullOrEmpty((txtMail.Text)))
                    {
                        if (!GlobalHelpers.EmailBienEscrito(txtMail.Text))
                        {
                            await DisplayAlert("¡Uh oh!", "Email no valido.", "Aceptar");

                            pasa_validacion = false;
                        }
                    }
                    if (pasa_validacion)
                    {
                        //los datos ya vienen del login de facebook
                        if (userInfoFromFaceBook != null)
                        {
                            userInfoFromFaceBook.phone     = txtPhone.Text;
                            userInfoFromFaceBook.email     = txtMail.Text;
                            userInfoFromFaceBook.full_name = txtFullName.Text;


                            Loading(true);
                            await Registrar(userInfoFromFaceBook);

                            //GeneralSetting.UserSettings = JsonConvert.SerializeObject(userInfoFromFaceBook);
                            //App.NavigateToProfile();
                        }
                        else
                        {
                            UserFB user = new UserFB();
                            user.email     = txtMail.Text;
                            user.full_name = txtFullName.Text;
                            user.phone     = txtPhone.Text;

                            await Navigation.PushAsync(new ContraseñaPage(user));
                        }
                    }
                }
                else
                {
                    await DisplayAlert("¡Uh oh!", "Todos los datos son obligatorios.", "Aceptar");
                }
            }
            else
            {
                await DisplayAlert("¡Uh oh!", "no se puede registrar si no acepta los terminos y condiciones.", "Aceptar");
            }
        }
コード例 #3
0
        async void TapEnviar_Tapped(object sender, EventArgs e)
        {
            var pasa_validacion = true;

            if (!string.IsNullOrEmpty(txtTitulo.Text) && !string.IsNullOrEmpty(editorDescription.Text))
            {
                //si viene el mail entonces validar
                if (!string.IsNullOrEmpty((txtMail.Text)))
                {
                    if (!GlobalHelpers.EmailBienEscrito(txtMail.Text))
                    {
                        await DisplayAlert("¡Uh oh!", "Email no valido.", "Aceptar");

                        pasa_validacion = false;
                    }
                }
                if (pasa_validacion)
                {
                    Loading(true);
                    var r = await _reclamoService.CrearReclamo(txtTitulo.Text,
                                                               editorDescription.Text,
                                                               txtNombre.Text,
                                                               txtMail.Text,
                                                               txtTelefono.Text,
                                                               map.coordinate.Latitude.ToString(),
                                                               map.coordinate.Longitude.ToString(),
                                                               stackMultimediaCausa.listMatriz.Where(x => x.usada).Select(x => x.bytes).ToList(),
                                                               txtReferencia.Text);

                    Loading(false);

                    await DisplayAlert("Reclamo enviado", r, "Aceptar");

                    //await Navigation.PushAsync(new MisReclamosPage());
                    App.NavigateToProfile();
                }
            }
            else
            {
                await DisplayAlert("¡Uh oh!", "Título y descripción son obligatorios para realizar tu reclamo.", "Aceptar");
            }
        }