示例#1
0
        //private void getTemperature(int locationId)
        //{
        //  var objCidade = LocalSrv.GetCidadeByIdCached(locationId);

        //  var obj = WeatherSrv.GetWeather(objCidade.Id);

        //  ViewBag.City = obj == null ? string.Empty : obj.City ?? string.Empty;
        //  ViewBag.Description = obj == null ? string.Empty : obj.Description ?? string.Empty;
        //  ViewBag.Icon = obj == null ? string.Empty : obj.Icon ?? string.Empty;
        //  ViewBag.Temperature = obj == null ? string.Empty : obj.Temperature == 0 ? string.Empty : obj.Temperature.ToString();
        //}

        private DestaqueVideoViewModel GetRegionHighlights(int microregionId)
        {
            var objModel = new DestaqueVideoViewModel
            {
                Url      = "noticias",
                Titulo   = "Notícias",
                Sections = new List <DestaqueVideoViewModel.VideoSection>()
            };

            var lstMicroregions = Microregiao.GetAllByStatus(true);

            foreach (var microregion in lstMicroregions)
            {
                var section = new DestaqueVideoViewModel.VideoSection
                {
                    Url        = microregion.Url,
                    Title      = microregion.Nome,
                    Videos     = NoticiaSrv.GetLastestVideoNewsByMicroregion(4, microregion.Id).Select(VideoModel.Map),
                    ButtonText = "Ver mais",
                    ButtonUrl  = $"/videos/{microregion.Url}",
                    Selected   = microregionId == microregion.Id
                };

                objModel.Sections.Add(section);
            }

            if (objModel.Sections.All(s => !s.Selected))
            {
                objModel.Sections.First().Selected = true;
            }

            return(objModel);
        }
示例#2
0
        private DestaqueVideoViewModel GetVideoHighlights(Cidade objCidade, ref List <int> notInList)
        {
            var sectionDestaque = new DestaqueVideoViewModel.VideoSection
            {
                Url        = "destaques",
                Title      = "Destaques",
                Selected   = true,
                Videos     = Service.Models.Noticia.GetBySection(4, Section.Videos, 1, ref notInList, true).Take(4).Select(VideoModel.Map),
                ButtonText = "Ver todos os vídeos",
                ButtonUrl  = "/videos"
            };

            var sectionMicroregion = new DestaqueVideoViewModel.VideoSection
            {
                Url        = objCidade.Url,
                Title      = objCidade.Microregion.Nome,
                Videos     = NoticiaSrv.GetLastestVideoNewsByMicroregion(4, objCidade.MicroregiaoId).Select(VideoModel.Map),
                ButtonText = "Ver todos os vídeos",
                ButtonUrl  = "/videos"
            };

            var sectionEsportes = new DestaqueVideoViewModel.VideoSection
            {
                Url        = "esportes",
                Title      = "Esportes",
                Videos     = NoticiaSrv.GetLastestVideoNewsByEditory(4, EditorialEnum.Esportes.GetHashCode()).Select(VideoModel.Map),
                ButtonText = "Ver todos os vídeos",
                ButtonUrl  = "/videos"
            };

            var sectionEntretenimento = new DestaqueVideoViewModel.VideoSection
            {
                Url        = "entretenimento",
                Title      = "Entretenimento",
                Videos     = NoticiaSrv.GetLastestVideoNewsByEditory(4, EditorialEnum.Entretenimento.GetHashCode()).Select(VideoModel.Map),
                ButtonText = "Ver todos os vídeos",
                ButtonUrl  = "/videos"
            };

            var sectionDescobrindoCuritiba = new DestaqueVideoViewModel.VideoSection
            {
                Url        = "descobrindo-curitiba",
                Title      = "Descobrindo Curitiba",
                Videos     = NoticiaSrv.GetLastestVideoNewsByTag(4, 754).Select(VideoModel.Map),
                ButtonText = "Ver todos os vídeos",
                ButtonUrl  = "/videos"
            };

            var objModel = new DestaqueVideoViewModel
            {
                Titulo   = "Vídeos",
                Sections = { sectionDestaque, sectionMicroregion, sectionEsportes, sectionEntretenimento, sectionDescobrindoCuritiba }
            };

            return(objModel);
        }
示例#3
0
        private DestaqueVideoViewModel GetDescobrindoCuritibaHighlights()
        {
            var section = new DestaqueVideoViewModel.VideoSection
            {
                Selected   = true,
                Url        = "descobrindo-curitiba",
                Title      = "Descobrindo Curitiba",
                Videos     = NoticiaSrv.GetLastestVideoNewsByTag(4, 754).Select(VideoModel.Map),
                ButtonText = "Ver mais",
                ButtonUrl  = "/videos/descobrindo-curitiba"
            };
            var objModel = new DestaqueVideoViewModel
            {
                Url      = "descobrindo-curitiba",
                Titulo   = "Descobrindo Curitiba",
                Sections = { section }
            };

            return(objModel);
        }
示例#4
0
        private DestaqueVideoViewModel GetBlogHighlights()
        {
            var section = new DestaqueVideoViewModel.VideoSection
            {
                Selected   = true,
                Url        = "blogs",
                Title      = "Blogs",
                Videos     = NoticiaSrv.GetLastestVideoNewsByEditory(4, EditorialEnum.Blogs.GetHashCode()).Select(VideoModel.Map),
                ButtonText = "Ver mais",
                ButtonUrl  = "/videos/blogs"
            };

            var objModel = new DestaqueVideoViewModel
            {
                Url      = "blogs",
                Titulo   = "Blogs",
                Sections = { section }
            };

            return(objModel);
        }
示例#5
0
        private DestaqueVideoViewModel GetNegociosDaTerraHighlights()
        {
            var section = new DestaqueVideoViewModel.VideoSection
            {
                Selected   = true,
                Url        = "negocios-da-terra",
                Title      = "Negócios da Terra",
                Videos     = NoticiaSrv.GetLastestVideoNewsByEditory(4, EditorialEnum.NegociosDaTerra.GetHashCode()).Select(VideoModel.Map),
                ButtonText = "Ver mais",
                ButtonUrl  = "/videos/negocios-da-terra"
            };

            var objModel = new DestaqueVideoViewModel
            {
                Url      = "negocios-da-terra",
                Titulo   = "Negócios da Terra",
                Sections = { section }
            };

            return(objModel);
        }
示例#6
0
        public ActionResult EducacaoFinanceira(int p = 1)
        {
            //get the tag
            var tagUrl = "educacao-financeira";

            //get the tag
            var objTag = Tag.GetByUrl(tagUrl);

            //Init the model
            var model = new LandViewModel()
            {
                Title        = "Educação Financeira - Massa News",
                Description  = "Educação Financeira. Realização: Sicredi",
                Robots       = "index, follow",
                Canonical    = $"{Constants.UrlWeb}/educacao-financeira",
                ImgOpenGraph = $"{Constants.UrlWeb}/content/images/landing/educacao-financeira/avatar.png"
            };

            //Set the news
            if (p == 1)
            {
                model.Highlights = objTag.GetLastestNews(p - 1, 5, null, true).ToList();
                model.NewsList   = objTag.GetNewsList(p - 1, 20, model.Highlights.Select(s => s.Id).ToList()).ToList();
            }
            else
            {
                model.Highlights = null;
                model.NewsList   = objTag.GetNewsList(p - 1, 20, null).ToList();
            }

            //Get the news count
            var nRowsCount = model.NewsList.Any() ? model.NewsList.First().Total : 0;

            //get the number of pages
            var pages = Convert.ToInt32(Math.Ceiling(((double)nRowsCount / 20)));

            //Add pagination if has more than one page
            if (pages > 1)
            {
                ViewBag.Paginacao = Pagination.AddPagination(p, Convert.ToInt32(pages), 5, true);
            }

            //Vídeos
            var sectionEducacaoFinanceira = new DestaqueVideoViewModel.VideoSection
            {
                Url        = "educacao-financeira",
                Title      = "educacao-financeira",
                Videos     = NoticiaSrv.GetLastestVideoNewsByTag(4, 794).Select(VideoModel.Map),
                ButtonText = "Ver todos os vídeos",
                ButtonUrl  = "/videos"
            };

            var objModel = new DestaqueVideoViewModel
            {
                Titulo   = "Vídeos",
                Url      = "https://www.youtube.com/playlist?list=PLIsicGjQ0iOvxJoseEwr3_66qxHOng4aq",
                Sections = { sectionEducacaoFinanceira }
            };

            model.DestaqueVideo = objModel;

            //Set viewbag's
            ViewBag.ActiveNav = "Educação Financeira";

            // Página
            ViewBag.Pagina = "educacao-financeira";

            //return the model to the view
            return(View(model));
        }
示例#7
0
        public ActionResult DesafiandoChefs(int p = 1)
        {
            //get the tag
            var tagUrl = "desafiando-chefs";

            //get the tag
            var objTag = Tag.GetByUrl(tagUrl);

            //Init the model
            var model = new LandViewModel()
            {
                Title        = "Desafiando Chefs - Temporada Damasco",
                Description  = "O Grupo Massa e a Damasco desafiam chefs renomados para um desafio de dar água na boca! Eles terão que provar suas habilidades fazendo receitas incríveis com uma condição, utilizar Café Damasco em uma websérie exclusiva e deliciosa!",
                Robots       = "index, follow",
                Canonical    = $"{Constants.UrlWeb}/desafiando-chefs",
                ImgOpenGraph = $"{Constants.UrlWeb}/content/images/landing/desafiando-chefs/avatar.png"
            };

            //Set the news
            if (p == 1)
            {
                model.Highlights = objTag.GetLastestNews(p - 1, 5, null, true).ToList();
                model.NewsList   = objTag.GetNewsList(p - 1, 20, model.Highlights.Select(s => s.Id).ToList()).ToList();
            }
            else
            {
                model.Highlights = null;
                model.NewsList   = objTag.GetNewsList(p - 1, 20, null).ToList();
            }

            //Get the news count
            var nRowsCount = model.NewsList.Any() ? model.NewsList.First().Total : 0;

            //get the number of pages
            var pages = Convert.ToInt32(Math.Ceiling(((double)nRowsCount / 20)));

            //Add pagination if has more than one page
            if (pages > 1)
            {
                ViewBag.Paginacao = Pagination.AddPagination(p, Convert.ToInt32(pages), 5, true);
            }

            //Vídeos
            var sectionDesafiandoChefs = new DestaqueVideoViewModel.VideoSection
            {
                Url        = "desafiando-chefs",
                Title      = "desafiando-chefs",
                Videos     = NoticiaSrv.GetLastestVideoNewsByTag(4, 759).Select(VideoModel.Map),
                ButtonText = "Ver todos os vídeos",
                ButtonUrl  = "/videos"
            };

            var objModel = new DestaqueVideoViewModel
            {
                Titulo   = "Vídeos",
                Sections = { sectionDesafiandoChefs }
            };

            model.DestaqueVideo = objModel;

            //Set viewbag's
            ViewBag.ActiveNav = "Desafiando Chefs";

            // Página
            ViewBag.Pagina = "desafiando-chefs";

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