Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated || !System.Web.HttpContext.Current.User.IsInRole("NOTICIA"))
            {
                plhInserir.Visible = false;
            }

            if (!IsPostBack)
            {
                Noticia noticia = new Noticia();
                noticia.CarregaNoticias(rptNoticia);

                if (rptNoticia.Items.Count == 0)
                {
                    rptNoticia.Visible = false;
                    plhInfo.Visible    = true;
                    lblInfo.Text       = "Nenhuma notícia foi incluída";
                }
                else
                {
                    rptNoticia.Visible = true;
                    plhInfo.Visible    = false;
                }
            }
        }