public async void Home_Clicked(object sender, EventArgs e)
        {
            Dialogs.ShowLoading("Espere por favor...");
            await Task.Delay(2000);

            Dialogs.HideLoading();

            InicioPage myHomePage = new InicioPage();

            NavigationPage.SetHasNavigationBar(myHomePage, true);
            await Navigation.PushModalAsync(myHomePage);
        }
        public async void OnActualizar(object sender, EventArgs e)
        {
            Dialogs.ShowLoading("Cancelando...");
            await Task.Delay(1000);

            Dialogs.HideLoading();

            InicioPage myHomePage = new InicioPage();


            NavigationPage.SetHasNavigationBar(myHomePage, false);



            await Navigation.PushModalAsync(myHomePage);
        }
Ejemplo n.º 3
0
        public async void OnClickedFinalizar(object sender, EventArgs args)
        {
            if (nombre.Text != null && password.Text != null && correo.Text != null && password.Text != null && telefono.Text != null && password.Text.Equals(passwordconf.Text))
            {
                MD5HashX2 pwtohash = new MD5HashX2();

                User usuario = new User();
                usuario.name               = nombre.Text;
                usuario.Lastname           = apellido.Text;
                usuario.Id                 = userid.Text;
                usuario.Emal               = correo.Text;
                usuario.Password           = pwtohash.MD5Hash(password.Text);
                usuario.City               = ciudad.SelectedIndex.ToString();
                usuario.Address            = address.Text;
                usuario.Cellnumber         = telefono.Text;
                usuario.Gender             = lstViewGeneros.SelectedIndex.ToString();
                usuario.Birdhdate          = fechaNacimiento.Date;
                usuario.Datapolicy         = true;
                usuario.Termsandconditions = true;


                Repository repository = new Repository();

                try
                {
                    userCreate user = repository.postUserCreate(usuario).Result;
                    Dialogs.ShowLoading(user.Message.ToString());;
                    await Task.Delay(2000);

                    Dialogs.HideLoading();
                    InicioPage myHomePage = new InicioPage();
                    NavigationPage.SetHasNavigationBar(myHomePage, false);
                    await Navigation.PushModalAsync(myHomePage);
                }

                catch (Exception ex)
                {
                    await DisplayAlert("Registrarse Error", ex.Message, "Gracias");
                }
            }


            else
            {
                await DisplayAlert("Registrarse", "Verifique la Información", "Gracias");
            }
        }
        public async void OnUpdateUser(object sender, EventArgs e)
        {
            if (nombre.Text != null && telefono.Text != null)
            {
                User usuario = new User();
                usuario.name     = nombre.Text;
                usuario.Lastname = apellido.Text;

                usuario.City               = ciudad.Text;
                usuario.Cellnumber         = telefono.Text;
                usuario.Gender             = lstViewGeneros.SelectedIndex.ToString();
                usuario.Birdhdate          = fechaNacimiento.Date;
                usuario.Datapolicy         = true;
                usuario.Termsandconditions = true;


                Repository repository = new Repository();

                try
                {
                    UserUpdate userUpdate = new UserUpdate();
                    userCreate update     = repository.PostUpdateUser(userUpdate).Result;
                    Dialogs.ShowLoading(update.Message.ToString());;
                    await Task.Delay(2000);

                    Dialogs.HideLoading();

                    InicioPage myHomePage = new InicioPage();
                    NavigationPage.SetHasNavigationBar(myHomePage, false);
                    await Navigation.PushModalAsync(myHomePage);
                }

                catch (Exception ex)
                {
                    await DisplayAlert("Registrarse Error", ex.Message, "Gracias");
                }
            }
        }
Ejemplo n.º 5
0
        public async void Button_Clicked(object sender, EventArgs e)
        {
            IUserDialogs Dialogs = UserDialogs.Instance;



            if (!string.IsNullOrWhiteSpace(usuario.Text) && !string.IsNullOrWhiteSpace(password.Text))
            {
                Login login = repo.ConnectUser(usuario.Text, password.Text).Result;

                if (login.Status == "ok")
                {
                    App.IsUserLoggedIn = true;

                    // REMEMBER LOGIN STATUS!
                    Application.Current.Properties["IsLoggedIn"] = true;
                    Settings.IsLoggedIn = true;

                    App.Current.Properties["token"] = login.Jwt;

                    Dialogs.ShowLoading("Ingresando...");
                    await Task.Delay(2000);

                    Dialogs.HideLoading();

                    InicioPage myHomePage = new InicioPage();
                    NavigationPage.SetHasNavigationBar(myHomePage, false);
                    await Navigation.PushModalAsync(myHomePage);
                }
            }
            else
            {
                Dialogs.ShowLoading("Datos NO válidos...");
                await Task.Delay(1000);

                Dialogs.HideLoading();
            }
        }