private void FrmInscripcionExamenExt_Load(object sender, EventArgs e) { try { cboTipoDocumento.DataSource = Enum.GetValues(typeof(TipoDocumento)); // cboMateria.DataSource = Materia.ObtenerMaterias(); cboTipoDocumento.SelectedItem = null; // cboMateria.SelectedItem = null; inscripcionExamenEx = new InscripcionExamen(); LimpiarFormulario(); } catch (Exception) { MessageBox.Show("Atencion", "Error al cargar el formulario!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BtnGuardar_Click(object sender, EventArgs e) { try { string nroDoc = txtNroDocumento.Text; if (ValidarDatos()) { return; } TipoDocumento tipoDoc = (TipoDocumento)cboTipoDocumento.SelectedItem; InscripcionExamen.Agregar(inscripcionExamenEx); MessageBox.Show("La inscripcion ha sido guardada con éxito!"); LimpiarFormulario(); Limpiar(); inscripcionExamenEx = new InscripcionExamen(); } catch (Exception) { MessageBox.Show("No se pudo guardar!"); } }