protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (UsuarioLogado() == null) { Response.Redirect("~/Default.aspx", true); } if ((Request.QueryString["Sucesso"] == "1")) { ((Modulos_Modulos)Master).ExibirMensagem(Resources.Textos.Mensagem_Salva_Sucesso); } else if ((Request.QueryString["Sucesso"] == "2")) { ((Modulos_Modulos)Master).ExibirMensagem(Resources.Textos.Mensagem_Atualizado_Sucesso); } noticia = Convert.ToInt32(Request.QueryString["Noticia"]); hdnNoticiaId.Value = noticia.ToString(); this.IniciaTela(); CarregarObjetos(Utilitarios.TipoTransacao.Limpar); if (noticia > 0) { gobjNoticia = DOModNoticia.Obter(new Noticia() { ID = noticia }); CarregarObjetos(Utilitarios.TipoTransacao.Carregar, gobjNoticia); } } }
private void CarregarDadosHome(List <ModNoticia> objListModNoticia) { try { if (objListModNoticia.Count > 0) { foreach (ModNoticia mNoticia in objListModNoticia) { Noticia noticia = DOModNoticia.Obter(new Noticia() { ID = mNoticia.IdNoticia }); if (noticia.ID > 0) { switch (noticia.TipoNoticia.ID) { case ((int)(Utilitarios.TipoNoticia.Esquerdo)): lblTituloEsquerdo.Text = noticia.Titulo; lblResumoEsquerdo.Text = noticia.Resumo; break; case ((int)(Utilitarios.TipoNoticia.DireitoSuperior)): lblTituloDireitoSuperior.Text = noticia.Titulo; lblResumoDireitoSuperior.Text = noticia.Resumo; break; case ((int)(Utilitarios.TipoNoticia.DireitoCentral)): lblTituloDireitoCentral.Text = noticia.Titulo; lblResumoDireitoCentral.Text = noticia.Resumo; break; case ((int)(Utilitarios.TipoNoticia.DireitoInferior)): lblTituloDireitoInferior.Text = noticia.Titulo; lblResumoDireitoInferior.Text = noticia.Resumo; break; } } } divSemConteudo.Visible = false; divConteudo.Visible = true; } else { divSemConteudo.Visible = true; divConteudo.Visible = false; pnlNoticiaHome.Visible = false; pnlNoticiaInterna.Visible = false; } } catch (Exception ex) { throw ex; } }