public ActionResult Index() { NoticiaBO bo = new NoticiaBO(); List<NoticiaEntidade> lst = bo.SelectAll().Where(p=>p.Tipo != 1).ToList(); ViewBag.Noticias = lst; return View(); }
public ActionResult Index() { NoticiaBO bo = new NoticiaBO(); List<NoticiaEntidade> lst = bo.SelectAll().Where(p => p.Tipo != 1).ToList(); ViewBag.Noticias = lst; MenuBO bom = new MenuBO(); List<MenuEntidade> ent = bom.SelectAll().ToList(); MenuDAO menuDAO = new MenuDAO(); ViewBag.Menus = menuDAO.Lista(); return View(); }
private void RemoverNoticia(DirectEventArgs e) { try { NoticiaVO noticia = new NoticiaBO().SelectById(e.ExtraParams["id"].ToInt32()); new NoticiaBO(noticia).DeleteUpdate(); LoadPagina(); } catch (Exception ex) { base.MostrarMensagem("Erro", "Erro ao tentar remover notícia.", ""); } }
private void CarregarBotoesPerfil() { MenuPaginaVO pagina = GetMenuPagina(UsuarioLogado.PerfilAcesso.MenuPaginas.ToList(), "GERENCIARMENSAGENS.ASPX"); if(pagina != null) { btnMensagensPerfil.Text += String.Format(" - {0}", UsuarioLogado.MensagensRecebidas.Count); btnMensagensPerfil.ToolTips[0].Html = UsuarioLogado.MensagensRecebidasNaoLidas.Count.ToString(); btnMensagensPerfil.Listeners.Click.Handler = "window.location = '" + pagina.Url + "'; "; } else { btnMensagensPerfil.Visible = false; } pagina = GetMenuPagina(UsuarioLogado.PerfilAcesso.MenuPaginas.ToList(), "VISUALIZARNOTICIAS.ASPX"); if(pagina != null) { List<NoticiaVO> lstNoticiasAtivas = new NoticiaBO().GetNoticias(UsuarioLogado.Noticias.ToList(), false, true, false); btnNoticiasPerfil.Text += String.Format(" - {0}", UsuarioLogado.Noticias.Count); btnNoticiasPerfil.ToolTips[0].Html = lstNoticiasAtivas.Count.ToString(); btnNoticiasPerfil.Listeners.Click.Handler = "window.location = '"+ pagina.Url+"'; "; } else { btnNoticiasPerfil.Visible = false; } pagina = GetMenuPagina(UsuarioLogado.PerfilAcesso.MenuPaginas.ToList(), "RESPONDERPESQUISASOPINIAO.ASPX"); if (pagina != null) { List<PesquisaOpiniaoVO> lstPesquisas = new PesquisaOpiniaoBO().GetPesquisas(UsuarioLogado.Pesquisas.ToList(), false, true, false); btnPesquisasPerfil.Text += String.Format(" - {0}", UsuarioLogado.Pesquisas.Count); btnPesquisasPerfil.ToolTips[0].Html = lstPesquisas.Count.ToString(); btnPesquisasPerfil.Listeners.Click.Handler = "window.location = '" + pagina.Url + "'; "; } else { btnPesquisasPerfil.Visible = false; } }
/// <summary> /// metodo que mostra as notificações de notícias /// </summary> private void AbrirNotificacoesNoticias() { MenuPaginaVO pagina = GetMenuPagina(UsuarioLogado.PerfilAcesso.MenuPaginas.ToList(), "VISUALIZARNOTICIAS.ASPX"); if (!MostrouLembretes && UsuarioLogado.Noticias.Count == 0) UsuarioLogado.Noticias = new NoticiaBO().Buscar(UsuarioLogado, true, true, true, null, null); List<NoticiaVO> lstNoticiasAtivas = new NoticiaBO().GetNoticias(UsuarioLogado.Noticias.ToList(), false, true, false); if (!MostrouLembretes && lstNoticiasAtivas.Count != 0 && pagina != null) { Notification.Show(new NotificationConfig { ID = "ntfNoticias", Title = "Notícias", Icon = pagina == null || pagina.Icone.IsNullOrEmpty() ? Icon.None : (Icon)Enum.Parse(typeof(Icon), pagina.Icone), AutoHide = false, Html = String.Format("<br/>{0} notícia(s).", lstNoticiasAtivas.Count) }); String script = "var ntfNoticias = document.getElementById(\"ntfNoticias\"); ntfNoticias.style.cursor = \"pointer\"; ntfNoticias.onclick = function(){ window.location = '" + pagina.Url + "'; };"; this.ResourceManager1.RegisterOnReadyScript(script); } }