private void BtAdd_Click(object sender, EventArgs e) { inputBox iBox = new inputBox(); bool bAllow = gtiCore.GetBinaryAccess((int)TAcesso.CadastroProfissao_Alterar); if (!bAllow) { MessageBox.Show("Acesso não permitido.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } String sCod = iBox.Show("", "Informação", "Digite o nome da profissão.", 100); if (!string.IsNullOrEmpty(sCod)) { Cidadao_bll cidadaoRepository = new Cidadao_bll(_connection); GTI_Models.Models.Profissao reg = new GTI_Models.Models.Profissao { Nome = sCod.ToUpper() }; Exception ex = cidadaoRepository.Incluir_Profissao(reg); if (ex != null) { ErrorBox eBox = new ErrorBox("Atenção", "Profissão já cadastrada.", ex); eBox.ShowDialog(); } else { Carrega_Lista(); } } }