private void CarregarTela()
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.Colegio);
            if (postagemExibicao.PostagemMeioUm != null)
            {
                if (postagemExibicao.PostagemMeioUm.Corpo.Length > 4000)
                {
                    lblArtigoUnico1.Text = postagemExibicao.PostagemMeioUm.Corpo.Substring(0, 4000);
                }
                else
                {
                    lblArtigoUnico1.Text = postagemExibicao.PostagemMeioUm.Corpo;
                }

                if (postagemExibicao.PostagemMeioUm.Titulo.Length > 40)
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo.Substring(0, 40);
                }
                else
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo;
                }
            }
        }
    }
        public PostagemExibicao Consultar(TipoPagina tipo)
        {
            PostagemExibicao resultado    = new PostagemExibicao();
            List <Postagem>  PostagemList = Consultar();

            #region Direita
            resultado.PostagemDireitaUm = (from p in PostagemList
                                           where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.DireitaUm &&
                                           p.Tipo == (int)TipoPostagem.Postagem
                                           select p).SingleOrDefault();
            resultado.PostagemDireitaTres = (from p in PostagemList
                                             where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.DireitaTres &&
                                             p.Tipo == (int)TipoPostagem.Postagem
                                             select p).SingleOrDefault();
            resultado.PostagemDireitaDois = (from p in PostagemList
                                             where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.DireitaDois &&
                                             p.Tipo == (int)TipoPostagem.Postagem
                                             select p).SingleOrDefault();
            #endregion

            #region Esquerda

            resultado.PostagemEsquerdaDois = (from p in PostagemList
                                              where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.EsquerdaDois &&
                                              p.Tipo == (int)TipoPostagem.Postagem
                                              select p).SingleOrDefault();
            resultado.PostagemEsquerdaTres = (from p in PostagemList
                                              where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.EsquerdaTres &&
                                              p.Tipo == (int)TipoPostagem.Postagem
                                              select p).SingleOrDefault();
            resultado.PostagemEsquerdaUm = (from p in PostagemList
                                            where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.EsquerdaUm &&
                                            p.Tipo == (int)TipoPostagem.Postagem
                                            select p).SingleOrDefault();

            #endregion

            #region Meio

            resultado.PostagemMeioDois = (from p in PostagemList
                                          where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.MeioDois &&
                                          p.Tipo == (int)TipoPostagem.Postagem
                                          select p).SingleOrDefault();
            resultado.PostagemMeioTres = (from p in PostagemList
                                          where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.MeioTres &&
                                          p.Tipo == (int)TipoPostagem.Postagem
                                          select p).SingleOrDefault();
            resultado.PostagemMeioUm = (from p in PostagemList
                                        where p.Pagina == (int)tipo && p.Local == (int)LocalPostagem.MeioUm &&
                                        p.Tipo == (int)TipoPostagem.Postagem
                                        select p).SingleOrDefault();

            #endregion
            return(resultado);
        }
        public List <PostagemExibicao> Consultar(List <Postagem> postagensLista)
        {
            List <PostagemExibicao> resultado = new List <PostagemExibicao>();
            List <Postagem>         postagens = postagensLista;


            bool             continua = true;
            PostagemExibicao postagemExibicao;

            if (postagens.Count > 0)
            {
                postagens.RemoveAt(0);
            }

            while (continua)
            {
                postagemExibicao = new PostagemExibicao();
                if (postagens.Count >= 3)
                {
                    postagemExibicao.PostagemMeioUm     = postagens[1];
                    postagemExibicao.PostagemDireitaUm  = postagens[2];
                    postagemExibicao.PostagemEsquerdaUm = postagens[0];


                    postagens.RemoveAt(2);
                    postagens.RemoveAt(1);
                    postagens.RemoveAt(0);

                    resultado.Add(postagemExibicao);
                }
                else if (postagens.Count == 2)
                {
                    postagemExibicao.PostagemMeioUm     = postagens[1];
                    postagemExibicao.PostagemEsquerdaUm = postagens[0];
                    postagens.RemoveAt(1);
                    postagens.RemoveAt(0);

                    resultado.Add(postagemExibicao);
                }
                else if (postagens.Count == 1)
                {
                    postagemExibicao.PostagemEsquerdaUm = postagens[0];
                    resultado.Add(postagemExibicao);
                    postagens.RemoveAt(0);
                }
                else
                {
                    continua = false;
                }
            }

            return(resultado);
        }
    private void CarregarTela()
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.InfraEstrutura);

            if (postagemExibicao.PostagemEsquerdaUm != null)
            {
                if (postagemExibicao.PostagemEsquerdaUm.ImagemI != null &&
                    postagemExibicao.PostagemEsquerdaUm.ImagemI.Length > 0)
                {
                    imgInfra1.Visible  = true;
                    imgInfra1.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemEsquerdaUm.ID;
                }
            }

            if (postagemExibicao.PostagemEsquerdaDois != null)
            {
                if (postagemExibicao.PostagemEsquerdaDois.ImagemI != null &&
                    postagemExibicao.PostagemEsquerdaDois.ImagemI.Length > 0)
                {
                    imgInfra2.Visible  = true;
                    imgInfra2.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemEsquerdaDois.ID;
                }
            }

            if (postagemExibicao.PostagemEsquerdaTres != null)
            {
                if (postagemExibicao.PostagemEsquerdaTres.ImagemI != null &&
                    postagemExibicao.PostagemEsquerdaTres.ImagemI.Length > 0)
                {
                    imgInfra3.Visible  = true;
                    imgInfra3.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemEsquerdaTres.ID;
                }
            }

            if (postagemExibicao.PostagemMeioUm != null)
            {
                if (postagemExibicao.PostagemMeioUm.ImagemI != null &&
                    postagemExibicao.PostagemMeioUm.ImagemI.Length > 0)
                {
                    imgInfra4.Visible  = true;
                    imgInfra4.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemMeioUm.ID;
                }
            }
        }
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.Historico);
            if (postagemExibicao.PostagemEsquerdaUm != null)
            {
                imgHistorico1.PostBackUrl = postagemExibicao.PostagemEsquerdaUm.LinkBotao;
            }

            if (postagemExibicao.PostagemEsquerdaDois != null)
            {
                imgHistorico2.PostBackUrl = postagemExibicao.PostagemEsquerdaDois.LinkBotao;
            }

            if (postagemExibicao.PostagemEsquerdaTres != null)
            {
                imgHistorico3.PostBackUrl = postagemExibicao.PostagemEsquerdaTres.LinkBotao;
            }
        }
    }
Exemple #6
0
    private void CarregarTela()
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.EducacaoInfantil);

            if (postagemExibicao.PostagemMeioUm != null)
            {
                if (postagemExibicao.PostagemMeioUm.Corpo.Length > 260)
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo.Substring(0, 260);
                }
                else
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo;
                }

                if (postagemExibicao.PostagemMeioUm.Titulo.Length > 20)
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo;
                }
            }

            if (postagemExibicao.PostagemMeioDois != null)
            {
                if (postagemExibicao.PostagemMeioDois.Corpo.Length > 260)
                {
                    lblTextoArtigoMeio2.Text = postagemExibicao.PostagemMeioDois.Corpo.Substring(0, 260);
                }
                else
                {
                    lblTextoArtigoMeio2.Text = postagemExibicao.PostagemMeioDois.Corpo;
                }
                if (postagemExibicao.PostagemMeioDois.Titulo.Length > 20)
                {
                    lblTituloMeio2.Text = postagemExibicao.PostagemMeioDois.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio2.Text = postagemExibicao.PostagemMeioDois.Titulo;
                }
            }

            if (postagemExibicao.PostagemMeioTres != null)
            {
                if (postagemExibicao.PostagemMeioTres.Corpo.Length > 265)
                {
                    lblTextoArtigoMeio3.Text = postagemExibicao.PostagemMeioTres.Corpo.Substring(0, 265);
                }
                else
                {
                    lblTextoArtigoMeio3.Text = postagemExibicao.PostagemMeioTres.Corpo;
                }
                if (postagemExibicao.PostagemMeioTres.Titulo.Length > 20)
                {
                    lblTituloMeio3.Text = postagemExibicao.PostagemMeioTres.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio3.Text = postagemExibicao.PostagemMeioTres.Titulo;
                }
            }

            if (postagemExibicao.PostagemDireitaUm != null)
            {
                if (postagemExibicao.PostagemDireitaUm.Corpo.Length > 790)
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo.Substring(0, 790);
                }
                else
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo;
                }
                if (postagemExibicao.PostagemDireitaUm.Titulo.Length > 20)
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo;
                }
            }
        }
    }
Exemple #7
0
    private void CarregarTela()
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.FundamentalI);

            if (postagemExibicao.PostagemMeioUm != null)
            {
                if (postagemExibicao.PostagemMeioUm.ImagemI != null &&
                    postagemExibicao.PostagemMeioUm.ImagemI.Length > 0)
                {
                    imgArtigo1Meio.Visible  = true;
                    imgArtigo1Meio.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemMeioUm.ID;
                }

                if (postagemExibicao.PostagemMeioUm.Corpo.Length > 90)
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo.Substring(0, 90);
                }
                else
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo;
                }
                lblTextoArtigoMeio1.Text = lblTextoArtigoMeio1.Text + " " + postagemExibicao.PostagemMeioUm.LerMais;


                if (postagemExibicao.PostagemMeioUm.Titulo.Length > 20)
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo;
                }
            }

            if (postagemExibicao.PostagemMeioDois != null)
            {
                if (postagemExibicao.PostagemMeioDois.ImagemI != null &&
                    postagemExibicao.PostagemMeioDois.ImagemI.Length > 0)
                {
                    imgArtigo2Meio.Visible  = true;
                    imgArtigo2Meio.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemMeioDois.ID;
                }

                if (postagemExibicao.PostagemMeioDois.Corpo.Length > 240)
                {
                    lblTextoArtigoMeio2.Text = postagemExibicao.PostagemMeioDois.Corpo.Substring(0, 240);
                }
                else
                {
                    lblTextoArtigoMeio2.Text = postagemExibicao.PostagemMeioDois.Corpo;
                }
                lblTextoArtigoMeio2.Text = lblTextoArtigoMeio2.Text + " " + postagemExibicao.PostagemMeioDois.LerMais;
            }

            if (postagemExibicao.PostagemDireitaUm != null)
            {
                if (postagemExibicao.PostagemDireitaUm.ImagemI != null &&
                    postagemExibicao.PostagemDireitaUm.ImagemI.Length > 0)
                {
                    imgArtigo1Direita.Visible  = true;
                    imgArtigo1Direita.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemDireitaUm.ID;
                }

                if (postagemExibicao.PostagemDireitaUm.Corpo.Length > 660)
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo.Substring(0, 660);
                }
                else
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo;
                }
                lblTextoArtigoDireita1.Text = lblTextoArtigoDireita1.Text + " " + postagemExibicao.PostagemDireitaUm.LerMais;


                if (postagemExibicao.PostagemDireitaUm.Titulo.Length > 20)
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo;
                }
            }
        }
    }
Exemple #8
0
    private void CarregarTela()
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.FundamentalI);

            if (postagemExibicao.PostagemMeioUm != null)
            {
                if (postagemExibicao.PostagemMeioUm.Corpo.Length > 115)
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo.Substring(0, 115);
                }
                else
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo;
                }

                if (postagemExibicao.PostagemMeioUm.Titulo.Length > 20)
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo;
                }
            }

            if (postagemExibicao.PostagemMeioDois != null)
            {
                if (postagemExibicao.PostagemMeioDois.Corpo.Length > 300)
                {
                    lblTextoArtigoMeio2.Text = postagemExibicao.PostagemMeioDois.Corpo.Substring(0, 300);
                }
                else
                {
                    lblTextoArtigoMeio2.Text = postagemExibicao.PostagemMeioDois.Corpo;
                }
            }

            if (postagemExibicao.PostagemDireitaUm != null)
            {
                if (postagemExibicao.PostagemDireitaUm.Corpo.Length > 675)
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo.Substring(0, 675);
                }
                else
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo;
                }
                if (postagemExibicao.PostagemDireitaUm.Titulo.Length > 20)
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo;
                }
            }
        }
    }
    private void CarregarTela()
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.Colegio);
            if (postagemExibicao.PostagemEsquerdaUm != null)
            {
                if (postagemExibicao.PostagemEsquerdaUm.Corpo.Length > 300)
                {
                    lblTextoArtigoEsquerda1.Text = postagemExibicao.PostagemEsquerdaUm.Corpo.Substring(0, 300);
                }
                else
                {
                    lblTextoArtigoEsquerda1.Text = postagemExibicao.PostagemEsquerdaUm.Corpo;
                }
                lblTextoArtigoEsquerda1.Text = lblTextoArtigoEsquerda1.Text + " " + postagemExibicao.PostagemEsquerdaUm.LerMais;

                if (postagemExibicao.PostagemEsquerdaUm.Titulo.Length > 20)
                {
                    lblTituloEsquerda1.Text = postagemExibicao.PostagemEsquerdaUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloEsquerda1.Text = postagemExibicao.PostagemEsquerdaUm.Titulo;
                }
            }

            if (postagemExibicao.PostagemEsquerdaDois != null)
            {
                if (postagemExibicao.PostagemEsquerdaDois.Corpo.Length > 220)
                {
                    lblTextoArtigoEsquerda2.Text = postagemExibicao.PostagemEsquerdaDois.Corpo.Substring(0, 220);
                }
                else
                {
                    lblTextoArtigoEsquerda2.Text = postagemExibicao.PostagemEsquerdaDois.Corpo;
                }
                lblTextoArtigoEsquerda2.Text = lblTextoArtigoEsquerda2.Text + " " + postagemExibicao.PostagemEsquerdaDois.LerMais;


                if (postagemExibicao.PostagemEsquerdaDois.Titulo.Length > 20)
                {
                    lblTituloEsquerda2.Text = postagemExibicao.PostagemEsquerdaDois.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloEsquerda2.Text = postagemExibicao.PostagemEsquerdaDois.Titulo;
                }
            }

            if (postagemExibicao.PostagemMeioUm != null)
            {
                if (postagemExibicao.PostagemMeioUm.ImagemI != null &&
                    postagemExibicao.PostagemMeioUm.ImagemI.Length > 0)
                {
                    imgArtigoMeio1.Visible  = true;
                    imgArtigoMeio1.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemMeioUm.ID;
                }
                else
                {
                    imgArtigoMeio1.Visible = false;
                }

                if (postagemExibicao.PostagemMeioUm.Corpo.Length > 440)
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo.Substring(0, 440);
                }
                else
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo;
                }
                lblTextoArtigoMeio1.Text = lblTextoArtigoMeio1.Text + " " + postagemExibicao.PostagemMeioUm.LerMais;


                if (postagemExibicao.PostagemMeioUm.Titulo.Length > 20)
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo;
                }
            }

            if (postagemExibicao.PostagemDireitaUm != null)
            {
                if (postagemExibicao.PostagemDireitaUm.ImagemI != null &&
                    postagemExibicao.PostagemDireitaUm.ImagemI.Length > 0)
                {
                    imgArtigoDireita1.Visible  = true;
                    imgArtigoDireita1.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemDireitaUm.ID;
                }
                else
                {
                    imgArtigoDireita1.Visible = false;
                }


                if (postagemExibicao.PostagemDireitaUm.Corpo.Length > 360)
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo.Substring(0, 360);
                }
                else
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo;
                }
                lblTextoArtigoDireita1.Text = lblTextoArtigoDireita1.Text + " " + postagemExibicao.PostagemDireitaUm.LerMais;

                if (postagemExibicao.PostagemDireitaUm.Titulo.Length > 20)
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo;
                }
            }
        }
    }
    private void CarregarTela()
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.EducacaoInfantil);

            if (postagemExibicao.PostagemMeioUm != null)
            {
                if (postagemExibicao.PostagemMeioUm.Corpo.Length > 230)
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo.Substring(0, 230);
                }
                else
                {
                    lblTextoArtigoMeio1.Text = postagemExibicao.PostagemMeioUm.Corpo;
                }
                lblTextoArtigoMeio1.Text = lblTextoArtigoMeio1.Text + " " + postagemExibicao.PostagemMeioUm.LerMais;


                if (postagemExibicao.PostagemMeioUm.Titulo.Length > 20)
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio1.Text = postagemExibicao.PostagemMeioUm.Titulo;
                }
            }

            if (postagemExibicao.PostagemMeioDois != null)
            {
                if (postagemExibicao.PostagemMeioDois.Corpo.Length > 220)
                {
                    lblTextoArtigoMeio2.Text = postagemExibicao.PostagemMeioDois.Corpo.Substring(0, 220);
                }
                else
                {
                    lblTextoArtigoMeio2.Text = postagemExibicao.PostagemMeioDois.Corpo;
                }
                lblTextoArtigoMeio2.Text = lblTextoArtigoMeio2.Text + " " + postagemExibicao.PostagemMeioDois.LerMais;


                if (postagemExibicao.PostagemMeioDois.Titulo.Length > 20)
                {
                    lblTituloMeio2.Text = postagemExibicao.PostagemMeioDois.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio2.Text = postagemExibicao.PostagemMeioDois.Titulo;
                }
            }

            if (postagemExibicao.PostagemMeioTres != null)
            {
                if (postagemExibicao.PostagemMeioTres.Corpo.Length > 225)
                {
                    lblTextoArtigoMeio3.Text = postagemExibicao.PostagemMeioTres.Corpo.Substring(0, 225);
                }
                else
                {
                    lblTextoArtigoMeio3.Text = postagemExibicao.PostagemMeioTres.Corpo;
                }
                lblTextoArtigoMeio3.Text = lblTextoArtigoMeio3.Text + " " + postagemExibicao.PostagemMeioTres.LerMais;


                if (postagemExibicao.PostagemMeioTres.Titulo.Length > 20)
                {
                    lblTituloMeio3.Text = postagemExibicao.PostagemMeioTres.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloMeio3.Text = postagemExibicao.PostagemMeioTres.Titulo;
                }
            }

            if (postagemExibicao.PostagemDireitaUm != null)
            {
                if (postagemExibicao.PostagemDireitaUm.ImagemI != null &&
                    postagemExibicao.PostagemDireitaUm.ImagemI.Length > 0)
                {
                    imgArtigoDireita1.Visible  = true;
                    imgArtigoDireita1.ImageUrl = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemDireitaUm.ID;
                }
                if (postagemExibicao.PostagemDireitaUm.Corpo.Length > 700)
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo.Substring(0, 700);
                }
                else
                {
                    lblTextoArtigoDireita1.Text = postagemExibicao.PostagemDireitaUm.Corpo;
                }
                lblTextoArtigoDireita1.Text = lblTextoArtigoDireita1.Text + " " + postagemExibicao.PostagemDireitaUm.LerMais;


                if (postagemExibicao.PostagemDireitaUm.Titulo.Length > 20)
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo.Substring(0, 20);
                }
                else
                {
                    lblTituloDireita1.Text = postagemExibicao.PostagemDireitaUm.Titulo;
                }
            }
        }
    }
Exemple #11
0
    private void CarregarTela()
    {
        IPostagemProcesso processo     = PostagemProcesso.Instance;
        List <Postagem>   PostagemList = processo.Consultar();

        if (PostagemList.Count > 0)
        {
            PostagemExibicao postagemExibicao = processo.Consultar(TipoPagina.Atividades);
            if (postagemExibicao.PostagemEsquerdaUm != null)
            {
                if (postagemExibicao.PostagemEsquerdaUm.Titulo.Length > 12)
                {
                    DescricaoImgAtv1.Text    = postagemExibicao.PostagemEsquerdaUm.Titulo.Substring(0, 12);
                    DescricaoImgAtv1.Visible = true;
                }
                else
                {
                    DescricaoImgAtv1.Text    = postagemExibicao.PostagemEsquerdaUm.Titulo;
                    DescricaoImgAtv1.Visible = true;
                }
                if (postagemExibicao.PostagemEsquerdaUm.ImagemI != null &&
                    postagemExibicao.PostagemEsquerdaUm.ImagemI.Length > 0)
                {
                    imbAtividade1.Visible     = true;
                    imbAtividade1.ImageUrl    = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemEsquerdaUm.ID;
                    imbAtividade1.PostBackUrl = postagemExibicao.PostagemEsquerdaUm.LinkBotao;
                }
            }

            if (postagemExibicao.PostagemEsquerdaDois != null)
            {
                if (postagemExibicao.PostagemEsquerdaDois.Titulo.Length > 12)
                {
                    DescricaoImgAtv2.Text    = postagemExibicao.PostagemEsquerdaDois.Titulo.Substring(0, 12);
                    DescricaoImgAtv2.Visible = true;
                }
                else
                {
                    DescricaoImgAtv2.Text    = postagemExibicao.PostagemEsquerdaDois.Titulo;
                    DescricaoImgAtv2.Visible = true;
                }
                if (postagemExibicao.PostagemEsquerdaDois.ImagemI != null &&
                    postagemExibicao.PostagemEsquerdaDois.ImagemI.Length > 0)
                {
                    imbAtividade2.Visible     = true;
                    imbAtividade2.ImageUrl    = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemEsquerdaDois.ID;
                    imbAtividade2.PostBackUrl = postagemExibicao.PostagemEsquerdaDois.LinkBotao;
                }
            }

            if (postagemExibicao.PostagemEsquerdaTres != null)
            {
                if (postagemExibicao.PostagemEsquerdaTres.Titulo.Length > 12)
                {
                    DescricaoImgAtv3.Text    = postagemExibicao.PostagemEsquerdaTres.Titulo.Substring(0, 12);
                    DescricaoImgAtv3.Visible = true;
                }
                else
                {
                    DescricaoImgAtv3.Text    = postagemExibicao.PostagemEsquerdaTres.Titulo;
                    DescricaoImgAtv3.Visible = true;
                }
                if (postagemExibicao.PostagemEsquerdaTres.ImagemI != null &&
                    postagemExibicao.PostagemEsquerdaTres.ImagemI.Length > 0)
                {
                    imbAtividade3.Visible     = true;
                    imbAtividade3.ImageUrl    = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemEsquerdaTres.ID;
                    imbAtividade3.PostBackUrl = postagemExibicao.PostagemEsquerdaTres.LinkBotao;
                }
            }

            if (postagemExibicao.PostagemMeioUm != null)
            {
                if (postagemExibicao.PostagemMeioUm.Titulo.Length > 12)
                {
                    DescricaoImgAtv4.Text    = postagemExibicao.PostagemMeioUm.Titulo.Substring(0, 12);
                    DescricaoImgAtv4.Visible = true;
                }
                else
                {
                    DescricaoImgAtv4.Text    = postagemExibicao.PostagemMeioUm.Titulo;
                    DescricaoImgAtv4.Visible = true;
                }
                if (postagemExibicao.PostagemMeioUm.ImagemI != null &&
                    postagemExibicao.PostagemMeioUm.ImagemI.Length > 0)
                {
                    imbAtividade4.Visible     = true;
                    imbAtividade4.ImageUrl    = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemMeioUm.ID;
                    imbAtividade4.PostBackUrl = postagemExibicao.PostagemMeioUm.LinkBotao;
                }
            }

            if (postagemExibicao.PostagemMeioDois != null)
            {
                if (postagemExibicao.PostagemMeioDois.Titulo.Length > 12)
                {
                    DescricaoImgAtv5.Text    = postagemExibicao.PostagemMeioDois.Titulo.Substring(0, 12);
                    DescricaoImgAtv5.Visible = true;
                }
                else
                {
                    DescricaoImgAtv5.Text    = postagemExibicao.PostagemMeioDois.Titulo;
                    DescricaoImgAtv5.Visible = true;
                }
                if (postagemExibicao.PostagemMeioDois.ImagemI != null &&
                    postagemExibicao.PostagemMeioDois.ImagemI.Length > 0)
                {
                    imbAtividade5.Visible     = true;
                    imbAtividade5.ImageUrl    = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemMeioDois.ID;
                    imbAtividade5.PostBackUrl = postagemExibicao.PostagemMeioDois.LinkBotao;
                }
            }

            if (postagemExibicao.PostagemMeioTres != null)
            {
                if (postagemExibicao.PostagemMeioTres.Titulo.Length > 12)
                {
                    DescricaoImgAtv6.Text    = postagemExibicao.PostagemMeioTres.Titulo.Substring(0, 12);
                    DescricaoImgAtv6.Visible = true;
                }
                else
                {
                    DescricaoImgAtv6.Text    = postagemExibicao.PostagemMeioTres.Titulo;
                    DescricaoImgAtv6.Visible = true;
                }
                if (postagemExibicao.PostagemMeioTres.ImagemI != null &&
                    postagemExibicao.PostagemMeioTres.ImagemI.Length > 0)
                {
                    imbAtividade6.Visible     = true;
                    imbAtividade6.ImageUrl    = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemMeioTres.ID;
                    imbAtividade6.PostBackUrl = postagemExibicao.PostagemMeioTres.LinkBotao;
                }
            }

            if (postagemExibicao.PostagemDireitaUm != null)
            {
                if (postagemExibicao.PostagemDireitaUm.Titulo.Length > 12)
                {
                    DescricaoImgAtv7.Text    = postagemExibicao.PostagemDireitaUm.Titulo.Substring(0, 12);
                    DescricaoImgAtv7.Visible = true;
                }
                else
                {
                    DescricaoImgAtv7.Text    = postagemExibicao.PostagemDireitaUm.Titulo;
                    DescricaoImgAtv7.Visible = true;
                }
                if (postagemExibicao.PostagemDireitaUm.ImagemI != null &&
                    postagemExibicao.PostagemDireitaUm.ImagemI.Length > 0)
                {
                    imbAtividade7.Visible     = true;
                    imbAtividade7.ImageUrl    = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemDireitaUm.ID;
                    imbAtividade7.PostBackUrl = postagemExibicao.PostagemDireitaUm.LinkBotao;
                }
            }

            if (postagemExibicao.PostagemDireitaDois != null)
            {
                if (postagemExibicao.PostagemDireitaDois.Titulo.Length > 12)
                {
                    DescricaoImgAtv8.Text    = postagemExibicao.PostagemDireitaDois.Titulo.Substring(0, 12);
                    DescricaoImgAtv8.Visible = true;
                }
                else
                {
                    DescricaoImgAtv8.Text    = postagemExibicao.PostagemDireitaDois.Titulo;
                    DescricaoImgAtv8.Visible = true;
                }
                if (postagemExibicao.PostagemDireitaDois.ImagemI != null &&
                    postagemExibicao.PostagemDireitaDois.ImagemI.Length > 0)
                {
                    imbAtividade8.Visible     = true;
                    imbAtividade8.ImageUrl    = "~/ModuloAuxiliar/Handler.ashx?postId=" + postagemExibicao.PostagemDireitaDois.ID;
                    imbAtividade8.PostBackUrl = postagemExibicao.PostagemDireitaDois.LinkBotao;
                }
            }
        }
    }