Exemple #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();
        }
Exemple #2
0
        public async Task <Manboss_usuario> Register(string email, string password)
        {
            Manboss_usuario user = await data.Login(email, password);

            User.Usuario = user;
            return(user);
        }
Exemple #3
0
        public async Task <Manboss_usuario> GetUser(int UserID)
        {
            Manboss_usuario userReturn = null;

            try
            {
                Dictionary <string, string> param = new Dictionary <string, string>
                {
                    { "UsuarioID", UserID.ToString() }
                };
                var current = await client.InvokeApiAsync <Manboss_usuario>("Usuario/GetUsuario", HttpMethod.Post, param);

                userReturn = current;
            }
            catch (Exception e)
            {
                string m = e.Message;
                Dialogs.BasicDialog("No se pudo establecer conexión", "Error en al Red", context);
            }
            return(userReturn);
        }
Exemple #4
0
        public async Task <Manboss_usuario> Login(string correo, string password)
        {
            Manboss_usuario userReturn = null;

            try
            {
                Dictionary <string, string> param = new Dictionary <string, string>
                {
                    { "correo", correo },
                    { "password", password }
                };
                //Cliente/Login
                var current = await client.InvokeApiAsync <Manboss_usuario>("Repartidor/Login", HttpMethod.Post, param);

                userReturn = current;
            }
            catch (Exception e)
            {
                string m = e.Message;
                Dialogs.BasicDialog("No se pudo establecer conexión", "Error en al Red", context);
            }
            return(userReturn);
        }