public ActionResult FaleConosco() { var model = new HomeIndex(); ViewBag.ActiveNav = "Fale Conosco"; /* base model defaults */ model.Title = "Fale Conosco - Massa News"; model.Description = "Fale conosco para sugerir ideias, anunciar, enviar pautas, reportar erros ou trabalhar no Massa News."; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/institucional/fale-conosco"; return(View(model)); }
public ActionResult Index() { //Capsule db = new Capsule(); //db.Categories.ToList(); using (Capsule db = new Capsule()) { HomeIndex model = new HomeIndex(); model.BestSellingProducts = db.Products .OrderBy(p => p.ProductId) .Take(1) .ToList(); return(View(model)); } }
public ActionResult Sobre() { var model = new HomeIndex(); ViewBag.ActiveNav = "Sobre Nós"; /* base model defaults */ model.Title = "Sobre Nós - Massa News"; model.Description = "O Massa News é uma empresa de conteúdo e tecnologia do Grupo Massa, focada na produção e distribuição online de jornalismo local, com cobertura em todas as regiões do Paraná. Saiba mais!"; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/institucional/sobre"; return(View(model)); }
public ActionResult CalendarioCompeticoes() { var model = new HomeIndex(); ViewBag.ActiveNav = "Calendário de Competições"; /* base model defaults */ model.Title = "Calendário de competição dos Jogos Olímpicos de 2016 - Massa News"; model.Description = "Calendário de competição dos Jogos Olímpicos de 2016 no Massa News"; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/calendario-competicoes-jogos-olimpicos"; return(View(model)); }
public ActionResult Envie() { var model = new HomeIndex(); ViewBag.ActiveNav = "Envie sua Notícia"; /* base model defaults */ model.Title = "Envie sua Notícia - Massa News"; model.Description = "Envie sua Notícia para a redação do Massa News por e-mail, Whatsapp ou Facebook. Não esqueça de anexar fotos, áudios ou vídeos sobre o assunto."; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/institucional/envie-sua-noticia"; return(View(model)); }
public ActionResult CandidatosEleicoes() { var model = new HomeIndex(); ViewBag.ActiveNav = "Guia de Candidatos"; /* base model defaults */ model.Title = "Eleições Municipais 2016 - Candidaturas e Contas Eleitorais - Massa News"; model.Description = "Informações detalhadas sobre todos os candidatos que pediram registro à Justiça Eleitoral e sobre as suas contas eleitorais e as dos partidos políticos. Eleições Municipais 2016."; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/tags/eleicoes-2016/candidatos"; return(View(model)); }
public ActionResult CalendarioEleicoes() { var model = new HomeIndex(); ViewBag.ActiveNav = "Calendário"; /* base model defaults */ model.Title = "Calendário das Eleições Municipais 2016 - Massa News"; model.Description = "Acompanhe os eventos mais importantes das Eleições Municipais 2016."; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/tags/eleicoes-2016/calendario"; return(View(model)); }
public ActionResult ATochaOlimpica() { var model = new HomeIndex(); ViewBag.ActiveNav = "A Tocha Olímpica"; /* base model defaults */ model.Title = "Por dentro da tocha olímpica Rio 2016 - Massa News"; model.Description = "Tocha olímpica tem sistema inédito – pela primeira vez o famoso símbolo terá movimento para receber a chama."; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/tocha-olimpica"; return(View(model)); }
public ActionResult LegadoOlimpico() { var model = new HomeIndex(); ViewBag.ActiveNav = "Legado Olímpico"; /* base model defaults */ model.Title = "Rio 2016: O Legado Olímpico - Massa News"; model.Description = "omplexos esportivos em construção na Barra e Deodoro vão transformar a cidade após os Jogos de 2016, prometem organizadores e poder público. O Legado Olímpico!"; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/legado-olimpico"; return(View(model)); }
public ActionResult Cookies() { var model = new HomeIndex(); ViewBag.ActiveNav = "Política de Uso de Cookies"; /* base model defaults */ model.Title = "Política de Uso de Cookies - Massa News"; model.Description = "Cookies são pequenos arquivos de textos gerados pelo portal Massa News enquanto você o visita. Saiba mais!"; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/institucional/cookies"; return(View(model)); }
public ActionResult PlacarImpeachmentSenado() { var model = new HomeIndex(); ViewBag.ActiveNav = "Placar do Impeachment"; /* base model defaults */ model.Title = "Placar do Impeachment da presidente Dilma Rousseff no Senado - Massa News"; model.Description = "Intenções declaradas de voto dos senadores em relação à abertura de processo por crime de responsabilidade contra a presidente Dilma Rousseff."; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/placar-do-impeachment-senado"; model.ImgOpenGraph = $"{Constants.UrlWeb}/content/images/banners/avatar-placar-impeachment-senado.jpg"; return(View(model)); }
public async Task <IActionResult> Index(Form sendForm) { var model = new HomeIndex(); await _storage.UploadObjectAsync( _options.BucketName, _options.ObjectName, "text/plain", new MemoryStream(Encoding.UTF8.GetBytes(sendForm.Content))); model.Content = sendForm.Content; model.SavedNewContent = true; var storageObject = await _storage.GetObjectAsync(_options.BucketName, _options.ObjectName); model.MediaLink = storageObject.MediaLink; return(View(model)); }
public ActionResult PlacarImpeachment() { var model = new HomeIndex(); ViewBag.ActiveNav = "Placar do Impeachment"; /* base model defaults */ model.Title = "Placar do Impeachment da presidente Dilma Rousseff - Massa News"; model.Description = "Intenções declaradas de voto dos deputados federais no processo de impeachment da presidente Dilma Rousseff. A votação na Câmara está prevista para ocorrer no domingo (17)."; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/placar-do-impeachment"; model.ImgOpenGraph = $"{Constants.UrlWeb}/content/images/banners/avatar-placar-impeachment.jpg"; return(View(model)); }
public ActionResult Index() { BuscadorPrincipal bp = new BuscadorPrincipal(); if (Session["fechas"] != null) { bp = (BuscadorPrincipal)Session["fechas"]; } HomeIndex hi = new HomeIndex() { ListaVehiculos = db.Vehiculo.ToList(), busquedaPrincipal = bp }; return(View(hi)); }
public async Task <IActionResult> Index(SendForm sendForm) { var model = new HomeIndex(); if (string.IsNullOrEmpty(_sendgridApiKey) || "your-sendgrid-api-key" == _sendgridApiKey) { model.MissingApiKey = true; } else if (ModelState.IsValid && HttpContext.Request.Method.ToUpper() == "POST") { model.Recipient = sendForm.Recipient ?? ""; model.sendGridResponse = await CallSendGrid(sendForm.Recipient); } return(View(model)); }
public ActionResult Index() { ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; var viewModel = new HomeIndex(); viewModel.Boards = ThreadedCommentsContext.Boards .OrderBy(b => b.Name) .Take(10) .ToList() .Select(b => new HomeIndex.BoardInfo { BoardId = b.BoardId, Name = b.Name }) .ToList(); return(View(viewModel)); }
public ActionResult WhereAniversario() { //Redirect 301 to Home return(new RedirectResult("/", true)); var model = new HomeIndex(); ViewBag.ActiveNav = "Where 15 anos"; /* base model defaults */ model.Title = "Where Curitiba 15 anos - Massa News"; model.Description = "A Where Curitiba completa 15 anos de idade, e oferece 15 experiências incríveis para você. Participe!"; model.Robots = "index, follow"; model.Canonical = $"{Constants.UrlWeb}/aniversario"; return(View(model)); }
public IActionResult Create() { HomeIndex homeIndex = new HomeIndex() { Posts = new Posts(), CategoriesSelectList = _appDbContext.Categories.Select(item => new SelectListItem { Text = item.Title, Value = item.ToString() }), TagsSelectList = _appDbContext.Categories.Select(item => new SelectListItem { Text = item.Title, Value = item.ToString() }), }; return(View(homeIndex)); }
//[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)); }
public ActionResult Regulamento() { var model = new HomeIndex { Title = "Regulamento do Concurso Cultural Natal de Luz de Curitiba", Description = "Confira o Regulamento do Concurso Cultural Natal de Luz de Curitiba. Envie sua foto mostrando 'Qual é a casa/rua mais decorada de Curitiba para você?'. Participe!", Robots = "index, follow", Canonical = $"{Constants.UrlWeb}/natal-de-luz/regulamento", ImgOpenGraph = $"{Constants.UrlWeb}/content/images/landing/natal-de-luz/avatar.jpg" }; var promocao = Promocao.Load(2); ViewBag.ActiveNav = "Natal de Luz"; //ViewBag.Editorial = Editorial.Load(EditorialEnum.WhereCuritiba.GetHashCode()); //ViewBag.ExibirLogo = true; ViewBag.ConcursoAberto = promocao.Status; 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)); }
public ActionResult QuizUnifil() { //Redirect 301 to Home //return new RedirectResult("/", true); //Create a model var model = new HomeIndex { Title = "Quiz UniFil – Descubra a sua profissão", Description = "Qual profissão combina com você? Responsa o Quiz e em poucos minutos você descobrirá. É rápido, fácil e grátis!", Robots = "index, follow", Canonical = $"{Constants.UrlWeb}/quiz-unifil", ImgOpenGraph = $"{Constants.UrlWeb}/content/images/quiz-unifil/avatar.jpg" }; ViewBag.Pagina = "quiz-unifil"; ViewBag.ActiveNav = "Quiz UniFil"; return(View(model)); }
public ActionResult Index(HomeIndex formData) { User user = Database.Session.Query <User>().SingleOrDefault(x => x.KullanıcıAdı.Equals(User.Identity.Name)); if (!ModelState.IsValid) { return(View(formData)); } var rapor = new Rapor() { RaporTarihi = DateTime.Now.ToString("yyyy/MM/dd").Substring(0, 10), KullanıcıId = user.KullanıcıId, RaporSaati = DateTime.Now.ToShortTimeString(), FirmaId = user.FirmaId }; SyncHatalar(formData.Konu, rapor.Hata); Database.Session.Save(rapor); Database.Session.Flush(); return(RedirectToAction("Index")); }
public ActionResult Premiacao() { //Redirect 301 to Home return(new RedirectResult("/", true)); var model = new HomeIndex { Title = "Premiação do Concurso Cultural Natal de Luz de Curitiba", Description = "Confira a Premiação do Concurso Cultural Natal de Luz de Curitiba. Envie sua foto mostrando 'Qual casa/rua mais decorada de Curitiba;'. Participe!", Robots = "index, follow", Canonical = $"{Constants.UrlWeb}/natal-de-luz/premiacao", ImgOpenGraph = $"{Constants.UrlWeb}/content/images/landing/natal-de-luz/avatar.jpg" }; int promocaoId = 2; var promocao = Promocao.Load(promocaoId); ViewBag.ActiveNav = "Natal de Luz"; //ViewBag.Editorial = Editorial.Load(EditorialEnum.WhereCuritiba.GetHashCode()); //ViewBag.ExibirLogo = true; ViewBag.ConcursoAberto = promocao.Status; return(View(model)); }
public async Task <IActionResult> Index() { var model = new HomeIndex(); // [END cloud_storage] if (new string[] { null, "", "your-google-bucket-name" } .Contains(_options.BucketName)) { model.MissingBucketName = true; return(View(model)); } // [START cloud_storage] try { // Get the storage object. var storageObject = await _storage.GetObjectAsync(_options.BucketName, _options.ObjectName); // Get a direct link to the storage object. model.MediaLink = storageObject.MediaLink; // Download the storage object. MemoryStream m = new MemoryStream(); await _storage.DownloadObjectAsync( _options.BucketName, _options.ObjectName, m); m.Seek(0, SeekOrigin.Begin); byte[] content = new byte[m.Length]; m.Read(content, 0, content.Length); model.Content = Encoding.UTF8.GetString(content); } catch (GoogleApiException e) when(e.HttpStatusCode == System.Net.HttpStatusCode.NotFound) { // Does not exist yet. No problem. } return(View(model)); }
public async Task <IActionResult> Index(Form sendForm) { var model = new HomeIndex(); model.Content = sendForm.Content; model.SavedNewContent = true; // Spanner connection string. string connectionString = $"Data Source=projects/{_options.ProjectId}/instances/{_options.InstanceId}" + $"/databases/{_options.DatabaseId}"; // Insert Player if PlayerID not present in sent form data. string playerId = ""; if (string.IsNullOrEmpty(sendForm.PlayerId)) { // Insert Player Code using (var connection = new SpannerConnection(connectionString)) { await connection.OpenAsync(); using (var tx = await connection.BeginTransactionAsync()) { using (var cmd = connection.CreateInsertCommand( "Players", new SpannerParameterCollection { { "PlayerId", SpannerDbType.String }, { "PlayerName", SpannerDbType.String }, { "PlanetDollars", SpannerDbType.Int64 } })) { cmd.Transaction = tx; playerId = Guid.NewGuid().ToString("N"); cmd.Parameters["PlayerId"].Value = playerId; cmd.Parameters["PlayerName"].Value = sendForm.Content; cmd.Parameters["PlanetDollars"].Value = 1000000; cmd.ExecuteNonQuery(); } await tx.CommitAsync(); } } model.PlayerId = playerId; } else { model.PlayerId = sendForm.PlayerId; playerId = sendForm.PlayerId; } // Submit transaction for Player purchase of 1 planet share. using (var connection = new SpannerConnection(connectionString)) { await connection.OpenAsync(); using (var transaction = await connection.BeginTransactionAsync()) { long planetId = 0; string planetName = ""; long sharesAvailable = 0; long costPerShare = 0; //string playerId = playerId; string playerName = ""; long planetDollars = 0; // Create statement to select a random planet var cmd = connection.CreateSelectCommand( "SELECT PlanetId, PlanetName, SharesAvailable, DIV(PlanetValue, SharesAvailable) as ShareCost " + "FROM (SELECT * FROM Planets TABLESAMPLE BERNOULLI (10 PERCENT)) " + "WHERE SharesAvailable > 0 LIMIT 1"); // Excecute the select query. using (var reader = await cmd.ExecuteReaderAsync()) { while (await reader.ReadAsync()) { // Read the planet's ID. planetId = reader.GetFieldValue <long>("PlanetId"); // Read the planet's Name. planetName = reader.GetFieldValue <string>("PlanetName"); // Read the planet's shares available. sharesAvailable = reader.GetFieldValue <long>("SharesAvailable"); // Read the planet's cost per share. costPerShare = reader.GetFieldValue <long>("ShareCost"); } } // Create statement to select player details. cmd = connection.CreateSelectCommand( "SELECT PlayerId, PlayerName, PlanetDollars FROM Players " + "WHERE PlayerId = @playerId", new SpannerParameterCollection { { "playerId", SpannerDbType.String } }); cmd.Parameters["playerId"].Value = playerId; using (var reader = await cmd.ExecuteReaderAsync()) { while (await reader.ReadAsync()) { playerId = reader.GetFieldValue <string>("PlayerId"); playerName = reader.GetFieldValue <string>("PlayerName"); planetDollars = reader.GetFieldValue <long>("PlanetDollars"); } } if (planetDollars >= costPerShare && planetId != 0) { // Subtract 1 from planet's shares available. using (cmd = connection.CreateUpdateCommand( "Planets", new SpannerParameterCollection { { "PlanetId", SpannerDbType.Int64 }, { "SharesAvailable", SpannerDbType.Int64 }, })) { cmd.Transaction = transaction; sharesAvailable--; cmd.Parameters["PlanetId"].Value = planetId; cmd.Parameters["SharesAvailable"].Value = sharesAvailable; await cmd.ExecuteNonQueryAsync(); } // Subtract cost per share from player's planet dollars. using (cmd = connection.CreateUpdateCommand( "Players", new SpannerParameterCollection { { "PlayerId", SpannerDbType.String }, { "PlanetDollars", SpannerDbType.Int64 }, })) { cmd.Transaction = transaction; planetDollars -= costPerShare; cmd.Parameters["PlayerId"].Value = playerId; cmd.Parameters["PlanetDollars"].Value = planetDollars; await cmd.ExecuteNonQueryAsync(); } // Insert record of transaction in Transactions table. using (cmd = connection.CreateInsertCommand( "Transactions", new SpannerParameterCollection { { "PlanetId", SpannerDbType.Int64 }, { "PlayerId", SpannerDbType.String }, { "TimeStamp", SpannerDbType.Timestamp }, { "Amount", SpannerDbType.Int64 } })) { cmd.Transaction = transaction; cmd.Parameters["PlanetId"].Value = planetId; cmd.Parameters["PlayerId"].Value = playerId; cmd.Parameters["TimeStamp"].Value = SpannerParameter.CommitTimestamp; cmd.Parameters["Amount"].Value = costPerShare; await cmd.ExecuteNonQueryAsync(); } await transaction.CommitAsync(); model.Status = $"1 Share of {planetName} sold to {playerName} " + $"for {costPerShare.ToString("N0")} Planet Dollars. " + $"{playerName} now has {planetDollars.ToString("N0")} Planet Dollars."; } else { if (planetId == 0) { model.Status = "Failed to acquire a valid Planet share. Please retry."; } else { // Player doesn't have enough Planet Dollars to purchase planet share model.Status = $"{planetDollars.ToString("N0")} Planet Dollars is not enough to purchase a share of {planetName}"; } } } } return(View(model)); }
public IActionResult Index() { var model = new HomeIndex(); return(View(model)); }
private void TransformViewsHomeHomeIndex(SmartAppInfo manifest) { var template = new HomeIndex(manifest); _writingService.WriteFile(Path.Combine(_context.BasePath, template.OutputPath), template.TransformText()); }
public void HomeIndex_Template_NullParameter_Test() { var template = new HomeIndex(null); Assert.Throws <NullReferenceException>(() => template.TransformText()); }
private HomeIndex GetHomeIndexModel(int locationId) { var cacheSrv = new RedisCacheService(); //Get the city var city = Cidade.Load(locationId); //Get the home object var objHome = city.Microregion.Home; #region GET CACHE //Set the const time value const int time = 1; //Set the cache key var key = $"Home:{objHome.Id}"; //Find in the cache for the model var objModel = cacheSrv.Get <HomeIndex>(key); //If model exists in cache return the object if (objModel != null) { return(objModel); } #endregion //Save the current home state var currentHome = objHome; //If Home is disabled load the main home if (!objHome.Status) { objHome = Home.Load(1); //Home Curitiba } //Get list of news highlights var lstHighlights = Noticia.GetHighlightNewsByHome(objHome.Id).ToList(); //Create initial negation list with hiloghts id's var notInList = lstHighlights.Select(s => s.Id).ToList(); objModel = new HomeIndex { //Base Title = "Massa News - A notícia em movimento!", Description = "O Massa News oferece a melhor cobertura jornalística do Paraná com notícias personalizadas da sua região.", Robots = "index, follow", Canonical = Constants.UrlWeb, //Model Cidade = Cidade.Load(12), //Curitiba //objCidade, SidebarHighlight = objHome.SidebarHighlight, TemplateId = objHome.Highlight.TemplateId, Highlights = lstHighlights }; //SUA REGIÃO //Este módulo recebe a cidade original objModel.DestaqueComTagsSuaRegiao = GetDestaquesComtags(Section.SuaRegiao, currentHome, ref notInList); //ESPORTES objModel.DestaqueComTagsEsportes = GetDestaquesComtags(Section.Esportes, currentHome, ref notInList); //ENTRETEDIMENTO objModel.DestaqueComTagsEntretedimento = GetDestaquesComtags(Section.Entretenimento, currentHome, ref notInList); //PARANÁ - TODOS OS PLANTÕES objModel.DestaqueComTagsParana = GetDestaquesComtags(Section.Parana, currentHome, ref notInList); //CATEGORIAS DESTAQUES objModel.CategoriasDestaquesModel = GetCategoriaDestaquesModel(objHome.Id, ref notInList); //VIAJAR É MASSA objModel.DestaqueComTagsViajarEMassa = GetDestaquesComtags(Section.ViajarEMassa, currentHome, ref notInList); //WHERE CURITIBA if (currentHome.Id == 1) { objModel.DestaqueComTagsWhereCuritiba = GetDestaquesComtags(Section.WhereCuritiba, currentHome, ref notInList); } //NEGÓCIOS DA TERRA objModel.DestaqueComTagsNegociosDaTerra = GetDestaquesComtags(Section.NegociosDaTerra, currentHome, ref notInList); //VIDEOS objModel.DestaqueVideo = GetVideoHighlights(city, ref notInList); //FOTOS (GALERIAS) objModel.HighlightsFotos = Noticia.GetBySection(8, Section.Fotos, 1, ref notInList, true).ToList(); //BLOGS objModel.Blogs = GetBlogListByMicroregion(currentHome.MicroregiaoId); #region ENQUETE var statusEnquete = EnqueteSrv.GetStatusEnquete(); switch (statusEnquete.Status) { case (int)EnqueteEnum.Estadual: objModel.ShowEnquete = true; objModel.EnqueteId = Constants.EnqueteRegionalId; break; case (int)EnqueteEnum.Regional: foreach (var item in statusEnquete.RegioesEnquetes.Where(item => objHome.MicroregiaoId == item.MicroregiaoId && item.Status)) { objModel.ShowEnquete = true; objModel.EnqueteId = item.EnqueteId; } break; default: objModel.ShowEnquete = false; break; } #endregion //Set the cache cacheSrv.Set(key, objModel, time); return(objModel); }