private void btnAgregar_Click(object sender, EventArgs e)
        {
            EdicionCategoria frm = new EdicionCategoria();

            frm.ShowDialog();
            CargarDatos();
        }
Beispiel #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            EdicionCategoria frm = new EdicionCategoria();

            frm.txtIDCategoria.Text = dtgRegistros.CurrentRow.Cells["IDCategoria"].Value.ToString();
            frm.txtCategoria.Text   = dtgRegistros.CurrentRow.Cells["Categoria"].Value.ToString();
            frm.txtEstandares.Text  = dtgRegistros.CurrentRow.Cells["Estandares"].Value.ToString();
            frm.ShowDialog();
            CargarDatos();
        }
 private void btnEditar_Click(object sender, EventArgs e)
 {
     try
     {
         if (MessageBox.Show("Desea editar el registro seleccionado?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             EdicionCategoria frm = new EdicionCategoria();
             frm.txbIDCategoria.Text = dtgRegistros.CurrentRow.Cells[0].Value.ToString();
             frm.txbNombre.Text      = dtgRegistros.CurrentRow.Cells[1].Value.ToString();
             frm.txbDescripcion.Text = dtgRegistros.CurrentRow.Cells[2].Value.ToString();
             frm.ShowDialog();
             CargarDatos();
         }
     }
     catch
     {
         MessageBox.Show("Ocurrio un Error a la hora de EDITAR", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }