/// <summary>
 /// modifica los datos de un campeonato (nombre, descripción o imagen)
 /// </summary>
 protected void btnModificarTorneo_Click(object sender, EventArgs e)
 {
     try
     {
         limpiarPaneles();
         gestorTorneo.modificarTorneo(txtNombreTorneo.Value, txtDescripcion.Value);
         GestorImagen.guardarImagen(gestorTorneo.torneo.idTorneo, GestorImagen.TORNEO);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "closeModal('modalTorneo');", true);
         cargarRepeaterTorneos();
         limpiarModalTorneo();
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal('modalTorneo');", true);
         GestorError.mostrarPanelFracaso(ex.Message);
     }
 }
 /// <summary>
 /// Registra un Nuevo Jugador en la BD
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnRegistrarJugador_Click(object sender, EventArgs e)
 {
     try
     {
         gestorJugador.registrarJugador(txtNombreJugador.Value, txtDni.Value, txtFechaNacimiento.Value, txtNumeroCamiseta.Value, txtTelefono.Value, txtEmail.Value, txtFacebook.Value, rdSexoMasculino.Checked, rdTieneFichaMedicaSi.Checked);
         GestorImagen.guardarImagen(gestorJugador.jugador.idJugador, GestorImagen.JUGADOR);
         limpiarCampos();
         cargarRepeaterJugadores();
         gestorJugador.jugador = null;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarEquipo');", true);
     }
     catch (Exception ex)
     {
         imagenpreview.Src = GestorImagen.obtenerImagenTemporal(GestorImagen.JUGADOR, GestorImagen.MEDIANA);
         mostrarPanelFracaso(ex.Message);
     }
 }
 /// <summary>
 /// Registra un nuevo torneo en la Base de datos
 /// autor: Antonio Herrera
 /// </summary>
 protected void btnResgitrarTorneo_Click(object sender, EventArgs e)
 {
     try
     {
         limpiarPaneles();
         int idTorneo = gestorTorneo.registrarTorneo(txtNombreTorneo.Value, txtDescripcion.Value, txtUrlTorneo.Value.Replace(" ", "-"));
         GestorImagen.guardarImagen(idTorneo, GestorImagen.TORNEO);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "closeModal('modalTorneo');", true);
         cargarRepeaterTorneos();
         limpiarModalTorneo();
     }
     catch (Exception ex)
     {
         imagenpreview.Src = GestorImagen.obtenerImagenTemporal(GestorImagen.TORNEO, GestorImagen.MEDIANA);
         GestorError.mostrarPanelFracaso(ex.Message);
     }
 }
Exemple #4
0
 /// <summary>
 /// Registra un nuevo equipo en la BD
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnRegistrarEquipo_Click(object sender, EventArgs e)
 {
     try
     {
         gestorEquipo.registrarEquipo(txtNombreEquipo.Value, txtColorPrimario.Value, txtColorSecundario.Value, txtNombreDirector.Value);
         GestorImagen.guardarImagen(gestorEquipo.equipo.idEquipo, GestorImagen.EQUIPO);
         limpiarCamposEquipo();
         cargarRepeaterEquipos();
         gestorEquipo.equipo = null; // le setea null al equipo
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarEquipo');", true);
     }
     catch (Exception ex)
     {
         imagenpreview.Src = GestorImagen.obtenerImagenTemporal(GestorImagen.EQUIPO, GestorImagen.MEDIANA);
         mostrarPanelFracaso(ex.Message);
     }
 }
 /// <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);
     }
 }
 /// <summary>
 /// Permite modificar en la BD un jugador
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnModificarJugador_Click(object sender, EventArgs e)
 {
     try
     {
         int idJugadorAModificar = gestorJugador.jugador.idJugador;
         gestorJugador.modificarJugador(idJugadorAModificar, txtNombreJugador.Value, txtDni.Value, txtFechaNacimiento.Value, txtNumeroCamiseta.Value, txtTelefono.Value, txtEmail.Value, txtFacebook.Value, rdSexoMasculino.Checked, rdTieneFichaMedicaSi.Checked);
         GestorImagen.guardarImagen(idJugadorAModificar, GestorImagen.JUGADOR);
         limpiarCampos();
         cargarRepeaterJugadores();
         gestorJugador.jugador = null; //le setea null al jugador
         //lo manda a la solapa de agregar un jugador
         btnRegistrarJugador.Visible            = true;
         btnModificarJugador.Visible            = false;
         btnCancelarModificacionJugador.Visible = false;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarEquipo');", true);
     }
     catch (Exception ex) { mostrarPanelFracaso(ex.Message); }
 }
 /// <summary>
 /// Permite modificar de la BD
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnModificarArbitro_Click(object sender, EventArgs e)
 {
     try
     {
         int idArbitroAModificar = gestorArbitro.arbitro.idArbitro;
         gestorArbitro.modificarArbitro(idArbitroAModificar, txtNombreArbitro.Value, txtCelular.Value, txtEmail.Value, txtMatricula.Value);
         GestorImagen.guardarImagen(idArbitroAModificar, GestorImagen.ARBITRO);
         limpiarCamposArbitros();
         cargarRepeaterArbitros();
         gestorArbitro.arbitro = null;
         //lo manda a la solapa de agregar un arbitro
         btnRegistrarArbitro.Visible            = true;
         btnModificarArbitro.Visible            = false;
         btnCancelarModificacionArbitro.Visible = false;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarArbitro');", true);
     }
     catch (Exception ex) { mostrarPanelFracaso(ex.Message); }
 }
 /// <summary>
 /// Permite Registrar un árbitro en la BD
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnRegistrarArbitro_Click(object sender, EventArgs e)
 {
     try
     {
         gestorArbitro.registrarArbitro(txtNombreArbitro.Value, txtCelular.Value, txtEmail.Value, txtMatricula.Value);
         GestorImagen.guardarImagen(gestorArbitro.arbitro.idArbitro, GestorImagen.ARBITRO);
         limpiarCamposArbitros();
         cargarRepeaterArbitros();
         gestorArbitro.arbitro = null; // le setea null al arbitro
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarArbitro');", true);
     }
     catch (Exception ex)
     {
         imagenpreview.Src = GestorImagen.obtenerImagenTemporal(GestorImagen.ARBITRO, GestorImagen.MEDIANA);
         mostrarPanelFracaso(ex.Message);
         txtNombreArbitro.Focus();
     }
 }
 /// <summary>
 /// Permite modificar una cancha
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnModificarCancha_Click(object sender, EventArgs e)
 {
     try
     {
         int idCanchaAModificar = gestorCancha.cancha.idCancha;
         gestorCancha.modificarCancha(idCanchaAModificar, txtNombreCancha.Value, txtDomicilio.Value, txtTelefono.Value);
         GestorImagen.guardarImagen(idCanchaAModificar, GestorImagen.COMPLEJO);
         limpiarCamposCancha();
         cargarRepeaterCanchas();
         gestorCancha.cancha = null; //le setea null a la cancha
         //lo manda a la solapa de agregar una cancha
         btnRegistrarCancha.Visible            = true;
         btnModificarCancha.Visible            = false;
         btnCancelarModificacionCancha.Visible = false;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarCancha');", true);
     }
     catch (Exception ex) { mostrarPanelFracaso(ex.Message); }
 }
 /// <summary>
 /// Permite Registrar una Nueva Cancha para un torneo
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnRegistrarCancha_Click(object sender, EventArgs e)
 {
     try
     {
         gestorCancha.registrarCancha(txtNombreCancha.Value, txtDomicilio.Value, txtTelefono.Value);
         GestorImagen.guardarImagen(gestorCancha.cancha.idCancha, GestorImagen.COMPLEJO);
         limpiarCamposCancha();
         cargarRepeaterCanchas();
         gestorCancha.cancha = null; // le setea null a la cancha
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarCancha');", true);
     }
     catch (Exception ex)
     {
         imagenpreview.Src = GestorImagen.obtenerImagenTemporal(GestorImagen.COMPLEJO, GestorImagen.MEDIANA);
         mostrarPanelFracaso(ex.Message);
         txtNombreCancha.Focus();
     }
 }
Exemple #11
0
 /// <summary>
 /// Modifica el equipo
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnModificarEquipo_Click(object sender, EventArgs e)
 {
     try
     {
         int idEquipoAModificar = gestorEquipo.equipo.idEquipo;
         gestorEquipo.modificarEquipo(idEquipoAModificar, txtNombreEquipo.Value, txtColorPrimario.Value, txtColorSecundario.Value, txtNombreDirector.Value);
         GestorImagen.guardarImagen(gestorEquipo.equipo.idEquipo, GestorImagen.EQUIPO);
         limpiarCamposEquipo();
         limpiarCamposDelegado();
         cargarRepeaterEquipos();
         gestorEquipo.equipo = null; // le setea null al equipo
         //lo manda a la solapa de agregar un equipo
         btnRegistrarEquipo.Visible            = true;
         btnModificarEquipo.Visible            = false;
         btnCancelarModificacionEquipo.Visible = false;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarEquipo');", true);
     }
     catch (Exception ex) { mostrarPanelFracaso(ex.Message); }
 }