protected void Page_Load(object sender, EventArgs e)
        {
            if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/Account/Login.aspx");
            }

            if (!IsPostBack)
            {
                String cnpj = HttpUtility.HtmlDecode(Request.QueryString["Cnpj"]);
                String nome = HttpUtility.HtmlDecode(Request.QueryString["Nome"]);

                AcompanhaDenuncias denuncias = new AcompanhaDenuncias();
                denuncias.DenunciasParlamentarFornecedor(DropDownListParlamentar, cnpj);

                Object parlamentarSendoPesquisado = Session["ParlamentarQueEstaSendoAuditado"];

                if (parlamentarSendoPesquisado != null)
                {
                    if (DropDownListParlamentar.Items.FindByValue(parlamentarSendoPesquisado.ToString()) != null)
                    {
                        DropDownListParlamentar.SelectedValue = parlamentarSendoPesquisado.ToString();
                    }
                }

                lblCNPJ.InnerText        = cnpj;
                lblrazaoSocial.InnerText = nome;

                CarregaNotas();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated || !System.Web.HttpContext.Current.User.IsInRole("REVISOR"))
            {
                Response.Redirect("~/Default.aspx");
            }

            if (!IsPostBack)
            {
                AcompanhaDenuncias acompanha = new AcompanhaDenuncias();
                acompanha.DenunciasParlamentarFornecedor(GridViewDenuncias);

                Session["Acompanha0"] = GridViewDenuncias.DataSource;
                Session["AcompanhaSortDirection0"]  = "ASC";
                Session["AcompanhaSortExpression0"] = "Parlamentar";
            }
            GridViewDenuncias.PreRender += GGridViewDenuncias_PreRender;
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/Account/Login.aspx");
            }

            if (!IsPostBack)
            {
                String cnpj = HttpUtility.HtmlDecode(Request.QueryString["Cnpj"]);
                String nome = HttpUtility.HtmlDecode(Request.QueryString["Nome"]);

                lblCNPJ.InnerText        = cnpj;
                lblrazaoSocial.InnerText = nome;

                AcompanhaDenuncias dados = new AcompanhaDenuncias();
                dados.FornecedorParlamentares(GridViewResultado, cnpj);

                Session["FornecedorParlamentares"]           = GridViewResultado.DataSource;
                Session["FornecedorParlamentaresExpression"] = "Parlamentar";
                Session["FornecedorParlamentaresDirection"]  = "ASC";
            }
            GridViewResultado.PreRender += GridViewResultado_PreRender;
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/Account/Login.aspx");
            }

            mIdDenuncia = Convert.ToInt64(HttpUtility.HtmlDecode(Request.QueryString["IdDenuncia"]));
            mRevisor    = Roles.IsUserInRole(System.Web.HttpContext.Current.User.Identity.Name, "REVISOR");

            mRetornoClose = Convert.ToString(HttpUtility.HtmlDecode(Request.QueryString["Retorno"]));

            if (!IsPostBack)
            {
                Denuncia denuncia = new Denuncia();
                denuncia.Carrega(mIdDenuncia, HttpContext.Current.User.Identity.Name, mRevisor);

                if (denuncia.IdDenuncia == 0)
                {
                    Response.Redirect("~/Default.aspx");
                }

                LabelId.Text              = mIdDenuncia.ToString();
                LabelCNPJ.Text            = denuncia.Cnpj;
                HyperLinkRazaoSocial.Text = denuncia.RazaoSocial;

                if (denuncia.Cnpj.Length == 11)
                {
                    HyperLinkRazaoSocial.NavigateUrl = "javascript:window.parent.TabAuditoria('F','" + denuncia.Cnpj + "');";
                }
                else
                {
                    HyperLinkRazaoSocial.NavigateUrl = "javascript:window.parent.TabAuditoria('J','" + denuncia.Cnpj + "');";
                }

                LabelData.Text     = denuncia.DataDenuncia.ToString("dd/MM/yyyy hh:mm:ss");
                LabelSituacao.Text = denuncia.DesSituacao;
                LabelTexto.Text    = denuncia.Texto;
                LabelUsuario.Text  = denuncia.UsuarioDenuncia;

                if (denuncia.IdDenuncia > 0)
                {
                    Comentarios comentarios = new Comentarios();
                    comentarios.Carrega(GridViewComentarios, denuncia.IdDenuncia);

                    Anexos anexo = new Anexos();
                    anexo.Carrega(GridViewAnexo, denuncia.IdDenuncia);

                    AcompanhaDenuncias acompanha = new AcompanhaDenuncias();
                    acompanha.FornecedorParlamentares(GridViewDeputados, denuncia.Cnpj);
                }

                if (mRevisor)
                {
                    DropDownListSituacao.Visible = true;
                    DropDownListSituacao.Items.Add(new ListItem(Denuncia.TXT_SITUACAO_AGUARDANDO_REVISAO, Denuncia.SITUACAO_AGUARDANDO_REVISAO));
                    DropDownListSituacao.Items.Add(new ListItem(Denuncia.TXT_SITUACAO_PENDENTE_INFORMACOES, Denuncia.SITUACAO_PENDENTE_INFORMACOES));
                    DropDownListSituacao.Items.Add(new ListItem(Denuncia.TXT_SITUACAO_CASO_DUVIDOSO, Denuncia.SITUACAO_CASO_DUVIDOSO));
                    DropDownListSituacao.Items.Add(new ListItem(Denuncia.TXT_SITUACAO_CASO_DOSSIE, Denuncia.SITUACAO_CASO_DOSSIE));
                    DropDownListSituacao.Items.Add(new ListItem(Denuncia.TXT_SITUACAO_CASO_REPETIDO, Denuncia.SITUACAO_CASO_REPETIDO));
                    DropDownListSituacao.Items.Add(new ListItem(Denuncia.TXT_SITUACAO_NAO_PROCEDE, Denuncia.SITUACAO_NAO_PROCEDE));
                    DropDownListSituacao.SelectedValue = denuncia.Situacao;

                    GridViewDenuncias.EmptyDataText = "Este fornecedor ainda não possui denuncias.";
                    denuncia.DenunciasFornecedor(GridViewDenuncias);

                    if (denuncia.PendenteFoto == 1)
                    {
                        ButtonFotoExcluir.Visible = true;
                        ButtonFotoIncluir.Visible = false;
                    }
                    else
                    {
                        ButtonFotoExcluir.Visible = false;
                        ButtonFotoIncluir.Visible = true;
                    }
                }
                else
                {
                    DropDownListSituacao.Visible = false;
                    dvOutrasDenuncias.Visible    = false;
                    ButtonFotoExcluir.Visible    = false;
                    ButtonFotoIncluir.Visible    = false;
                }

                if (mRetornoClose == "close")
                {
                    ButtonVoltar.OnClientClick = "javaScript:window.parent.closeTab();";
                }

                ButtonListarDocumentos.OnClientClick = "window.parent.addTabDocumentos('" + denuncia.Cnpj + "','" + denuncia.RazaoSocial + "');return false;";
            }
        }