private void btnAgregar_Click(object sender, EventArgs e) { try { CategoriasEdicion f = new CategoriasEdicion(); f.ShowDialog(); Cargar(); } catch { } }
private void btnEditar_Click(object sender, EventArgs e) { try { if (MessageBox.Show("¿Realmente desea EDITAR el registro seleccionado?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { CategoriasEdicion f = new CategoriasEdicion(); f.txtIDCategoria.Text = dtgCategorias.CurrentRow.Cells["IDCategoria"].Value.ToString(); f.txtCategoria.Text = dtgCategorias.CurrentRow.Cells["Categoria"].Value.ToString(); f.ShowDialog(); Cargar(); } } catch { } }