public override global::System.Data.DataSet Clone()
        {
            dsVentas cln = ((dsVentas)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
        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();
        }
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            dsVentas ds = new dsVentas();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Example #4
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;
            }
        }
Example #5
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);
            }
        }
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                dsVentas ds = new dsVentas();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "dtVentasDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }
Example #7
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     dsVentas ds = new dsVentas();
     global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "VentasDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
Example #8
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     dsVentas ds = new dsVentas();
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }