コード例 #1
0
ファイル: PerfilActivity.cs プロジェクト: lmvda/foodbites
        void Reg_OnAlterarCompletoAsync(object sender, FoodbitesAPP.RegistarEventArgs e)
        {
            user.Nome     = e.Nome;
            user.Password = e.Pass;
            user.Email    = e.Email;

            // post HTTP para registar
            bool ok = ApiHTTP.AtualizaUser(user);

            AtualizaTexto();
        }
コード例 #2
0
        void Reg_OnRegistoCompletoAsync(object sender, FoodbitesAPP.RegistarEventArgs e)
        {
            // post HTTP para registar
            UserModel user = ApiHTTP.Registar(e.Nome, e.User, e.Pass, e.Email);

            if (user != null)
            {
                //((MainApplication)Application.Context).CurrentUser = user;
                //Intent i = new Intent(this, typeof(PesquisaActivity));
                //StartActivity(i);
                Console.WriteLine("\tRegisto com sucesso!");
                Toast.MakeText(this, "Registo com sucesso!", ToastLength.Long).Show();
            }
            else
            {
                Console.WriteLine("\tErro no registo!");
                Toast.MakeText(this, "Erro a efetuar registo!", ToastLength.Long).Show();
            }
        }