Esempio n. 1
0
        public static async Task <LoginEstado> Authorize(string usuario, string clave)
        {
            LoginEstado Respuesta = LoginEstado.ErrorSistema;

            await Task.Run(() => {
                TS_SIAutenticationClient cliente = null;
                TS_BELogin input = new TS_BELogin()
                {
                    cdusuario = usuario,
                    password  = clave
                };
                try
                {
                    cliente = new TS_SIAutenticationClient(Helper.ServicioSoapBinding(), new EndpointAddress(Config.Services.Autenticate));
                    _LoginCompleted(cliente.Login(input));
                    Respuesta = LoginEstado.EsperandoRespuesta;
                }
                catch
                {
                    Respuesta = LoginEstado.ErrorSistema;
                }
                finally
                {
                    if (cliente != null)
                    {
                        if (cliente.State == CommunicationState.Opened)
                        {
                            cliente.Close();
                        }
                    }
                }
            });

            return(Respuesta);
        }
Esempio n. 2
0
 public static async void GetEmpresaAuthorize(TS_BELogin vLoginRequest)
 {
     await Task.Run(() => {
         TS_SIAutenticationClient cliente = null;
         try
         {
             cliente = new TS_SIAutenticationClient(Helper.ServicioSoapBinding(), new EndpointAddress(Config.Services.Autenticate));
             GetEmpresaUserCompleted(cliente.Login(vLoginRequest));
         }
         catch
         {
         }
         finally
         {
             if (cliente != null)
             {
                 if (cliente.State == CommunicationState.Opened)
                 {
                     cliente.Close();
                 }
             }
         }
     });
 }