public static TS_BECabeceraOutPut SynchronizedGetOPTransaction(string cara, String cdcliente, bool automatic)
        {
            TS_BEOpTransInput Input = new TS_BEOpTransInput()
            {
                cara        = cara,
                Serie       = TSLoginApp.Serie,
                cdcliente   = cdcliente,
                tipocliente = "",
                automatic   = automatic
            };

            TS_SISalesClient client = null;

            try
            {
                client = new TS_SISalesClient(Helper.ServicioSoapBinding(), new EndpointAddress(Config.Services.Sales));

                return(client.ObtenerOpTransaccion(Input));
            }
            catch (Exception exception)
            {
                if (client != null)
                {
                    if (client.State == CommunicationState.Opened)
                    {
                        client.Close();
                    }
                }

                return(new TS_BECabeceraOutPut()
                {
                    Mensaje = exception.Message, Ok = false
                });
            }
        }
        public static async Task <SalesEstado> ObtenerOpTransaccion()
        {
            SalesEstado Respuesta = SalesEstado.ErrorSistema;
            await Task.Run(() => {
                TS_SISalesClient cliente = null;
                try
                {
                    cliente = new TS_SISalesClient(Helper.ServicioSoapBinding(), new EndpointAddress(Config.Services.Sales));
                    TS_BEOpTransInput input = new TS_BEOpTransInput()
                    {
                        cara        = Cara,
                        Serie       = TSLoginApp.Serie,
                        cdcliente   = TSCustomerApp.TipoComprobante.Nombre.Equals(TSSalesInput.NotaDeDespacho().Nombre) ? TSCustomerApp.ClientOuput.nroTarjeta : TSCustomerApp.ClientOuput.cdcliente,
                        tipocliente = "",
                        automatic   = false
                    };

                    _ObtenerOpTransaccionCompleted(cliente.ObtenerOpTransaccion(input));
                    Respuesta = SalesEstado.EsperandoRespuesta;
                }
                catch
                {
                    Respuesta = SalesEstado.ErrorSistema;
                }
                finally
                {
                    if (cliente != null)
                    {
                        if (cliente.State == CommunicationState.Opened)
                        {
                            cliente.Close();
                        }
                    }
                }
            });

            return(Respuesta);
        }