Exemple #1
0
        public void print()
        {
            if (this.flag)
            {
                try
                {
                    if (printerControl.printIsSafe(this.db.getprinteretiquetaname()))
                    {
                        this.reporte.PrintOptions.PrinterName = this.db.getprinteretiquetaname();

                        this.reporte.PrintToPrinter(1, true, 0, 0);
                    }
                    else
                    {
                        using (printWarning pw = new printWarning())
                        {
                            pw.ShowDialog();
                        }
                    }
                }
                catch (Exception ex)
                {
                    genericDefinitions.error(ex.ToString());
                }
            }
            else
            {
                genericDefinitions.error("No se puede proceder a realizar la impresión, consulte al desarrollador");
            }


            this.reporte.Close();

            this.reporte.Dispose();
        }
        public void print()
        {
            try
            {
                if (printerControl.printIsSafe(this.db.getprinterticketname()))
                {
                    this.reporte.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                    this.reporte.PrintToPrinter(1, true, 0, 0);
                }
                else
                {
                    using (printWarning pw = new printWarning())
                    {
                        pw.ShowDialog();
                    }
                }

                this.reporte.Close();
                this.reporte.Dispose();
            }
            catch (Exception ex)
            {
                genericDefinitions.error(ex.ToString());
            }
        }
        private void baccept_Click(object sender, EventArgs e)
        {
            if (this.rbindividual.Checked && this.txtcodigo.Text.Trim() == "")
            {
                genericDefinitions.dangerInfo("Ingrese Un Codigo de Producto a Imprimir.");
                this.txtcodigo.Focus();

                return;
            }

            if (this.rbtodas.Checked)
            {
                this.loadCodigos();

                if (genericDefinitions.yesno("¿Confirma la Impresion de " + (this.codigos.Count * this.nup.Value).ToString() + " Etiquetas?", "Security Process"))
                {
                    if (!printerControl.printIsSafe(this.db.getprinteretiquetaname()))
                    {
                        using (printWarning pw = new printWarning())
                        {
                            pw.ShowDialog();
                        }

                        return;
                    }
                }
                else
                {
                    return;
                }
            }

            this.printSelected();
        }