public LoginWithEmail()
        {
            InitializeComponent();

            lblPsswdClick();
            _auth = DependencyService.Get <IFirebaseAuthenticator>();
        }
Example #2
0
 public Page1()
 {
     InitializeComponent();
     _auth = DependencyService.Get <IFirebaseAuthenticator>();
     showInfo();
     pictureModify();
 }
Example #3
0
        public profiloPalestra()
        {
            InitializeComponent();
            _auth = DependencyService.Get <IFirebaseAuthenticator>();

            pictureFullScreen();

            getInfo(uid);

            picker.SelectedIndexChanged += async(sender, args) =>
            {
                if (picker.SelectedIndex == -1)
                {
                }
                else
                {
                    string colorName = picker.Items[picker.SelectedIndex];
                    picker.SelectedItem = -1;
                    if (colorName.Equals("Modifica Profilo"))
                    {
                        await Navigation.PushAsync(new home.palestra.Page1());
                    }
                    else
                    {
                        _auth.Logout();
                        Preferences.Clear("profilePic");
                        Navigation.InsertPageBefore(new Main(), Navigation.NavigationStack[0]);
                        await Navigation.PopToRootAsync();
                    }
                }
            };
        }
Example #4
0
 public Abbonamento()
 {
     InitializeComponent();
     _auth = DependencyService.Get <IFirebaseAuthenticator>();
     this.BindingContext = new model.MyViewModel();
     getInfoSub(uidSub);
 }
Example #5
0
 public App(IFirebaseAuthenticator authenticator)
 {
     InitializeComponent();
     DeviceToken  = authenticator.GetDeviceToken();
     FirebaseAuth = authenticator;
     MainPage     = new NavigationPage(new Registration(authenticator));
 }
Example #6
0
 public MainPage(IFirebaseAuthenticator firebaseAuthenticator)
 {
     InitializeComponent();
     authenticator = firebaseAuthenticator;
     Auth.Clicked += Auth_Click;
     Out.Clicked  += Out_Click;
 }
Example #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Charanke.ViewModels.LoginPageViewModel"/> class.
        /// </summary>
        public LoginPageViewModel(IFirebaseAuthenticator firebaseAuthenticator)
        {
            FirebaseAuthenticator = firebaseAuthenticator;

            _AuthModel = new FirebaseAuthenticationModel(FirebaseAuthenticator);

            Email = ReactiveProperty.FromObject(
                _AuthModel,
                x => x.Email);

            Password = ReactiveProperty.FromObject(
                _AuthModel,
                x => x.Password);

            AuthMessage = _AuthModel.ObserveProperty(m => m.AuthMessage)
                          .ToReadOnlyReactiveProperty();

            SendSignInByEmailAndPassword = Email.ObserveHasErrors.CombineLatest(
                Password.ObserveHasErrors, (x, y) => !x && !y)
                                           .ToReactiveCommand();

            SendSignUpByEmailAndPassword = Email.ObserveHasErrors.CombineLatest(
                Password.ObserveHasErrors, (x, y) => !x && !y)
                                           .ToReactiveCommand();

            SendSignInByEmailAndPassword.Subscribe(
                async() => await this.SignInByEmailAndPasswordAction());

            SendSignUpByEmailAndPassword.Subscribe(
                async() => await this.SignUpByEmailAndPasswordAction());
        }
Example #8
0
        public async Task AddUser(string email, string senha)
        {
            IFirebaseAuthenticator firebaseAuthenticator = DependencyService.Get <IFirebaseAuthenticator>();
            string token = await firebaseAuthenticator.CreateUserWithEmailAndPassword(email, senha);

            (Application.Current as App).AuthToken = token;
        }
Example #9
0
        public LoginViewModel(IFirebaseAuthenticator firebaseAuthenticator, Services.NavigationService navigationService)
        {
            this.firebaseAuthenticator = firebaseAuthenticator;
            this.navigationService     = navigationService;

            LoginCmd = new Command(async() => await Login());
        }
Example #10
0
        public Home()
        {
            App.uid         = Preferences.Get("uid", null);
            App.loggedEmail = Preferences.Get("loggedEmail", null);
            App.password    = Preferences.Get("password", null);

            string uid = App.uid;

            if (CrossConnectivity.Current.IsConnected)
            {
                InitializeComponent();
                _auth = DependencyService.Get <IFirebaseAuthenticator>();
                //VERIFICO SE CHI SI E' LOGGATO E' UTENTE O PALESTRA
                getInfo(uid);
                checkTurnoPrenotato(uid);
                //checkSub(App.loggedUser.AbbonamentoIscrizione);
            }
            else
            {
                DisplayAlert("Attenzione!", "Nessuna connessione ad Internet", "Ok", "Riprova");
                System.Diagnostics.Process.GetCurrentProcess().Kill();
            }

            NavigationPage.SetHasBackButton(this, false);
        }
 public signUpDetailsGym(string nome)
 {
     InitializeComponent();
     _auth    = DependencyService.Get <IFirebaseAuthenticator>();
     App.nome = nome;
     //INIZIALIZZO GESTURE TOCCA IMMAGINE
     pictureModify();
 }
Example #12
0
 public RegistrationViewModel(IRegistration reg, IFirebaseAuthenticator authenticator)
 {
     regInfo = reg;
     firebaseAuthenticator = authenticator;
     ToHomePage            = new Command(GoToHomePage);
     ToForgetPassPage      = new Command(GoToForgetPassPage);
     ToSignUpPage          = new Command(GoToSignUpPage);
 }
Example #13
0
 public CreatedSub(string uidAbbonamentoPalestra)
 {
     InitializeComponent();
     App.uidAbbonamentoPalestra = uidAbbonamentoPalestra;
     _auth = DependencyService.Get <IFirebaseAuthenticator>();
     this.BindingContext = new model.ModelAbbonamentoPalestra();
     getInfoSub(uidAbbonamentoPalestra);
 }
Example #14
0
        }                                                          //Command to confirm new account

        #endregion Properties

        #region Class Methods

        /// <summary>
        /// Constructor
        /// </summary>
        public CreateNewAccountViewModel()
        {
            Title = "Create New Account";

            auth = DependencyService.Resolve <IFirebaseAuthenticator>();        //Fetch platform-specific Firebase Authentication implementation

            NavigateBackCommand      = new Command(() => App.SetNewPage <LoginPage>());
            ConfirmNewAccountCommand = new Command(ConfirmNewAccount);
        }
Example #15
0
        public PrenotaTurno(string uidPalestra, DateTime giornoScelto)
        {
            InitializeComponent();
            _auth = DependencyService.Get <IFirebaseAuthenticator>();
            string DataOdierna = String.Format("{0:MM/dd/yyyy}", giornoScelto);

            App.giornoscelto = DataOdierna;

            getTurni(uidPalestra, giornoScelto);
        }
        }                                                               //Command for password request button

        #endregion Properties

        #region Class Methods

        /// <summary>
        /// Constructor
        /// </summary>
        public PasswordRetrievalViewModel()
        {
            Title = "Reset Password";

            auth = DependencyService.Resolve <IFirebaseAuthenticator>();        //Fetch platform-specific Firebase Authentication implementation

            /* Initialize Commands */
            NavigateBackCommand         = new Command(() => App.SetNewPage <LoginPage>());
            RequestPasswordResetCommand = new Command(ForgotPasswordClicked);
        }
        public AbbonamentoPopup(string uidG)
        {
            InitializeComponent();

            _auth = DependencyService.Get <IFirebaseAuthenticator>();
            this.BindingContext = new model.MyViewModel();


            List <string> tipoabbonamento = new List <string>();
        }
Example #18
0
        // Реализация функции, которая вызывается при нажатии на кнопку
        // Она привязывается в файле xaml
        private async void Button_Clicked(object sender, EventArgs e)
        {
            // С помощью CheckValidatiions() проверяем, что нужные поля заполнены
            if (CheckValidatiions())
            {
                string token;
                // В области try пытаемся выполнить код, если что-то ломается, то выполняется блок catch
                try
                {
                    // Блок try
                    // Реализация IFirebaseAuthenticator лежит в файле IFirebaseAuthenticator.cs
                    // С помощью DependencyService.Get<>() мы цепляем реализацию класса из андроидовской части, условно говоря
                    // То есть по сути функция LoginWithEmailPassword() будет вызвана из файла FirebaseAuthenticator.cs
                    token = await DependencyService.Get <IFirebaseAuthenticator>().LoginWithEmailPassword(l.Text, p.Text);
                }
                catch (ArgumentException exp)
                {
                    // Блок catch, в котором мы обрабатываем самостоятельно созданную ошибку
                    // Она отсылается, наример, в функции LoginWithEmailPassword() и имеет тип ArgumentException
                    // Message - текст, который мы написали в ошибке
                    token = exp.Message;
                }
                catch (Exception)
                {
                    // Тут обрабатываем остальные ошибки
                    token = "Another error";
                }
                // Отображаем полученный токен
                autt.Text = token;
                string result = "";
                IFirebaseAuthenticator user = null;
                try
                {
                    // Получили наш объект с данными
                    user = await DependencyService.Get <IFirebaseAuthenticator>().GetDataFromDataBase(l.Text);

                    result = "Email: < " + user.Email + " >\nName: < " + user.Name + " >\nSecond Name: < " + user.SecondName + " >";
                    // autt указан в Label в поле x:Name. Этот Label инициализирован в файле View3.xaml
                    autt.Text = result;
                    // Передали объект дальше
                    View2.user = user;
                    // Вернулись на страницу назад
                    await Navigation.PopAsync();
                }
                catch (ArgumentException exp)
                {
                    result = exp.Message;
                }
                catch (Exception)
                {
                    result = "Another error";
                }
            }
        }
Example #19
0
        public SignUp(IFirebaseAuthenticator authenticator)
        {
            InitializeComponent();

            firebaseAuthenticator = authenticator;

            UserEmail.TextChanged += UserEmail_TextChanged;
            UserPass.TextChanged  += UserPass_TextChanged;
            ConfirmPass.Completed += ConfirmPass_Completed;
            SignUpButton.Clicked  += SignUpButton_Clicked;
        }
Example #20
0
        public SignUpGym2(string nome, string citta, string indirizzo, string email, string password)
        {
            InitializeComponent();
            App.nomeGym      = nome;
            App.cittaGym     = citta;
            App.indirizzoGym = indirizzo;
            App.emailGym     = email;
            App.passwordGym  = password;

            _auth = DependencyService.Get <IFirebaseAuthenticator>();
            pictureModify();
        }
        public PalestraIscrizione(string uid)
        {
            Gym.uid = uid;
            InitializeComponent();
            _auth = DependencyService.Get <IFirebaseAuthenticator>();
            getInfo(uid);
            pictureFullScreen();
            //PER POTERSI REGISTRARE ALLA PALESTRA CHE L'UTENTE STA VISUALIZZANDO
            //HO BISOGNO DEL SUO UID PER CAPIRE SE E' GIA' REGISTRATO O MENO
            string uidUser = App.uid;

            canUserRegister(uidUser);
        }
Example #22
0
        public LoginViewModel(IFirebaseAuthenticator firebaseAuthenticator)
        {
            this.FirebaseAuthenticator = firebaseAuthenticator;
            LoginCmd = new Command(async() => await Login(), () => Email.IsValid && Password.IsValid && !IsBusy);

            Email = new ValidatableObject <string>(PropChangedCallBack, new EmailValidator())
            {
                Value = "*****@*****.**"
            };
            Password = new ValidatableObject <string>(PropChangedCallBack, new PasswordValidator())
            {
                Value = "123qwe"
            };
        }
Example #23
0
        public App()
        {
            InitializeComponent();
            _auth = DependencyService.Get <IFirebaseAuthenticator>();

            // MainPage = new NavigationPage(new home.profilo.AbbonamentoPopup());
            string uid = Preferences.Get("uid", null);

            if (uid != null)
            {
                MainPage = new NavigationPage(new home.Home());
            }
            else
            {
                MainPage = new NavigationPage(new Main());
            }
        }
        public LoginViewModel(
            IFirebaseAuthenticator firebaseAuthenticator,
            NavigationService navigationService)
        {
            this.firebaseAuthenticator = firebaseAuthenticator;
            this.navigationService     = navigationService;

            LoginCmd = new Command(async() => await Login(), () => Email.IsValid && Password.IsValid && !IsBusy);

            Email = new ValidatableObject <string>(propChangedCallBack, new EmailValidator())
            {
                Value = "*****@*****.**"
            };
            Password = new ValidatableObject <string>(propChangedCallBack, new PasswordValidator())
            {
                Value = "Qwerty123"
            };
        }
        public FindGymManually()
        {
            InitializeComponent();
            _auth = DependencyService.Get <IFirebaseAuthenticator>();
            List <string> filtri = new List <string>();

            filtri.Add("Nome");
            filtri.Add("Citta");
            pickerFilterFind.ItemsSource = filtri;


            pickerFilterFind.SelectedIndexChanged += async(sender, args) =>
            {
                if (pickerFilterFind.SelectedIndex == -1)
                {
                }
                else
                {
                    string colorName = pickerFilterFind.Items[pickerFilterFind.SelectedIndex];
                    pickerFilterFind.SelectedItem = -1;
                    if (colorName.Equals("Nome"))
                    {
                        result.IsVisible         = false;
                        parameter.IsVisible      = true;
                        parameter.Placeholder    = "Inserisci nome";
                        btnFindGymName.IsVisible = true;
                    }
                    else
                    {
                        result.IsVisible         = false;
                        parameter.IsVisible      = true;
                        parameter.Placeholder    = "Inserisci città";
                        btnFindGymCity.IsVisible = true;
                    }
                }
            };
        }
Example #26
0
 public LogIn()
 {
     InitializeComponent();
     auth = DependencyService.Get <IFirebaseAuthenticator>();
 }
 public RegisterPage()
 {
     InitializeComponent();
     auth = DependencyService.Get <IFirebaseAuthenticator>();
 }
Example #28
0
 public ResetPassword()
 {
     InitializeComponent();
     _auth = DependencyService.Get <IFirebaseAuthenticator>();
 }
Example #29
0
 public OrariPopup(string uid)
 {
     _auth = DependencyService.Get <IFirebaseAuthenticator>();
     InitializeComponent();
     showTime(uid);
 }
Example #30
0
 public signUpGym()
 {
     InitializeComponent();
     _auth = DependencyService.Get <IFirebaseAuthenticator>();
 }