private void btnAgregar_Click(object sender, EventArgs e) { frmEdEstudiantes formulario = new frmEdEstudiantes(); formulario.con = conn; formulario.modalidad = "C"; formulario.ShowDialog(); }
private void dvgEstudiante_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { DataGridViewRow row = this.dvgEstudiante.SelectedRows[0]; frmEdEstudiantes formulario = new frmEdEstudiantes(); formulario.nombre = row.Cells[1].Value.ToString(); formulario.matricula = row.Cells[0].Value.ToString(); formulario.direccion = row.Cells[3].Value.ToString(); formulario.carrera = row.Cells[2].Value.ToString(); formulario.modalidad = "U"; formulario.con = conn; formulario.ShowDialog(); } catch (Exception ex) { MessageBox.Show("Error al editar registro: " + ex.Message); } }