protected void Page_Load(object sender, EventArgs e) { if (Session["user_cve"] != null && (Convert.ToInt16(Session["rol"]) == 1 || Convert.ToInt16(Session["rol"]) == 2)) { if (Request.QueryString["n"] != null) { folio = Convert.ToInt32(Request.QueryString["n"]); if (!IsPostBack) { WebAppIntranetConsultaNoticias_Result noticia = logica.ConsultaNoticias(folio, 1, 2).FirstOrDefault(); if (noticia != null) { txtTitulo.Text = noticia.titulo; txtResumen.Text = noticia.resumen; CKEditor1.Text = noticia.noticia; imagen = noticia.imagenUrl; } else { Response.Redirect("Inicio.aspx"); } } } else { Response.Redirect("Inicio.aspx"); } } else { Response.Redirect("Inicio.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["n"] != null) { int folio = Convert.ToInt32(Request.QueryString["n"]); if (!IsPostBack) { WebAppIntranetConsultaNoticias_Result noticia = logica.ConsultaNoticias(folio, 1, 2).FirstOrDefault(); if (noticia != null) { lblTitulo.Text = noticia.titulo; if (noticia.imagenUrl != null && noticia.imagenUrl != "") { Image1.Visible = true; Image1.ImageUrl = "~/Media/Mini/" + noticia.imagenUrl; } else { Image1.Visible = divImagen.Visible = divVacio.Visible = false; } Literal1.Text = noticia.noticia; fol = noticia.num_folio.ToString(); short opc = 0; if (Convert.ToInt16(Session["rol"]) == 0) { opc = 1; } else { opc = 3; } ListaComentarios.DataSource = logica.ConsultaComentarios(0, folio, opc); ListaComentarios.DataBind(); if (Session["user_cve"] != null) { txtUsuarioComentario.Text = logica.nombreUsuario(Session["user_cve"].ToString()); } } else { Response.Redirect("Inicio.aspx"); } } } else { Response.Redirect("Inicio.aspx"); } }