Exemple #1
0
        public ActionResult PesquisarColuna(int?pagina, int?CodigoColunista)
        {
            ConteudoFacade   conteudoFacade   = new ConteudoFacade();
            MultimidiaFacade multimidiaFacade = new MultimidiaFacade();
            UsuarioFacade    usuarioFacade    = new UsuarioFacade();

            UsuarioFacade facade = new UsuarioFacade();

            if (!pagina.HasValue)
            {
                pagina = 1;
            }
            else if (pagina < 1)
            {
                pagina = 1;
            }

            if (!CodigoColunista.HasValue)
            {
                CodigoColunista = 0;
            }

            ViewBag.Usuarios = usuarioFacade.PesquisarColunista();

            ViewBag.CodigoColunista = 0;

            int[] Codigos = new int[0];

            foreach (Usuario usuario in (IList <Usuario>)ViewBag.Usuarios)
            {
                if (usuario.Codigo == CodigoColunista)
                {
                    Codigos    = new int[1];
                    Codigos[0] = usuario.Codigo;

                    ViewBag.CodigoColunista = usuario.Codigo;
                }
            }

            IList <Coluna> colunas = conteudoFacade.PesquisarColuna(null, Utilitario.Constante.TamanhoMaterias, pagina.Value, false, Codigos);

            colunas = (from a in colunas
                       where a.Data <= DateTime.Now
                       select a).ToList <Coluna>();

            ViewBag.TotalMaterias = conteudoFacade.PesquisarColuna(null, 0, 0, false, Codigos).Count;
            ViewBag.Pagina        = pagina;

            this.RegistrarBannerInternas();

            return(View(colunas));
        }
Exemple #2
0
        public ActionResult PesquisarColunista()
        {
            ConteudoFacade   conteudoFacade   = new ConteudoFacade();
            MultimidiaFacade multimidiaFacade = new MultimidiaFacade();
            UsuarioFacade    usuarioFacade    = new UsuarioFacade();

            Usuario usuario = new Usuario()
            {
                Perfil = new Perfil()
                {
                    Codigo = 3
                }
            };

            IList <Usuario> colunistas = usuarioFacade.PesquisarColunista();

            this.RegistrarBannerInternas();

            return(View(colunistas));
        }
Exemple #3
0
        public ActionResult PesquisarColuna(int?pagina)
        {
            ConteudoFacade   conteudoFacade   = new ConteudoFacade();
            MultimidiaFacade multimidiaFacade = new MultimidiaFacade();
            UsuarioFacade    usuarioFacade    = new UsuarioFacade();

            UsuarioFacade facade = new UsuarioFacade();

            //ViewBag.Codigo = Codigo;

            if (!pagina.HasValue)
            {
                pagina = 1;
            }
            else if (pagina < 1)
            {
                pagina = 1;
            }

            ViewBag.CodigoColunista = 0;

            ViewBag.Usuarios = usuarioFacade.PesquisarColunista();

            IList <Coluna> colunas = conteudoFacade.PesquisarColuna(null, Utilitario.Constante.TamanhoMaterias, pagina.Value, false);

            colunas = (from a in colunas
                       where a.Data <= DateTime.Now
                       select a).ToList <Coluna>();

            ViewBag.TotalMaterias = conteudoFacade.PesquisarColuna(null).Count;
            ViewBag.Pagina        = pagina;

            this.RegistrarBannerInternas();

            return(View(colunas));
        }