private void btnCONFIRMAR_Click(object sender, EventArgs e) { CategoriaDTO categoriaDTO = new CategoriaDTO { Categoria = txtNome.Text }; try { if (Resposta == "Sem alterações") { categoriaDTO.ID_Categoria = ID; } if (ID > 0) { business.Alterar(categoriaDTO); string mensagem = "Alterado com sucesso"; Mbox.Info(mensagem); Resposta = "Alterado"; Close(); } _ = business.Salvar(categoriaDTO); } catch (Exception a) { MessageBox.Show(a.Message); } }