コード例 #1
0
        private void imprimirButton_Click(object sender, EventArgs e)
        {
            if (comprobantesDataList.SelectedItem == null)
            {
                return;
            }

            this.Enabled = false;

            if (!FacturadorUtils.initControlador())
            {
                this.Enabled = true;
                MessageBox.Show("No fue posible inicializar el controlador fiscal");
                return;
            }
            Comprobante comp = (Comprobante)comprobantesDataList.SelectedItem.RowObject;

            long nroCOmp = FacturadorUtils.imprimirComprobante(comp);

            if (registrarFacturacionRest(comp.id, nroCOmp))
            {
                MessageBox.Show("Comprobante impreso: " + nroCOmp);
            }
            else
            {
                MessageBox.Show("Error al registrar la facturacion en el sistema: " + nroCOmp);
            }

            comprobantesDataList.ClearObjects();

            this.Enabled = true;
        }
コード例 #2
0
        private void cierreZButton_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(this, "Realmente desea imprimir el reporte Z?", "Reporte Z", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            this.Enabled = false;

            if (!FacturadorUtils.initControlador())
            {
                this.Enabled = true;
                MessageBox.Show("No fue posible inicializar el controlador fiscal");
                return;
            }
            FacturadorUtils.cierreZ();

            this.Enabled = true;
        }