Ejemplo n.º 1
0
        private async void Register(object sender, EventArgs ea)
        {
            //int layout = Resource.Layout.Loading;
            int style = Resource.Style.AlertDialogDefault;

            Dialogs.CreateProgressDialog(this, style);

            string email    = txt_Email.Text;
            string password = txt_Password.Text;



            Manboss_usuario validation = await loginCore.Register(email, password);


            if (validation != null)
            {
                ISharedPreferences       prefs  = PreferenceManager.GetDefaultSharedPreferences(this);
                ISharedPreferencesEditor editor = prefs.Edit();
                editor.PutInt("BossMandados_UserID", validation.Id);
                editor.Apply();

                Intent nextActivity = new Intent(this, typeof(WelcomeActivity));
                StartActivity(nextActivity);
            }
            else
            {
                string message = "Usuario o Contraseña incorrectos";
                string title   = "Error al acceder";

                Dialogs.CreateAndShowDialog(message, title, this, style);
            }
            btn_Register.SetBackgroundColor(new Color(249, 00, 77));
            Dialogs.DismissProgressDialog();
        }