protected void dgvNotificacaoEnvio_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("excluir"))
     {
         try
         {
             ManterNotificacaoEnvio manterNotificacaoEnvio = new ManterNotificacaoEnvio();
             int idNotificacaoEnvio = int.Parse(e.CommandArgument.ToString());
             manterNotificacaoEnvio.ExcluirNotificacaoEnvio(idNotificacaoEnvio);
             WebFormHelper.ExibirMensagem(enumTipoMensagem.Sucesso, "Registro excluído com sucesso!", "ListarNotificacaoEnvio.aspx");
         }
         catch (AcademicoException ex)
         {
             WebFormHelper.ExibirMensagem(enumTipoMensagem.Erro, ex.Message);
             return;
         }
     }
     else if (e.CommandName.Equals("editar"))
     {
         int idNotificacaoEnvio = int.Parse(e.CommandArgument.ToString());
         //Session.Add("TurmaEdit", idTipoTurma);
         Response.Redirect("EdicaoNotificacaoEnvio.aspx?Id=" + idNotificacaoEnvio.ToString(), false);
     }
     else if (e.CommandName.Equals("relatorio"))
     {
         Response.Redirect("/Relatorios/Notificacoes/Detalhes.aspx?Id=" + e.CommandArgument.ToString(), false);
     }
 }
Example #2
0
        private void PreencherGridRelatorio(int id)
        {
            var notificacaoEnvio = new ManterNotificacaoEnvio().ObterNotificacaoEnvioPorID(id);

            PreencherRelatorio(notificacaoEnvio.Notificacoes);


            if (dgvNotificacoes.Rows.Count > 0)
            {
                componenteGeracaoRelatorio.Visible = true;
            }
        }
        protected void btnPesquisar_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    classes.NotificacaoEnvio Notificacao            = ObterNotificacaoEnvio();
                    ManterNotificacaoEnvio   manterNotificacaoEnvio = new ManterNotificacaoEnvio();

                    using (var manterUsuario = new ManterUsuario())
                    {
                        var usuario = manterUsuario.ObterUsuarioLogado();
                        if (usuario.IsGestor())
                        {
                            Notificacao.Uf = usuario.UF;
                        }
                    }

                    IList <classes.NotificacaoEnvio> ListaNotificacao = manterNotificacaoEnvio.ObterNotificacaoEnvioPorFiltro(Notificacao);
                    WebFormHelper.PreencherGrid(ListaNotificacao, this.dgvNotificacaoEnvio);

                    if (ListaNotificacao != null && ListaNotificacao.Count > 0)
                    {
                        WebFormHelper.PreencherGrid(ListaNotificacao, this.dgvNotificacaoEnvio);
                        pnlNotificacaoEnvio.Visible = true;
                    }
                    else
                    {
                        pnlNotificacaoEnvio.Visible = false;
                        WebFormHelper.ExibirMensagem(enumTipoMensagem.Atencao, "Nenhuma Informação Encontrada");
                    }
                }
                catch (AcademicoException ex)
                {
                    WebFormHelper.ExibirMensagem(enumTipoMensagem.Erro, ex.Message);
                }
            }
        }