private void atualizarCampos() { try { Semestre semestre = new Semestre(); FormSemestre semestreDao = new FormSemestre(); if (codigoSemestre != 0) { semestre = semestreDao.buscaSemestre(codigoSemestre); txtNome.Text = semestre.nome.ToString(); } tipoAcao = (int)Acao.nenhum; travarCampos(tipoAcao); } catch (Exception ex) { MessageBox.Show("Erro: " + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }