Example #1
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (gridDeProductos.RowCount > 0)
            {
                Producto producto      = (Producto)gridDeProductos.CurrentRow.DataBoundItem;
                int      cant          = new MyNumericInputBox().Show();
                double   total         = cant * producto.Precio;
                var      productoVenta = new ProductoAVender
                {
                    Id       = producto.Id,
                    Nombre   = producto.Nombre,
                    Precio   = producto.Precio,
                    Cantidad = cant,
                    Total    = total
                };

                //MaestroDetalleVentas.Instancia.Productos.Add(productoVenta);
                MaestroDetalleVentas.Instancia.AgregarProductoAlGrid(productoVenta);
                this.Close();
            }
            else
            {
                MessageBox.Show("No se han encontrado productos para agregar.");
            }
        }
        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            var frmPrueba = new MyNumericInputBox().Show();

            MessageBox.Show(frmPrueba.ToString());
        }