private void btnSalvar_Click(object sender, EventArgs e) { try { string resp = ""; if (this.txtAudio.Text == string.Empty) { MensagemErro("Preencha todos os campos"); erroIcone.SetError(txtBuscar, "Insira o nome do audio"); } else { if (this.eNovo) { resp = NPrograma.Inserir(this.txtAudio.Text.Trim(), this.txtDuracao.Text, this.txtDataCadastro.Text, this.txtSintese.Text.Trim()); } else { resp = NPrograma.Editar(Convert.ToInt32( this.txtCodigo.Text), this.txtAudio.Text.Trim(), this.txtDuracao.Text, this.txtDataCadastro.Text, this.txtSintese.Text); } if (resp.Equals("OK")) { if (this.eNovo) { this.MensagemOK("Registro salvo com sucesso"); } else { this.MensagemOK("Registro editado com sucesso"); } } else { this.MensagemErro(resp); } this.eNovo = false; this.eEditar = false; this.botoes(); this.Limpar(); this.Mostrar(); } } catch (Exception ex) { //detalhamento do erro MessageBox.Show(ex.Message + ex.StackTrace); } }