Exemplo n.º 1
0
        private void MostrarDetalle()
        {
            NDetalle obj = new NDetalle();

            dataListado.DataSource         = obj.Listar();
            dataListado.Columns[0].Visible = false;
            dataListado.Columns[8].Visible = false;
        }
        private void button3_Click(object sender, EventArgs e)
        {//inicio boton confirmar venta
            string rpta        = "";
            string rptaFactura = "";

            if (dataVentas.Rows.Count > 0)
            {
                for (int i = 0; i < dataVentas.Rows.Count; i++)
                {
                    Decimal SumaIgv = 0; Decimal SumaSubTotal = 0;
                    if (Convert.ToString(dataVentas.Rows[i].Cells[2].Value) != "")
                    {
                        //SumaIgv += Convert.ToDecimal(dataVentas.Rows[i].Cells[6].Value);
                        //SumaSubTotal += Convert.ToDecimal(dataVentas.Rows[i].Cells[4].Value);
                        //GuardarDetalleVenta(
                        //Convert.ToInt32(lblNumeroFactura.Text),
                        //Convert.ToInt32(dataListadoProductos.Rows[i].Cells[0].Value),
                        //Convert.ToDecimal(dataListadoProductos.Rows[i].Cells[4].Value),
                        //Convert.ToInt32(txtCantidadProducto),
                        //Convert.ToString(dataListadoProductos.Rows[i].Cells[2].Value)
                        //);
                        rpta = NDetalle.Insertar(500, Convert.ToInt32(lblNumeroFactura.Text), Convert.ToInt32(dataVentas.Rows[i].Cells[0].Value), Convert.ToDecimal(dataVentas.Rows[i].Cells[3].Value), Convert.ToInt32(dataVentas.Rows[i].Cells[1].Value));
                        //MessageBox.Show("Contiene Datos." + rpta +  "Precio: " + dataVentas.Rows[i].Cells[3].Value + "Cantidad de productos:" + dataVentas.Rows[i].Cells[1].Value);

                        if (rpta.Equals("OK"))
                        {//inicio if rpta
                         //MessageBox.Show("Se insertó correctamente el registro.");
                        }

                        else
                        {
                            MessageBox.Show("No se cargó la venta de los productos, pongase en contacto con el Adminisrador de base de datos de Procesamiento de Datos.");
                        }
                    }
                }

                rptaFactura = NFactura.Insertar(500, Convert.ToInt32(this.txtIdentificador.Text), "12/10/2005", Convert.ToDecimal(this.lblTotal.Text), Convert.ToInt32(this.lblNumeroFactura.Text), 1, 1, 1, 1);
                if (rptaFactura.Equals("OK"))
                {
                    MessageBox.Show("Se realizó correctamente la venta.");
                    LimpiarVenta();
                }

                else
                {
                    MessageBox.Show("No se cargó la venta, pongase en contacto con el Administrador de base de datos de Procesamiento de Datos.");
                }
            }
        }//fin boton confirmar venta
Exemplo n.º 3
0
        private void BuscarFecha()
        {
            NDetalle o = new NDetalle();

            dataListado.DataSource = o.Buscar(dtDesde.Value, dtHasta.Value);
        }