Пример #1
0
 /// <summary>
 /// Modifica en la BD una noticia existente
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnModificarNoticia_Click(object sender, EventArgs e)
 {
     try
     {
         gestorNoticia.modificarNoticia(gestorNoticia.noticia.idNoticia, txtTituloNoticia.Value, txtDescripcionNoticia.Text, ddlCategoriaNoticia.SelectedValue);
         limpiarCamposNoticias();
         cargarRepeaterNoticias();
         gestorNoticia.noticia = null;
         //lo manda a la solapa de agregar una noticia
         btnRegistrarNoticia.Visible            = true;
         btnModificarNoticia.Visible            = false;
         btnCancelarModificacionNoticia.Visible = false;
         GestorError.mostrarPanelExito("Se modificó exitosamente la noticia");
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarNoticia');", true);
     }
     catch (Exception ex) { mostrarPanelFracaso(ex.Message); }
 }
Пример #2
0
 /// <summary>
 /// Registra en la BD una nueva noticia
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnRegistrarNoticia_Click(object sender, EventArgs e)
 {
     try
     {
         gestorNoticia.registrarNoticia(txtTituloNoticia.Value, txtDescripcionNoticia.Text, gestorEdicion.edicion.idEdicion.ToString(), ddlCategoriaNoticia.SelectedValue);
         GestorImagen.guardarImagen(gestorNoticia.noticia.idNoticia, GestorImagen.NOTICIA);
         limpiarCamposNoticias();
         cargarRepeaterNoticias();
         GestorError.mostrarPanelExito("Se registró exitosamente la noticia");
         gestorNoticia.noticia = null; // le setea null a la noticia
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarNoticia');", true);
     }
     catch (Exception ex)
     {
         mostrarPanelFracaso(ex.Message);
     }
 }
Пример #3
0
 /// <summary>
 /// Habilita el panel de exito, y muestra el mensaje.
 /// autor: Facu Allemand
 /// </summary>
 private void mostrarPanelExito(string mensaje)
 {
     GestorError.mostrarPanelExito(mensaje);
 }