private void btnSave_Click(object sender, EventArgs e) { try { if (string.IsNullOrWhiteSpace(txtServico.Text.Trim())) { throw new ErrorMessageException("Serviço não informado, verifique."); } if (tipo == null) { tipo = new Tipo(); } tipo.Descricao = txtServico.Text; tipo.Observacao = txtObs.Text; if (tipo.Id == 0) { TipoRepositorySQLite.Save(tipo); } else { TipoRepositorySQLite.Update(tipo); } AtualizaForm(); } catch (ErrorMessageException eme) { MessageBox.Show(eme.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { } }