public ActionResult Noticia_Detalhe(int id, string textoPesquisado = "") { var rn = new ZRN.NoticiasElastic.NoticiasElastic(Configuracoes.ServidorElastic, Configuracoes.IndexElastic); var rnempresas = new ZRN.Empresas.Empresas(); var view = new ViewModel.Empresa.EmpresaNoticiaDetalhe(); view.noticia = rn.RetornaNoticiaEmpresa(id, textoPesquisado); var idEmpresa = (from e in view.noticia.empresas where e.idnoticiaempresa == id select e.idempresa).FirstOrDefault(); view.empresa = rnempresas.RetornaDescricaoEmpresa(idEmpresa); ViewBag.idEmpresa = idEmpresa; ViewBag.LayoutTopo = "EmpresaNoticiaDetalhe"; //ViewBag.NomeEmpresa = view.noticia.empresas.FirstOrDefault().nomeempresa; //ViewBag.IdEmpresa = view.noticia.empresas.FirstOrDefault().idempresa; ViewBag.NomeEmpresa = view.noticia.empresas.Where(x => x.idempresa == idEmpresa).Select(x => x.nomeempresa).FirstOrDefault(); ViewBag.IdEmpresa = idEmpresa; return(View(view)); }
public ActionResult NoticiaDetalhesPromo(int idNoticia, int idPromo, int idEmpresa) { var rn = new ZRN.NoticiasElastic.NoticiasElastic(Configuracoes.ServidorElastic, Configuracoes.IndexElastic); var view = new ViewModel.Empresa.EmpresaNoticiaDetalhe(); var rnempresas = new ZRN.Empresas.Empresas(); view.noticia = rn.GetNoticiaPromocao(idNoticia); view.empresa = rnempresas.RetornaDescricaoEmpresa(idEmpresa); ViewBag.idEmpresa = idEmpresa; ViewBag.LayoutTopo = "PromoNoticiaDetalhe"; ViewBag.NomeEmpresa = view.empresa.nome; ViewBag.IdEmpresa = idEmpresa; ViewBag.IdPromocao = idPromo; return(View("Noticia_Detalhe", view)); }
public ActionResult NoticiaDetalhes(int id, int idPromo) { var rn = new ZRN.NoticiasElastic.NoticiasElastic(Configuracoes.ServidorElastic, Configuracoes.IndexElastic); var rnempresas = new ZRN.Empresas.Empresas(); var view = new ViewModel.Empresa.EmpresaNoticiaDetalhe(); view.noticia = rn.RetornaNoticiaEmpresa(id); var idEmpresa = (from e in view.noticia.empresas where e.idnoticiaempresa == id select e.idempresa).FirstOrDefault(); view.empresa = rnempresas.RetornaDescricaoEmpresa(idEmpresa); ViewBag.idEmpresa = idEmpresa; ViewBag.LayoutTopo = "PromoNoticiaDetalhe"; ViewBag.NomeEmpresa = view.noticia.empresas.FirstOrDefault().nomeempresa; ViewBag.IdEmpresa = view.noticia.empresas.FirstOrDefault().idempresa; ViewBag.IdPromocao = idPromo; return(View("Noticia_Detalhe", view)); }