コード例 #1
0
        private void BtnCadastrarUser_Click(object sender, EventArgs e)
        {
            EditText nome      = FindViewById <EditText>(Resource.Id.txtNomeUser);
            EditText sobrenome = FindViewById <EditText>(Resource.Id.txtSobrenomeUser);
            EditText email     = FindViewById <EditText>(Resource.Id.txtEmailUser);
            EditText senha     = FindViewById <EditText>(Resource.Id.txtSenhaUser);

            fireBaseHelper.AddUser(email.Text, senha.Text, nome.Text, sobrenome.Text);

            TextView txtConfirmarCadastroUser = FindViewById <TextView>(Resource.Id.txtConfirmarCadastroUser);

            txtConfirmarCadastroUser.Text = "Usuário admin criado com sucesso";

            nome.Text      = "";
            sobrenome.Text = "";
            email.Text     = "";
            senha.Text     = "";
        }
コード例 #2
0
        private async void SignUp()
        {
            //null or empty validation, check if Email and Password is null or empty
            if (string.IsNullOrEmpty(Username) || string.IsNullOrEmpty(Password) || string.IsNullOrEmpty(Address))
            {
                await App.Current.MainPage.DisplayAlert("Empty Value", "Please enter Username, Password and Address", "OK");
            }
            else
            {
                var userSignup = await FireBaseHelper.AddUser(Username, Password, Address, PhoneNumber);

                if (userSignup)
                {
                    await App.Current.MainPage.DisplayAlert("SignUp Successed", "", "OK");

                    await App.Current.MainPage.Navigation.PushAsync(new LoginPage());
                }
                else
                {
                    await App.Current.MainPage.DisplayAlert("Error", "SignUp Failed", "OK");
                }
            }
        }