private static void ButtonUpdateClick(object sender, System.EventArgs e) { Alumno alumno = getAlumnoWithTextBox(); try { alumnoDao.UpdateAlumno(alumno); chargeTable(); } catch (CustomException ex) { switch (ex.type) { case CustomException.REGISTER_NOTEXISTS: MessageBox.Show(alumnoView, ex.message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); chargeTable(); break; } } catch (MySqlException) { MessageBox.Show(alumnoView, "Error Fatal: No se puede ejecutar la sentencia", "Error Fatal", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } }