コード例 #1
0
        //[OutputCache(Duration = 60, VaryByCustom = "Location", VaryByParam = "*", Location = OutputCacheLocation.ServerAndClient)]
        public ActionResult Cotacoes(string tipo)
        {
            CotacaoTipo              objCotacaoTipo       = GetCotacaoTipoBySlug(tipo);
            List <Cotacao>           objCotacao           = GetCotacao(objCotacaoTipo.Id).ToList();
            List <CotacoesPorEstado> objCotacoesPorEstado = GetCotacoesPorEstadoWithCotacoes(objCotacao);

            var model = new CotacoesViewModel();

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

            //model page cotacao
            model.Tipo = objCotacaoTipo;
            if (tipo == "cepea-usp" || tipo == "cia-ufpr" || tipo == "lapsui")
            {
                model.Cotacoes = objCotacao;
            }
            if (tipo == "parana" || tipo == "santa-catarina")
            {
                model.CotacoesPorEstados = objCotacoesPorEstado;
                model.Cidades            = GetCotacaoCidades(tipo == "parana" ? 1 : 2).ToList();
            }

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

            return(View(model));
        }
コード例 #2
0
        //[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));
        }