Exemple #1
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(txtGrupo.Text))
            {
                if (this.grupoCarregado == null)
                {
                    this.grupoCarregado = new Grupo();
                }

                this.grupoCarregado.grupo = txtGrupo.Text;

                GrupoDAO dao = new GrupoDAO();
                if (!this.editando)
                {
                    dao.AdicionaGrupo(this.grupoCarregado);
                }
                else
                {
                    dao.AlteraGrupo(this.grupoCarregado);
                }
                CarregaListaGrupos();
            }
            else
            {
                MessageBox.Show("Não foi possível realizar a operação.\nHá CAMPOS OBRIGATÓRIOS que não foram preenchidos!", "Fracasso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }