private void imprimeTicket(string caso)
        {
            if (this.txtnventa.Text.Trim() != string.Empty)
            {
                switch (caso)
                {
                case ("vistaprevia"):
                {
                    this.ticketBase = new printTicket(this.db.getventa(int.Parse(this.txtnventa.Text.Trim())), this.db.getTienda());
                    this.ticketBase.setparams();

                    this.ticketViewer = new frmrptticket(this.ticketBase.getreporte());
                    this.ticketViewer.ShowDialog();
                    break;
                }

                case ("imprime"):
                {
                    this.ticketBase = new printTicket(this.db.getventa(int.Parse(this.txtnventa.Text.Trim())), this.db.getTienda());
                    this.ticketBase.setparams();

                    this.ticketBase.print();
                    break;
                }
                }
            }
            else
            {
                genericDefinitions.dangerInfo("Ingrese Numero de Venta!");
            }
        }
示例#2
0
        public async Task <bool> VentaFinal() //FUNCION INICIO PARA CREAR VENTA
        {
            bool        res   = false;
            Task <bool> tarea = new Task <bool>(this.InsertVenta);

            tarea.Start();
            res = await tarea;

            if (res)
            {
                genericDefinitions.ok("Se ha procesado correctamente la venta!", "Venta Realizada");

                if (this.frmcobrar.cbticket.Checked)
                {
                    this.ticket = new printTicket(this.db.getventa(this.ventatmp.idventa), this.db.getTienda());
                    this.ticket.setparams();
                    this.ticket.print();
                }
                this.inventario = this.db.getinventarioproductos();
            }
            else
            {
                genericDefinitions.error("No se ha procesado correctamente la venta!", "Error de procesamiento.");
            }
            return(res);
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            printTicket pt = new printTicket(this.db.getventa(16), this.db.getTienda());

            pt.setparams();
            //pt.print();

            frmrptticket ver = new frmrptticket(pt.getreporte());

            ver.ShowDialog();
        }