Exemplo n.º 1
0
 /// <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);
     }
 }
Exemplo n.º 2
0
 /// <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);
     }
 }
Exemplo n.º 3
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);
     }
 }
Exemplo n.º 4
0
 /// <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();
     }
 }
Exemplo n.º 5
0
 /// <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();
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Agrega un delegado a una lista genérica de delegados
 /// autor: Facundo Allemand
 /// </summary>
 protected void btnAgregarDelegado_Click(object sender, EventArgs e)
 {
     try
     {
         gestorEquipo.agregarDelegado(txtNombreDelegado.Value, txtEmailDelegado.Value, txtTelefonoDelegado.Value, txtDireccionDelegado.Value);
         limpiarCamposDelegado();
         cargarRepeaterDelegados();
         imagenpreview.Src = GestorImagen.obtenerImagenTemporal(GestorImagen.EQUIPO, GestorImagen.MEDIANA);
     }
     catch (Exception ex)
     {
         if (ex.Message.Contains("Solo puede cargar dos delegados"))
         {
             limpiarCamposDelegado();
         }
         if (ex.Message.Contains("Ya existe un delegado con ese nombre"))
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "showDelegados();", true);
         }
         mostrarPanelFracaso(ex.Message);
     }
 }