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); }
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); }