예제 #1
0
        private void executeNuevo()
        {
            FormImpuestoNuevo clienteNuevo = new FormImpuestoNuevo();

            clienteNuevo.ShowDialog();
            this.reLoad();
        }
예제 #2
0
        private void executeModificar()
        {
            // Verificando la existencia de datos en el datagridview
            if (dataGridView.Rows.Count == 0)
            {
                MessageBox.Show("No hay un registro seleccionado", "Eliminar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            int index      = dataGridView.CurrentRow.Index;                            // Identificando la fila actual del datagridview
            int idImpuesto = Convert.ToInt32(dataGridView.Rows[index].Cells[0].Value); // obteniedo el idRegistro del datagridview

            currentImpuesto = impuestos.Find(x => x.idImpuesto == idImpuesto);         // Buscando la registro especifico en la lista de registros

            // Mostrando el formulario de modificacion
            FormImpuestoNuevo impuestoNuevo = new FormImpuestoNuevo(currentImpuesto);

            impuestoNuevo.ShowDialog();
            cargarRegistros(); // recargando loas registros en el datagridview
        }