Exemple #1
0
        public async void OnClickedFinalizar(object sender, EventArgs args)
        {
            var prueba = files.GetStream();



            if (!string.IsNullOrWhiteSpace(nickname.Text) && !string.IsNullOrWhiteSpace(email.Text) && !string.IsNullOrWhiteSpace(celular.Text)

                && !string.IsNullOrWhiteSpace(password.Text) && files != null)

            {
                try
                {
                    var selectedValue = genero.Items[genero.SelectedIndex];

                    string user = _firebaseService.GetUserId();


                    Dialogs.ShowLoading("Registrando");;
                    await Task.Delay(4000);

                    Dialogs.HideLoading();
                    await firebaseHelper.AddPerson(user, nickname.Text, email.Text, celular.Text, codPromocional.Text, selectedValue.ToString(), password.Text, "true", "true", "P", "I", "N");

                    nickname.Text       = string.Empty;
                    email.Text          = string.Empty;
                    celular.Text        = string.Empty;
                    codPromocional.Text = string.Empty;
                    password.Text       = string.Empty;
                    passwordconf.Text   = string.Empty;
                    var stroageImage = await new FirebaseStorage("upick-app-c921d.appspot.com")
                                       .Child("Prestador")
                                       .Child(user + ".jpg")
                                       .PutAsync(files.GetStream());
                    await DisplayAlert("Success", "Se ha registrado exitosamente", "OK");


                    CrearPerfilPage myHomePage = new CrearPerfilPage();
                    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 Task <bool> SaveUserRequest(Stream imgStream, User req)
        {
            var imgURL = "";

            try
            {
                imgURL = await storage.Child("Image")
                         .Child("MaM")
                         .Child(authService.GetUserId())
                         .PutAsync(imgStream);
            }
            catch (Exception)
            {
            }

            req.ImageUrl = imgURL;
            req.UserID   = authService.GetUserId();

            var updateData = client.Child("users/" + authService.GetUserId()).PutAsync <User>(req);

            return(true);
        }
Exemple #3
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            try
            {
                base.OnAppearing();
                var user    = _firebaseService.GetUserId();
                var factura = await firebaseHelper.GetPerson(user);

                valorh.Text  = factura.ValorHora;
                valorh1.Text = factura.ValorHora;
            }

            catch (Exception ex)
            {
                throw new Exception("OnAppearing  Additional information..." + ex, ex);
            }
        }
Exemple #4
0
        public async void OnClickActivo(object sender, EventArgs args)
        {
            Dialogs.ShowLoading("Espere por favor...");
            await Task.Delay(2000);

            Dialogs.HideLoading();
            string user = _firebaseService.GetUserId();

            if (status.Color == Color.Red)
            {
                status.Color = Color.Green;

                var selectedValue = lstpreferencias.Items[lstpreferencias.SelectedIndex];
                var hora          = valor.Text;
                await firebaseHelper.ActivacionPerson(user, hora, selectedValue);
            }
            else
            {
                status.Color = Color.Red;
                var selectedValue = "D";
                var hora          = "D";
                await firebaseHelper.ActivacionPerson(user, hora, selectedValue);
            }
        }