Esempio n. 1
0
        private void btnDeletarfuncionalidade_Click(object sender, EventArgs e)
        {
            if (codFunciSelecionado < 0)
            {
                MessageBox.Show("Clique em um registro na grid antes de prosseguir!");
            }
            else
            {
                FuncionalidadeDTO FUNC = new FuncionalidadeDTO();
                FUNC.Id_Funcionalidade = codFunciSelecionado;

                int retorno = new BLL.FuncionalidadeBLL().DeletarFuncionalidade(FUNC);
                if (retorno > 0)
                {
                    MessageBox.Show("Excluído com Sucesso");
                    codFunciSelecionado = -1;
                    carregaGridFuncionalidade();
                    txbFunci.Text = "";
                    txbcampo.Text = "";
                }
            }
        }
Esempio n. 2
0
        private void btnInserirfuncionalidade_Click(object sender, EventArgs e)
        {
            if (txbFunci.Text == "" || txbcampo.Text == "")
            {
                MessageBox.Show("Por favor, preencha os campos obrigatórios...");
            }
            else
            {
                FuncionalidadeDTO FUNC = new FuncionalidadeDTO();
                FUNC.Funcionalidade = txbFunci.Text;
                FUNC.Campo          = txbcampo.Text;

                int retorno = new BLL.FuncionalidadeBLL().InsereFuncionalidade(FUNC);
                if (retorno > 0)
                {
                    MessageBox.Show("Gravado com Sucesso");
                    codFunciSelecionado = -1;
                    carregaGridFuncionalidade();
                    txbFunci.Text = "";
                    txbcampo.Text = "";
                }
            }
        }