private async void OnLogin(object sender, EventArgs e)
        {
            string      usuario   = this.txtUsername.Text;
            string      clave     = this.txtPassword.Text;
            LoginEstado resultado = LoginEstado.ErrorSistema;

            busyindicator.IsVisible  = true;
            circleBtnLogin.IsEnabled = false;
            await Task.Run(() =>
            {
                TSLoginApp.LoginCambioTurno += LoginCambioTurnoAuthorize;
                resultado = TSLoginApp.AuthorizeCambioTurno(usuario, clave).Result;
            });

            if (resultado != LoginEstado.EsperandoRespuesta)
            {
                busyindicator.IsVisible = false;
                switch (resultado)
                {
                case LoginEstado.ErrorInternet:
                    await DisplayAlert("Aviso", "Su dispositivo no cuenta con internet en estos momentos.", "Aceptar");

                    break;

                case LoginEstado.ErrorSistema:
                    await DisplayAlert("Aviso", "Hubo un problema de comunicación con el servidor, por favor intente después.", "Aceptar");

                    break;
                }
            }
        }
Exemplo n.º 2
0
        private async void OnLogin(string usuario, string clave)
        {
            LoginEstado resultado = LoginEstado.ErrorSistema;

            this.txtClave.IsEnabled      = false;
            this.txtUser.IsEnabled       = false;
            this.busyindicator.IsVisible = true;
            this.btnAceptar.IsVisible    = false;
            await Task.Run(() =>
            {
                TSLoginApp.LoginAuthorize += LoginAuthorize;;
                resultado = TSLoginApp.Authorize(usuario, clave).Result;
            });

            if (resultado != LoginEstado.EsperandoRespuesta)
            {
                switch (resultado)
                {
                case LoginEstado.ErrorInternet:
                    LoginResponse(resultado, false);
                    break;

                case LoginEstado.ErrorSistema:
                    LoginResponse(resultado, false);
                    break;
                }
            }
        }
Exemplo n.º 3
0
        private async void OnLogin(object sender, EventArgs e)
        {
            TSLoginApp.UserNameVenderdor = this.txtUsername.Text;
            TSLoginApp.PasswordVenderdor = this.txtPassword.Text;
            LoginEstado resultado = LoginEstado.ErrorSistema;

            busyindicator.IsVisible = true;
            await Task.Run(() =>
            {
                TSLoginApp.DepositoAuthorize += LoginAuthorize;
                resultado = TSLoginApp.AutenticateDeposito().Result;
            });

            if (resultado != LoginEstado.EsperandoRespuesta)
            {
                busyindicator.IsVisible = false;
                switch (resultado)
                {
                case LoginEstado.ErrorInternet:
                    await DisplayAlert("Aviso", "Su dispositivo no cuenta con internet en estos momentos.", "Aceptar");

                    break;

                case LoginEstado.ErrorSistema:
                    await DisplayAlert("Aviso", "Hubo un problema de comunicación con el servidor, por favor intente después.", "Aceptar");

                    break;
                }
            }
        }
        public async void OnLogin(object sender, EventArgs e)
        {
            LoginEstado resultado = LoginEstado.ErrorSistema;

            this.circleBtnLogin.IsVisible = false;
            this.busyindicator.IsVisible  = true;
            await Task.Run(() =>
            {
                TSLoginApp.LoginAuthorize += LoginAuthorize;;
                resultado = TSLoginApp.Authorize().Result;
            });

            if (resultado != LoginEstado.EsperandoRespuesta)
            {
                this.busyindicator.IsVisible  = false;
                this.circleBtnLogin.IsVisible = true;
                switch (resultado)
                {
                case LoginEstado.ErrorInternet:
                    await DisplayAlert("Aviso", "Su dispositivo no cuenta con internet en estos momentos.", "Aceptar");

                    break;

                case LoginEstado.ErrorSistema:
                    await DisplayAlert("Aviso", "Hubo un problema de comunicación con el servidor, por favor intente después.", "Aceptar");

                    break;
                }
            }
        }