Exemplo n.º 1
0
        protected override async void OnAppearing()
        {
            IsBusy            = true;
            overlay.IsVisible = true;
            var content = await _Client.GetStringAsync(url + App.UserId);

            modelo.UserView get = JsonConvert.DeserializeObject <modelo.UserView>(content);
            IsBusy            = false;
            overlay.IsVisible = false;
            BindingContext    = get;
            base.OnAppearing();
        }
Exemplo n.º 2
0
        private async void Validar_Campos(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Nameee.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su nombre.", "Ok");

                Nameee.Focus();
                return;
            }

            if (string.IsNullOrEmpty(Surnameee.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuáles son sus apellidos.", "Ok");

                Surnameee.Focus();
                return;
            }

            if (string.IsNullOrEmpty(elNickkk.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál será su nuevo Nick de Usuario.", "Ok");

                elNickkk.Focus();
                return;
            }

            if (pickerSexooo.SelectedIndex == -1)
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál es su sexo.", "Ok");

                pickerSexooo.Focus();
                return;
            }

            if (string.IsNullOrEmpty(correoEEE.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, introduzca una dirección de correo electrónico.", "Ok");

                correoEEE.Focus();
                return;
            }

            if (!emailValidatorrr.IsValid)
            {
                await DisplayAlert("Correo inválido", "Por favor, especifique una dirección de correo electrónico válida.", "Ok");

                correoEEE.Focus();
                return;
            }

            if (string.IsNullOrEmpty(Phoneee.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su número de teléfono.", "Ok");

                Phoneee.Focus();
                return;
            }

            if (Phoneee.Text.Length < 9)
            {
                await DisplayAlert("Número de teléfono inválido", "El número de teléfono debe tener al menos 9 dígitos.", "Ok");

                Phoneee.Focus();
                return;
            }

            if (string.IsNullOrEmpty(skypeUserrr.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su nombre de Usuario de Skype.", "Ok");

                skypeUserrr.Focus();
                return;
            }

            if (pickerNivelll.SelectedIndex == -1)
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál es su nivel de inglés actual.", "Ok");

                pickerNivelll.Focus();
                return;
            }

            modelo.UserView m = this.BindingContext as modelo.UserView;
            if ((m != null) && (m.Update.CanExecute(null)))
            {
                m.Update.Execute(null);
                //await DisplayAlert("Hecho!!", "Sus datos se han actualizado correctamente.", "Volver al Menú Principal");
                //await Navigation.PushAsync(new MainPage());
            }
        }
Exemplo n.º 3
0
        private async void Volver_Login(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Name.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su nombre.", "Ok");

                Name.Focus();
                return;
            }

            if (string.IsNullOrEmpty(Surname.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuáles son sus apellidos.", "Ok");

                Surname.Focus();
                return;
            }

            if (string.IsNullOrEmpty(elNick.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál será su Nick de Usuario.", "Ok");

                elNick.Focus();
                return;
            }

            if (pickerSexo.SelectedIndex == -1)
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál es su sexo.", "Ok");

                pickerSexo.Focus();
                return;
            }

            if (string.IsNullOrEmpty(correoE.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su correo electrónico.", "Ok");

                correoE.Focus();
                return;
            }

            if (!emailValidator.IsValid)
            {
                await DisplayAlert("Correo inválido", "Debe ingresar una dirección de correo electrónico válida.", "Ok");

                correoE.Focus();
                return;
            }

            if (string.IsNullOrEmpty(Passwordd.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, introduzca su contraseña.", "Ok");

                Passwordd.Focus();
                return;
            }

            if (string.IsNullOrEmpty(Phone.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su número de teléfono.", "Ok");

                Phone.Focus();
                return;
            }

            if (Phone.Text.Length < 9)
            {
                await DisplayAlert("Número de teléfono inválido", "El número de teléfono debe tener al menos 9 dígitos.", "Ok");

                Phone.Focus();
                return;
            }

            if (string.IsNullOrEmpty(skypeUser.Text))
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su nombre de Usuario de Skype.", "Ok");

                skypeUser.Focus();
                return;
            }

            if (pickerNivel.SelectedIndex == -1)
            {
                await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál es su nivel de inglés actual.", "Ok");

                pickerNivel.Focus();
                return;
            }


            modelo.UserView m = this.BindingContext as modelo.UserView;
            if ((m != null) && (m.Guardar.CanExecute(null)))
            {
                m.Guardar.Execute(null);
                await DisplayAlert("¡¡¡Enhorabuena!!!", "Ya eres TWENIX!!", "Volver al Menú Principal");

                await Navigation.PushAsync(new MainPage());
            }
        }