Example #1
0
        private DestaqueComTags GetDestaquesComtags(Section section, Home home, ref List <int> notInList)
        {
            if (!section.Editorialid.HasValue)
            {
                return(null);
            }

            var objEditorial = Editorial.Load(section.Editorialid.Value);

            var lstHighlights = Noticia.GetBySection(5, section, (home.Status || Section.SuaRegiao.Id == section.Id) ? home.Id : 1, ref notInList, true).ToList();

            var objDestaqueComTags = new DestaqueComTags
            {
                Key           = section.Key,
                Theme         = section.Theme,
                Titulo        = section.Desc,
                LinkTitulo    = section.Url,
                LinkImgTitulo = objEditorial.IconUrl,
                Highlights    = lstHighlights,
                Tags          = NoticiaSrv.GetTagsBySection(section.Id, home.Id).ToList(),
                isLazy        = !(section.Id == 1) //1 = sua região
            };

            return(objDestaqueComTags);
        }
        //[OutputCache(Duration = 60, VaryByCustom = "Location", VaryByParam = "*", Location = OutputCacheLocation.ServerAndClient)]
        public ActionResult CotacoesProduto(string tipo, string cidade, string produto)
        {
            var model = new HomeIndex();

            /* base model defaults */
            model.Title       = "Cotações de Arroz - Negócios da Terra";
            model.Description = "Confira as cotações de Arroz no Paraná e Santa Catarina - Negócios da Terra";
            model.Robots      = "index, follow";
            model.Canonical   = $"{Constants.UrlWeb}/cotacoes/arroz";

            //Set viewbag's
            ViewBag.Pagina        = "cotacoes-produto";
            ViewBag.ActiveNav     = "Negócios da Terra";
            ViewBag.Editorial     = Editorial.Load(EditorialEnum.NegociosDaTerra.GetHashCode());
            ViewBag.ExibirLogo    = true;
            ViewBag.LinkActiveNav = "/negocios-da-terra";

            //return the model to the view
            return(View(model));
        }
        //[OutputCache(Duration = 60, VaryByCustom = "Location", VaryByParam = "*", Location = OutputCacheLocation.ServerAndClient)]
        public ActionResult CotacoesCepeaUSP()
        {
            var model = new HomeIndex();

            /* base model defaults */
            model.Title       = "Cotações CEPEA USP - Negócios da Terra";
            model.Description = "Confira as cotações CEPEA USP - Negócios da Terra";
            model.Robots      = "index, follow";
            model.Canonical   = $"{Constants.UrlWeb}/cotacoes/cepea-usp";

            //Set viewbag's
            ViewBag.Pagina        = "cotacoes-cepea-usp";
            ViewBag.ActiveNav     = "Negócios da Terra";
            ViewBag.Editorial     = Editorial.Load(EditorialEnum.NegociosDaTerra.GetHashCode());
            ViewBag.ExibirLogo    = true;
            ViewBag.LinkActiveNav = "/negocios-da-terra";

            //return the model to the view
            return(View(model));
        }
        //[OutputCache(Duration = 60, VaryByCustom = "Location", VaryByParam = "*", Location = OutputCacheLocation.ServerAndClient)]
        public ActionResult Cotacoes(string tipo)
        {
            //var objCotacaoTipo = GetCotacaoTipoBySlug(tipo);

            var model = new CotacoesViewModel();

            /* base model defaults */
            model.Title       = "Cotações em " + tipo + " - Negócios da Terra";
            model.Description = "Confira as cotações " + tipo + " - Negócios da Terra";
            model.Robots      = "index, follow";
            model.Canonical   = $"{Constants.UrlWeb}/cotacoes/" + tipo + "";

            //Set viewbag's
            ViewBag.Pagina        = "cotacoes-cidade";
            ViewBag.ActiveNav     = "Negócios da Terra";
            ViewBag.Editorial     = Editorial.Load(EditorialEnum.NegociosDaTerra.GetHashCode());
            ViewBag.ExibirLogo    = true;
            ViewBag.LinkActiveNav = "/negocios-da-terra";

            //return the model to the view
            return(View(model));
        }