コード例 #1
0
        private void generateFactura()
        {
            DateTime     currentDate  = DateTime.Now;
            StreamWriter streamTofill = new System.IO.StreamWriter(@"c:\temp\tmpfile.txt", false, Encoding.UTF8);

            this.buildCompanyData();
            this.buildDosifData();
            this.buildNroFacturaAndFechaTransaccion();
            this.buildFacturaOBject();
            this.buildFechaLimite();
            this.buildCodigoControl();
            this.buildLiteral();
            CommonUtils.FormatImpresion impresionFormat = new CommonUtils.FormatImpresion();
            log.Error(cliente.Nombre);
            impresionFormat.fillStreamWithData(ref streamTofill,
                                               40, NombreEmpresa, RazonSocialEmpresa, sucursalMessage,
                                               DireccionEmpresa, Rubro, TelefonoEmpresa, "Cochabamba-Bolivia", NITEmpresa, facturaNro.ToString()
                                               , dosifNroAutorizacion.ToString(), formatTwoDigits(currentDate.Day.ToString()) + "/" + formatTwoDigits(currentDate.Month.ToString()) + "/" + currentDate.Year.ToString(),
                                               cliente.Nombre, cliente.NIT, factura, literalValue,
                                               codigoControlValue, dosifFechaLimite, (double.Parse(txtCuenta.Text) - double.Parse(txtTotal.Text)));

            streamTofill.Close();

            printFont = new System.Drawing.Font("Courier New", 8);
            printDocument.Print();

            string sql = "update dosificacion set dosificacion_ultimo_valor='" + facturaNro + "'";

            CommonUtils.ConexionBD.Actualizar(sql);

            dbLog.RecordOperationInDataBase(NombreEmpresa, RazonSocialEmpresa, sucursalMessage, DireccionEmpresa, Rubro, TelefonoEmpresa
                                            , "Cochabamba-Bolivia", NITEmpresa, facturaNro.ToString(), dosifNroAutorizacion.ToString(),
                                            currentDate.ToString("yyyy-MM-dd H:mm:ss.fff"), cliente.Nombre,
                                            cliente.NIT, factura, literalValue, codigoControlValue, dosifFechaLimite, double.Parse(txtTotal.Text));
        }
コード例 #2
0
        //
        private void generateAndPrintDetalle()
        {
            StreamWriter   streamTofill = new System.IO.StreamWriter(@"c:\temp\tmpfile.txt");
            List <DataRow> listaPedidos = dataTable.AsEnumerable().ToList();

            CommonUtils.FormatImpresion impresionFormat = new CommonUtils.FormatImpresion();

            this.buildFacturaOBject();
            //impresionFormat.fillDetalle(ref streamTofill, 35, factura, cliente.NumeroPedido.ToString());
            impresionFormat.fillDetalleWithDescription(ref streamTofill, 30, listaPedidos, cliente.NumeroPedido.ToString( ));
            streamTofill.Close();
            printFont = new System.Drawing.Font("Courier New", 8);

            printDocument.Print();
            #region print detalle
            //not implemented yet
            #endregion
        }
コード例 #3
0
        private void generateFactura()
        {
            
            DateTime currentDate = DateTime.Now;
            StreamWriter streamTofill = new System.IO.StreamWriter(@"c:\temp\tmpfile.txt",false,Encoding.UTF8);
            this.buildCompanyData();
            this.buildDosifData();
            this.buildNroFacturaAndFechaTransaccion();
            this.buildFacturaOBject();
            this.buildFechaLimite();
            this.buildCodigoControl();
            this.buildLiteral();
            CommonUtils.FormatImpresion impresionFormat = new CommonUtils.FormatImpresion();
            log.Error( cliente.Nombre );
            impresionFormat.fillStreamWithData(ref streamTofill,
                40, NombreEmpresa, RazonSocialEmpresa, sucursalMessage,
                DireccionEmpresa,Rubro,TelefonoEmpresa, "Cochabamba-Bolivia", NITEmpresa, facturaNro.ToString()
                , dosifNroAutorizacion.ToString(), formatTwoDigits(currentDate.Day.ToString()) + "/" + formatTwoDigits(currentDate.Month.ToString())+ "/" + currentDate.Year.ToString(),
                                cliente.Nombre, cliente.NIT, factura, literalValue,
                codigoControlValue, dosifFechaLimite,(double.Parse(txtCuenta.Text) - double.Parse(txtTotal.Text)));

            streamTofill.Close();

            printFont = new System.Drawing.Font("Courier New", 8);
            printDocument.Print();
          
            string sql="update dosificacion set dosificacion_ultimo_valor='"+facturaNro+"'";
            CommonUtils.ConexionBD.Actualizar(sql);

            dbLog.RecordOperationInDataBase(NombreEmpresa, RazonSocialEmpresa, sucursalMessage, DireccionEmpresa, Rubro, TelefonoEmpresa
                , "Cochabamba-Bolivia", NITEmpresa, facturaNro.ToString(), dosifNroAutorizacion.ToString(),
                currentDate.ToString( "yyyy-MM-dd H:mm:ss.fff" ) , cliente.Nombre ,
                cliente.NIT, factura, literalValue, codigoControlValue, dosifFechaLimite,double.Parse(txtTotal.Text));            
            
        }
コード例 #4
0
        //
        private void generateAndPrintDetalle()
        {
            StreamWriter streamTofill = new System.IO.StreamWriter(@"c:\temp\tmpfile.txt");
            List<DataRow> listaPedidos = dataTable.AsEnumerable().ToList();
            CommonUtils.FormatImpresion impresionFormat = new CommonUtils.FormatImpresion();
           
            this.buildFacturaOBject();
            //impresionFormat.fillDetalle(ref streamTofill, 35, factura, cliente.NumeroPedido.ToString());
            impresionFormat.fillDetalleWithDescription( ref streamTofill , 30 , listaPedidos , cliente.NumeroPedido.ToString( ) );
            streamTofill.Close();
            printFont = new System.Drawing.Font("Courier New", 8);
           
            printDocument.Print();
            #region print detalle
            //not implemented yet
            #endregion

        }