コード例 #1
0
        protected void dtgContas_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            ContasBL conBL = new ContasBL();
            Contas contas = new Contas();
            contas.Id = utils.ComparaIntComZero(dtgContas.DataKeys[e.RowIndex][0].ToString());

            if (conBL.ExcluirBL(contas))
                ExibirMensagem("Registro excluído com sucesso !");
            else
                ExibirMensagem("Não foi possível excluir o registro, existem registros dependentes");

            Pesquisar(null);
        }
コード例 #2
0
        protected void dtgTitulo_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            ContasBL conBL = new ContasBL();
            Contas contas = new Contas();
            contas.Id = utils.ComparaIntComZero(dtgTitulo.DataKeys[e.RowIndex][0].ToString());
            conBL.ExcluirBL(contas);
            Pesquisar(null);

            //if (this.Master.VerificaPermissaoUsuario("EXCLUIR"))
            //{
            //    ContasBL conBL = new ContasBL();
            //    Contas contas = new Contas();
            //    contas.Id = utils.ComparaIntComZero(dtgTitulo.DataKeys[e.RowIndex][0].ToString());
            //    conBL.ExcluirBL(contas);
            //    Pesquisar(null);
            //}
            //else
            //    Response.Redirect("~/erroPermissao.aspx?nomeUsuario=" + ((Label)Master.FindControl("lblNomeUsuario")).Text + "&usuOperacao=operação", true);
        }