}//fin metodo BuscarProductoVentas

        //inicio metodo cargar datagrid Ventas
        private void CargarVentas()
        {//inicio metdo cargar ventas
         //CAPTURAMOS VALOR DE LA FILA SELECCIONADA DG FORM2
            DFactura V        = new DFactura();
            DVentas  Ventas   = new DVentas();
            DDetalle Detalle1 = new DDetalle();
            decimal  Subtotal = 0;

            //dataVentas.Rows.Add(A, B, C, D, E);
            //foreach (DataGridViewRow fila in this.dataListadoProductos.Rows)
            //{
            //dataVentas.Rows.Add(fila.Cells[0].Value, fila.Cells[2].Value, fila.Cells[3].Value, fila.Cells[4].Value);
            //dataVentas.Rows.Add(A, B);
            //}
            //Int32 A = Convert.ToInt32(this.dataListadoProductos.CurrentRow.Cells[0].Value.ToString());
            //Int32 A = Convert.ToInt32(this.lblNumeroFactura.Text);
            //decimal P = Convert.ToDecimal(this.dataListadoProductos.CurrentRow.Cells[3].Value.ToString());
            //string B = this.txtCantidadProducto.Text;
            //string C = this.dataListadoProductos.CurrentRow.Cells[2].Value.ToString();
            //string D = this.dataListadoProductos.CurrentRow.Cells[3].Value.ToString();
            //Int32 E = dataListadoProductos.RowCount;
            //dataVentas.Rows.Add(A, B, D, E);

            //V.Fecha_venta = Convert.ToDateTime(this.dtpFechaVenta.Text);
            //V.Id_cliente = Convert.ToInt32(this.dataListadoProductos.CurrentRow.Cells[0].Value.ToString());
            //V.Id_cliente = Convert.ToInt32(this.txtIdentificador.Text);
            //V.Id_factura = Convert.ToInt32(this.txtCantidadProducto.Text);
            //V.Numero_factura = Convert.ToInt32(this.lblNumeroFactura.Text);
            //V.Comprobante_exposicion = Convert.ToInt32(this.dataListadoProductos.CurrentRow.Cells[0].Value.ToString());
            //V.Fecha_venta = Convert.ToDateTime(this.dtpFechaVenta.Value);

            //Detalle.Id_producto = Convert.ToInt32(this.dataListadoProductos.CurrentRow.Cells[5].Value.ToString());
            Ventas.Id_producto          = Convert.ToInt32(this.dataListadoProductos.CurrentRow.Cells[0].Value.ToString());
            Ventas.Precio_producto      = Convert.ToDecimal(this.dataListadoProductos.CurrentRow.Cells[4].Value.ToString());
            Ventas.Descripcion_producto = Convert.ToString(this.dataListadoProductos.CurrentRow.Cells[2].Value.ToString());
            Ventas.Cantidad_producto    = Convert.ToInt32(this.txtCantidadProducto.Text);
            Ventas.Id_factura           = Convert.ToInt32(this.lblNumeroFactura.Text);
            lst.Add(Ventas);
            LlenarGrilla();

            //Detalle.Id_producto = Convert.ToInt32(A);
            //Detalle.Precio_producto = Convert.ToDecimal(P);
            //Detalle.Cantidad_producto = Convert.ToInt32(this.txtCantidadProducto.Text);
            //lst.Add(Detalle);
            //LlenarGrilla();


            //foreach (DataGridViewRow row in dataListadoProductos.Rows)
            //{

            //int n = dataVentas.Rows.Add();
            //foreach (DataGridViewColumn col in dataListadoProductos.Columns)
            //    {
            //        dataVentas.Rows[n].Cells[col.Index].Value = dataListadoProductos.Rows[row.Index].Cells[col.Index].Value.ToString();
            //        //MessageBox.Show("numero de filas" + n);
            //    }


            //}
        }//fin metodo datagrid Ventas
        //metodo eliminar que llama a Eliminar de la clase DDetalle
        public static string Eliminar(int id_detalle)
        {
            DDetalle Obj = new DDetalle();

            Obj.Id_detalle = id_detalle;
            return(Obj.Eliminar(Obj));
        }
Exemple #3
0
        public DataTable Buscar(DateTime desde, DateTime hasta)
        {
            DDetalle o = new DDetalle();

            o.FechaDesde = desde;
            o.FechaHasta = hasta;
            return(o.BuscarFecha(o));
        }
        //metodo editar que llama a Editar de la clase DDetlle
        public static string Editar(int id_detalle, int id_factura, int id_producto, decimal precio_producto, int cantidad_producto)
        {
            DDetalle Obj = new DDetalle();

            Obj.Id_detalle        = id_detalle;
            Obj.Id_factura        = id_factura;
            Obj.Id_producto       = id_producto;
            Obj.Cantidad_producto = cantidad_producto;
            return(Obj.Editar(Obj));
        }
        //metodo mostrar que llama a Mostrar de la clase DDetalle
        public static DataTable Mostrar()
        {
            DDetalle Obj = new DDetalle();

            return(Obj.Mostrar());
        }