Пример #1
0
        public static async Task <LoginEstado> AutenticateDeposito()
        {
            LoginEstado Respuesta = LoginEstado.ErrorSistema;

            await Task.Run(() => {
                TS_BELoginVendedor input = new TS_BELoginVendedor()
                {
                    cdempresa = TSLoginApp.CurrentEmpresa.cdempresa,
                    usuario   = UserNameVenderdor,
                    clave     = PasswordVenderdor
                };

                TS_SIImpresionClient cliente = null;
                try
                {
                    cliente = new TS_SIImpresionClient(Helper.ServicioSoapBinding(), new EndpointAddress(Config.Services.Impresion));
                    _AUTENTICAR_DEPOSITO_GRIFEROCompleted(cliente.AUTENTICAR_DEPOSITO_GRIFERO(input));
                    Respuesta = LoginEstado.EsperandoRespuesta;
                }
                catch
                {
                    Respuesta = LoginEstado.ErrorSistema;
                }
                finally
                {
                    if (cliente != null)
                    {
                        if (cliente.State == CommunicationState.Opened)
                        {
                            cliente.Close();
                        }
                    }
                }
            });

            return(Respuesta);
        }
Пример #2
0
        public static async Task <LoginEstado> AutorizeLoginConfiguracionLados(string usuario, string clave)
        {
            LoginEstado respuesta = LoginEstado.ErrorSistema;
            await Task.Run(() => {
                TS_BELoginVendedor input = new TS_BELoginVendedor()
                {
                    cdempresa = TSLoginApp.CurrentEmpresa.cdempresa,
                    usuario   = usuario,
                    clave     = clave
                };

                TS_SIImpresionClient cliente = null;

                try
                {
                    cliente = new TS_SIImpresionClient(Helper.ServicioSoapBinding(), new EndpointAddress(Config.Services.Impresion));
                    _AUTENTICAR_CONFIGURACION_LADOSCompleted(cliente.AUTENTICAR_CONFIGURACION_LADOS(input));
                    respuesta = LoginEstado.EsperandoRespuesta;
                }
                catch
                {
                    respuesta = LoginEstado.ErrorSistema;
                }
                finally
                {
                    if (cliente != null)
                    {
                        if (cliente.State == CommunicationState.Opened)
                        {
                            cliente.Close();
                        }
                    }
                }
            });

            return(respuesta);
        }