Ejemplo n.º 1
0
        public void ObtenerUltimaVenta(string numDoc)
        {
            try
            {
                // >> 0,IdUser
                // << 0,BolNum 1,Monto 2,CampoImpr
                PipeClient pipeClient = new PipeClient();
                // pipeClient.Message = BuildMessage(Comandos.UltimaVenta, new List<string> { Settings.Default.IdKiosco.ToString() });
                //Log.Write("UltVenta", pipeClient.Message, Evento.Query, Comandos.UltimaVenta);
                pipeClient.SendMessage(Comandos.UltimaVenta);

                if (pipeClient.Resultado.CodigoError == 0)
                {
                    string msg = string.Join("|", pipeClient.Resultado.Data);
                    //Log.Write("UltVenta", msg, Evento.Response, Comandos.UltimaVenta);
                    string[] resp = pipeClient.Resultado.Data[0].Split('~');
                    if (resp.Length >= 3)
                    {
                        //if (resp[0] == numDoc && resp[1] == Estado.DetallePago.MontoTransbank.ToString())
                        //{
                        //    Estado.PagoTbk.Voucher = resp[2];
                        //    Estado.PagoTbk.IsPagoOk = true;
                        //}
                    }
                }
                else
                {
                    //Log.Write("UltVenta", pipeClient.Resultado.CodigoError + ": " + pipeClient.Resultado.Data[0], Evento.Response, Comandos.UltimaVenta);
                }
            }
            catch (Exception ex)
            {
                //Global.log.Error("ObtenerUltimaVenta ", ex);
                //Log.Write("UltVenta", ex.ToString(), Evento.Error, Comandos.UltimaVenta);
            }
        }