예제 #1
0
        public FrmAnulacion(AppDemo.DtsReport.anulacionDataTable dt)
        {
            try
            {
                DataTable dtanulacion;
                dtanulacion = dt;
                InitializeComponent();

                AppDemo.Reportes.rptanulacion rptanulacion1 = new AppDemo.Reportes.rptanulacion();
                rptanulacion1.SetDataSource(dtanulacion);
                visoranulacion.ReportSource = rptanulacion1;
            }
            catch (Exception ex)
            {
                throw;
            }
        }
예제 #2
0
        private void imprimir(string resp)
        {
            string   comercio;
            string   lote;
            string   tid;
            string   trx;
            string   lectura;
            string   autorizacion;
            decimal  subtot;
            decimal  iva;
            decimal  total;
            string   tarjeta;
            string   aplabel;
            string   numtarjeta;
            string   nombre;
            decimal  grabaiva;
            decimal  nograbaiva;
            DateTime fecha;
            DateTime hora;

            try
            {
                UTILIDADES.mensaje("DEBUG : " + txtreq.Text.Substring(2, 2).Trim() + " == " + resp.Substring(4, 2), "LogTracerCOM", "log");
                if (txtreq.Text.Substring(2, 2).Trim() == "01" || txtreq.Text.Substring(2, 2).Trim() == "02" || txtreq.Text.Substring(2, 2).Trim() == "05")
                {
                    comercio = this.txtresp.Text.Substring(68, 15).PadLeft(15, ' ');
                    UTILIDADES.mensaje("DEBUG : " + "comercio == " + comercio, "LogTracerCOM", "log");
                    lote = this.txtresp.Text.Substring(34, 6);
                    UTILIDADES.mensaje("DEBUG : " + "lote == " + lote, "LogTracerCOM", "log");
                    tid = this.txtresp.Text.Substring(60, 8).PadLeft(8, ' ');
                    UTILIDADES.mensaje("DEBUG : " + "tid == " + tid, "LogTracerCOM", "log");
                    numtarjeta = this.txtresp.Text.Substring(232, 20);
                    UTILIDADES.mensaje("DEBUG : " + "numtarjeta == " + numtarjeta, "LogTracerCOM", "log");
                    trx = this.txtresp.Text.Substring(28, 6);
                    UTILIDADES.mensaje("DEBUG : " + "trx == " + trx, "LogTracerCOM", "log");
                    autorizacion = this.txtresp.Text.Substring(54, 6);
                    UTILIDADES.mensaje("DEBUG : " + "autorizacion == " + autorizacion, "LogTracerCOM", "log");
                    total = Convert.ToDecimal(this.txtreq.Text.Substring(6, 12)) / 100;
                    UTILIDADES.mensaje("DEBUG : " + "total == " + total, "LogTracerCOM", "log");
                    grabaiva = Convert.ToDecimal(this.txtreq.Text.Substring(18, 12)) / 100;
                    UTILIDADES.mensaje("DEBUG : " + "grabaiva == " + grabaiva, "LogTracerCOM", "log");
                    nograbaiva = Convert.ToDecimal(this.txtreq.Text.Substring(30, 12)) / 100;
                    UTILIDADES.mensaje("DEBUG : " + "nograbaiva == " + nograbaiva, "LogTracerCOM", "log");
                    iva = Convert.ToDecimal(this.txtreq.Text.Substring(42, 12)) / 100;
                    UTILIDADES.mensaje("DEBUG : " + "iva == " + iva, "LogTracerCOM", "log");
                    lectura = this.txtresp.Text.Substring(277, 2).Trim();
                    UTILIDADES.mensaje("DEBUG : " + "lectura == " + lectura, "LogTracerCOM", "log");
                    aplabel = this.txtresp.Text.Substring(331, 20).Trim();
                    UTILIDADES.mensaje("DEBUG : " + "aplabel == " + aplabel, "LogTracerCOM", "log");
                    tarjeta = this.txtresp.Text.Substring(252, 4).Trim();

                    UTILIDADES.mensaje("DEBUG : " + "tarjeta == " + tarjeta, "LogTracerCOM", "log");
                    nombre = this.txtresp.Text.Substring(279, 40).Trim();
                    UTILIDADES.mensaje("DEBUG : " + "nombre == " + nombre, "LogTracerCOM", "log");

                    subtot = grabaiva + nograbaiva;


                    hora = Convert.ToDateTime(this.txtresp.Text.Substring(40, 2) + ":" + this.txtresp.Text.Substring(42, 2) + ":" + this.txtresp.Text.Substring(44, 2));
                    UTILIDADES.mensaje("DEBUG : " + "hora == " + hora, "LogTracerCOM", "log");

                    fecha = Convert.ToDateTime(this.txtresp.Text.Substring(46, 4) + "-" + this.txtresp.Text.Substring(50, 2) + "-" + this.txtresp.Text.Substring(52, 2));
                    UTILIDADES.mensaje("DEBUG : " + "fecha == " + fecha, "LogTracerCOM", "log");

                    if (lectura == "02")
                    {
                        lectura = "BANDA";
                    }
                    if (lectura == "03")
                    {
                        lectura = "CHIP";
                    }
                    if (lectura == "04" || lectura == "05")
                    {
                        lectura = "CHIP BANDA";
                    }

                    UTILIDADES.mensaje("DEBUG : " + "lectura == " + lectura, "LogTracerCOM", "log");

                    AppDemo.DtsReport ds = new AppDemo.DtsReport();
                    AppDemo.DtsReport.compraDataTable dtcompra = new AppDemo.DtsReport.compraDataTable();
                    dtcompra.AddcompraRow(comercio, lote, tid, tarjeta, numtarjeta, lectura, trx, autorizacion, grabaiva, nograbaiva, subtot, iva, total, aplabel, nombre, fecha, hora);
                    AppDemo.FrmVoucher frm = new AppDemo.FrmVoucher(dtcompra);
                    frm.Show();
                }


                if (this.txtreq.Text.Substring(2, 2) == "03")
                {
                    comercio = this.txtresp.Text.Substring(68, 15).PadLeft(15, ' ');
                    UTILIDADES.mensaje("DEBUG : " + "comercio == " + comercio, "LogTracerCOM", "log");

                    lote = this.txtresp.Text.Substring(34, 6);
                    UTILIDADES.mensaje("DEBUG : " + "lote == " + lote, "LogTracerCOM", "log");
                    tid = this.txtresp.Text.Substring(60, 8).PadLeft(8, ' ');
                    UTILIDADES.mensaje("DEBUG : " + "tid == " + tid, "LogTracerCOM", "log");
                    numtarjeta = this.txtresp.Text.Substring(232, 20);
                    UTILIDADES.mensaje("DEBUG : " + "numtarjeta == " + numtarjeta, "LogTracerCOM", "log");
                    tarjeta = this.txtresp.Text.Substring(252, 4).Trim();
                    UTILIDADES.mensaje("DEBUG : " + "tarjeta == " + tarjeta, "LogTracerCOM", "log");
                    trx = this.txtresp.Text.Substring(28, 6);
                    UTILIDADES.mensaje("DEBUG : " + "trx == " + trx, "LogTracerCOM", "log");
                    autorizacion = this.txtresp.Text.Substring(54, 6);
                    UTILIDADES.mensaje("DEBUG : " + "autorizacion == " + autorizacion, "LogTracerCOM", "log");
                    total = Convert.ToDecimal(this.txtreq.Text.Substring(6, 12)) / 100;
                    UTILIDADES.mensaje("DEBUG : " + "total == " + total, "LogTracerCOM", "log");
                    lectura = this.txtresp.Text.Substring(277, 2).Trim();
                    UTILIDADES.mensaje("DEBUG : " + "lectura == " + lectura, "LogTracerCOM", "log");
                    hora = Convert.ToDateTime(this.txtresp.Text.Substring(40, 2) + ":" + this.txtresp.Text.Substring(42, 2) + ":" + this.txtresp.Text.Substring(44, 2));
                    UTILIDADES.mensaje("DEBUG : " + "hora == " + hora, "LogTracerCOM", "log");
                    fecha = Convert.ToDateTime(this.txtresp.Text.Substring(46, 4) + "-" + this.txtresp.Text.Substring(50, 2) + "-" + this.txtresp.Text.Substring(52, 2));
                    UTILIDADES.mensaje("DEBUG : " + "fecha == " + fecha, "LogTracerCOM", "log");

                    if (lectura == "02")
                    {
                        lectura = "BANDA";
                    }
                    if (lectura == "03")
                    {
                        lectura = "CHIP";
                    }
                    if (lectura == "04" || lectura == "05")
                    {
                        lectura = "CHIP BANDA";
                    }

                    AppDemo.DtsReport ds = new AppDemo.DtsReport();
                    AppDemo.DtsReport.anulacionDataTable dtanulacion = new AppDemo.DtsReport.anulacionDataTable();
                    dtanulacion.AddanulacionRow(comercio, lote, tid, tarjeta, numtarjeta, lectura, trx, autorizacion, trx, total, fecha, hora);
                    AppDemo.FrmAnulacion frm = new AppDemo.FrmAnulacion(dtanulacion);
                    frm.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Opción no disponible " + ex.Message, "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                throw;
            }
        }