Example #1
0
        private void btn_modificar_Click(object sender, EventArgs e)
        {
            Int64 id = 0;

            if (grilla_productos.Rows.Count <= 0)
            {
                MessageBox.Show("Debe seleccionar un producto de la lista para editar.", "Seleccione el producto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            id = Int64.Parse(grilla_productos.CurrentRow.Cells[0].Value.ToString());

            if (id == 0)
            {
                MessageBox.Show("Debe seleccionar un producto de la lista para editar.", "Seleccione el producto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            nuevoProducto np;

            using (np = new nuevoProducto(id))
            {
                np.ShowDialog();
            }

            cargarGridProductos();
        }
Example #2
0
        private void btn_nuevo_Click(object sender, EventArgs e)
        {
            nuevoProducto np;

            using (np = new nuevoProducto())
            {
                btn_nuevo.Enabled = false;
                np.ShowDialog();
            }
            btn_nuevo.Enabled = true;
            cargarGridProductos();
        }