示例#1
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                string         ruta = Application.StartupPath + "\\crCajaDiaria.rpt";
                ReportDocument rpt  = new ReportDocument();

                dsCajaDiaria dsPintureriaCajaDiaria = new dsCajaDiaria();
                dsCajaDiariaTableAdapters.getOneCajaRptTableAdapter cajaDiariaTableAdapter = new dsCajaDiariaTableAdapters.getOneCajaRptTableAdapter();

                cajaDiariaTableAdapter.Fill(dsPintureriaCajaDiaria.getOneCajaRpt, dtCaja.Value);

                dsPintureriaCajaDiaria.EnforceConstraints = false;



                rpt.Load(ruta);
                rpt.SetDataSource(dsPintureriaCajaDiaria);
                rpt.SetParameterValue("parCajaInicial", txtCajaInical.Text);


                frmRptVisor frmVerRpt = new frmRptVisor(rpt);
                frmVerRpt.Show();
            }
            catch (Exception)
            {
            }
        }
        private void btnReporte_Click(object sender, EventArgs e)
        {
            string         ruta = Application.StartupPath + "\\CobrarVentas.rpt";
            ReportDocument rpt  = new ReportDocument();


            dsVentas dsVentaCobrar = new dsVentas();

            dsVentaCobrar.EnforceConstraints = false;

            dsVentasTableAdapters.ClientesTableAdapter     clienteTableAdap     = new dsVentasTableAdapters.ClientesTableAdapter();
            dsVentasTableAdapters.CondPagoTableAdapter     condPagoTableAdap    = new dsVentasTableAdapters.CondPagoTableAdapter();
            dsVentasTableAdapters.DetalleVentaTableAdapter detVentaTableAdap    = new dsVentasTableAdapters.DetalleVentaTableAdapter();
            dsVentasTableAdapters.AbonarVentaTableAdapter  abonarVentaTableAdap = new dsVentasTableAdapters.AbonarVentaTableAdapter();
            dsVentasTableAdapters.VendedoresTableAdapter   vendedorTableAdap    = new dsVentasTableAdapters.VendedoresTableAdapter();
            dsVentasTableAdapters.VentasTableAdapter       ventaTableAdap       = new dsVentasTableAdapters.VentasTableAdapter();
            dsVentasTableAdapters.ArticulosTableAdapter    articuloTableAdap    = new dsVentasTableAdapters.ArticulosTableAdapter();
            dsVentasTableAdapters.MarcasTableAdapter       marcasTableAdap      = new dsVentasTableAdapters.MarcasTableAdapter();

            // llenos los tabla adapter

            clienteTableAdap.Fill(dsVentaCobrar.Clientes);
            condPagoTableAdap.Fill(dsVentaCobrar.CondPago);
            abonarVentaTableAdap.Fill(dsVentaCobrar.AbonarVenta);
            vendedorTableAdap.Fill(dsVentaCobrar.Vendedores);
            detVentaTableAdap.Fill(dsVentaCobrar.DetalleVenta);
            articuloTableAdap.Fill(dsVentaCobrar.Articulos);
            marcasTableAdap.Fill(dsVentaCobrar.Marcas);



            foreach (Entidades.E_Venta venta in this._listVenta)
            {
                dsVentas.VentasRow rowVenta = dsVentaCobrar.Ventas.NewVentasRow();
                rowVenta.codVenta    = venta.codVenta;
                rowVenta.CUIT        = venta.cuit;
                rowVenta.descuento   = venta.descuento;
                rowVenta.idCliente   = venta.cliente.idCliente;
                rowVenta.idVendedor  = venta.vendedor.idVendedor;
                rowVenta.idCondPago  = venta.condPago.idCondPago;
                rowVenta.precioTotal = venta.precioTotal;
                rowVenta.observacion = venta.observacion;
                rowVenta.recargo     = venta.recargo;
                rowVenta.fecVenta    = (DateTime)venta.fecha;

                dsVentaCobrar.Ventas.AddVentasRow(rowVenta);
            }
            ventaTableAdap.Fill(dsVentaCobrar.Ventas);

            rpt.Load(ruta);
            rpt.SetDataSource(dsVentaCobrar);


            frmRptVisor frmVerRpt = new frmRptVisor(rpt);

            frmVerRpt.Show();
        }
示例#3
0
        private void generarPresupuesto()
        {
            try
            {
                dsVentas dsPresupuestoVenta = new dsVentas();

                dsPresupuestoVenta.EnforceConstraints = false;
                dsVentas.cabPresupuestoRow cabPresuepuesto = dsPresupuestoVenta.cabPresupuesto.NewcabPresupuestoRow();
                dsVentas.detPresupuestoRow detPresupuesto;

                //Crear la cabecera
                cabPresuepuesto.Cliente     = txtDescripcion.Text;
                cabPresuepuesto.Direccion   = txtDireccion.Text;
                cabPresuepuesto.dniCliente  = txtCuitDni.Text;
                cabPresuepuesto.Fecha       = dtFecVenta.Value.Date.ToString("dd/MM/yyyy");
                cabPresuepuesto.FechaFin    = _fecFinPresupuesto.Value.ToString("dd/MM/yyyy");
                cabPresuepuesto.Vendedor    = cboVendedor.Text;
                cabPresuepuesto.Observacion = txtObservacion.Text;
                cabPresuepuesto.Descuento   = Convert.ToDecimal(txtDescVenta.Text);
                dsPresupuestoVenta.cabPresupuesto.AddcabPresupuestoRow(cabPresuepuesto);


                foreach (DataGridViewRow rowDet in dgDetalle.Rows)
                {
                    detPresupuesto             = dsPresupuestoVenta.detPresupuesto.NewdetPresupuestoRow();
                    detPresupuesto.codArticulo = rowDet.Cells[colCodArticulo.Index].Value.ToString();
                    detPresupuesto.Descripcion = rowDet.Cells[colDescripcion.Index].Value.ToString();
                    detPresupuesto.Observacion = rowDet.Cells[colObservacion.Index].Value.ToString();
                    detPresupuesto.Cantidad    = rowDet.Cells[colCantidad.Index].Value.ToString();
                    detPresupuesto.Precio      = rowDet.Cells[colPrecio.Index].Value.ToString();
                    detPresupuesto.Total       = Convert.ToDecimal(rowDet.Cells[colTotal.Index].Value.ToString());

                    dsPresupuestoVenta.detPresupuesto.AdddetPresupuestoRow(detPresupuesto);
                }

                string         ruta = Application.StartupPath + "\\crPresupuesto.rpt";
                ReportDocument rpt  = new ReportDocument();
                rpt.Load(ruta);
                rpt.SetDataSource(dsPresupuestoVenta);

                frmRptVisor frmVerRpt = new frmRptVisor(rpt);
                frmVerRpt.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#4
0
        //Metodos
        private void generarRemito(Int64 codVenta)
        {
            try
            {
                string         ruta = Application.StartupPath + "\\crRemitoVenta.rpt";
                ReportDocument rpt  = new ReportDocument();

                dsVentas dsPintureriaVenta = new dsVentas();

                dsPintureriaVenta.EnforceConstraints = false;
                dsVentasTableAdapters.ClientesTableAdapter     clienteTableAdap     = new dsVentasTableAdapters.ClientesTableAdapter();
                dsVentasTableAdapters.CondPagoTableAdapter     condPagoTableAdap    = new dsVentasTableAdapters.CondPagoTableAdapter();
                dsVentasTableAdapters.DetalleVentaTableAdapter detVentaTableAdap    = new dsVentasTableAdapters.DetalleVentaTableAdapter();
                dsVentasTableAdapters.AbonarVentaTableAdapter  abonarVentaTableAdap = new dsVentasTableAdapters.AbonarVentaTableAdapter();
                dsVentasTableAdapters.VendedoresTableAdapter   vendedorTableAdap    = new dsVentasTableAdapters.VendedoresTableAdapter();
                dsVentasTableAdapters.VentasTableAdapter       ventaTableAdap       = new dsVentasTableAdapters.VentasTableAdapter();
                dsVentasTableAdapters.ArticulosTableAdapter    articuloTableAdap    = new dsVentasTableAdapters.ArticulosTableAdapter();
                dsVentasTableAdapters.MarcasTableAdapter       marcasTableAdap      = new dsVentasTableAdapters.MarcasTableAdapter();

                // llenos los tabla adapter

                clienteTableAdap.Fill(dsPintureriaVenta.Clientes);
                condPagoTableAdap.Fill(dsPintureriaVenta.CondPago);
                abonarVentaTableAdap.Fill(dsPintureriaVenta.AbonarVenta);
                vendedorTableAdap.Fill(dsPintureriaVenta.Vendedores);
                detVentaTableAdap.Fill(dsPintureriaVenta.DetalleVenta);
                articuloTableAdap.Fill(dsPintureriaVenta.Articulos);
                marcasTableAdap.Fill(dsPintureriaVenta.Marcas);

                ventaTableAdap.FillByGetOneVenta(dsPintureriaVenta.Ventas, codVenta);

                rpt.Load(ruta);
                rpt.SetDataSource(dsPintureriaVenta);


                frmRptVisor frmVerRpt = new frmRptVisor(rpt);
                frmVerRpt.Show();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#5
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                string         ruta = Application.StartupPath + "\\crPedido.rpt";
                ReportDocument rpt  = new ReportDocument();

                dsPedido dsPintureriaPedido = new dsPedido();

                dsPintureriaPedido.EnforceConstraints = false;

                dsPedidoTableAdapters.ArticulosTableAdapter      articuloTableAdap       = new dsPedidoTableAdapters.ArticulosTableAdapter();
                dsPedidoTableAdapters.PedidosTableAdapter        pedidoTableAdap         = new dsPedidoTableAdapters.PedidosTableAdapter();
                dsPedidoTableAdapters.DetallePedidoTableAdapter  detPedidoTableAdap      = new dsPedidoTableAdapters.DetallePedidoTableAdapter();
                dsPedidoTableAdapters.ProveedoresTableAdapter    proveedoresTableAdap    = new dsPedidoTableAdapters.ProveedoresTableAdapter();
                dsPedidoTableAdapters.EstadosPedidosTableAdapter estadosPedidoTableAadap = new dsPedidoTableAdapters.EstadosPedidosTableAdapter();

                // llenos los tabla adapter

                articuloTableAdap.Fill(dsPintureriaPedido.Articulos);
                detPedidoTableAdap.Fill(dsPintureriaPedido.DetallePedido);
                proveedoresTableAdap.Fill(dsPintureriaPedido.Proveedores);
                estadosPedidoTableAadap.Fill(dsPintureriaPedido.EstadosPedidos);

                Int64 codPedido = Convert.ToInt64(txtCodPedido.Text);
                pedidoTableAdap.FillByGetOnePedido(dsPintureriaPedido.Pedidos, codPedido);


                rpt.Load(ruta);
                rpt.SetDataSource(dsPintureriaPedido);


                frmRptVisor frmVerRpt = new frmRptVisor(rpt);
                frmVerRpt.Show();
            }
            catch (Exception)
            {
                MessageBox.Show("No se pudo generar el reporte de Pedidos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }