Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    Torneo  torneo  = GestorUrl.validarTorneo();
                    Edicion edicion = GestorUrl.validarEdicion(torneo.nick);
                    Partido partido = GestorUrl.validarPartido(torneo.nick, edicion.idEdicion);

                    gestorTorneo        = new GestorTorneo();
                    gestorTorneo.torneo = torneo;
                    nickTorneo          = torneo.nick;

                    gestorEdicion         = new GestorEdicion();
                    gestorEdicion.edicion = edicion;
                    idEdicion             = edicion.idEdicion;

                    gestorPartido         = new GestorPartido();
                    gestorPartido.partido = partido;
                    idPartido             = partido.idPartido.ToString();

                    gestorEstadistica = new GestorEstadisticas(edicion);

                    gestorEquipo = Sesion.getGestorEquipo();

                    gestorPartido.obtenerPartidoporId(idPartido);
                    otrosPartidosDeLaFecha();         // Carga Otros Partidos de la Fecha
                    cargarDatosDePartido();           // Carga Resumen y Estadísticas del Partido
                    cargarUltimosOProximosPartidos(); // Carga Próximos o Ultimos Partidos
                    cargarComparativo();              //Carga widget Comparativo
                }
            }
            catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
        }
Пример #2
0
 /// <summary>
 /// Carga los equipos seleccionados para la edición
 /// autor: Facundo Allemand
 /// </summary>
 protected void btnSiguiente_Click(object sender, EventArgs e)
 {
     try
     {
         if (hfEquiposSeleccionados.Value == "")
         {
             throw new Exception("No hay equipos seleccionados");
         }
         if (gestorEdicion.edicion.equipos != null && gestorEdicion.edicion.equipos.Count > 1)
         {
             gestorEdicion.verificarCambiosDeEquipos(hfEquiposSeleccionados.Value);
         }
         gestorEdicion.agregarEquiposEnEdicion(hfEquiposSeleccionados.Value);
         //se limpian las fases que hayan sido generadas anteriormente
         //gestorEdicion.edicion.fases = new List<Fase>();
         Sesion.setGestorFase(new GestorFase());
         Response.Redirect(GestorUrl.eFASES);
     }
     catch (Exception ex)
     {
         if (ex.Message == "Modificación de equipos!!!")
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal('modificarEquipos');", true);
         }
         else
         {
             GestorError.mostrarPanelFracaso(ex.Message);
         }
     }
 }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    Torneo  torneo  = GestorUrl.validarTorneo();
                    Edicion edicion = GestorUrl.validarEdicion(torneo.nick);

                    gestorTorneo        = new GestorTorneo();
                    gestorTorneo.torneo = torneo;
                    nickTorneo          = torneo.nick;

                    gestorEdicion                 = new GestorEdicion();
                    gestorEdicion.edicion         = edicion;
                    gestorEdicion.edicion.equipos = gestorEdicion.obtenerEquipos();
                    idEdicion = edicion.idEdicion;
                    gestorEdicion.edicion.fases = gestorEdicion.obtenerFases();

                    gestorEstadistica         = new GestorEstadisticas(edicion);
                    gestorEstadistica.edicion = edicion;


                    GestorControles.cargarRepeaterList(rptCanchas, new GestorCancha().obtenerCanchasDeUnTorneoPorId(torneo.idTorneo));
                    GestorControles.cargarRepeaterTable(rptAribitros, gestorEstadistica.estadisticasDeArbitro(torneo.idTorneo));
                    msjFairPLay.Visible = !GestorControles.cargarRepeaterTable(rptFairPlay, gestorEstadistica.rankingFairPlay());
                    msjValla.Visible    = !GestorControles.cargarRepeaterTable(rptVallaMenosVencida, gestorEstadistica.vallaMenosVencida());
                }
            }
            catch (Exception ex) {
                GestorError.mostrarPanelFracaso(ex.Message);
            }
        }
Пример #4
0
        protected void btnModificarSancion_Click(object sender, EventArgs e)
        {
            try
            {
                int idSancionAModificar = gestorSancion.sancion.idSancion;
                if (gestorSancion.sancion.idJugador != null && gestorSancion.sancion.idPartido != null)
                {
                    gestorSancion.modificarSancion(idSancionAModificar.ToString(), ddlFecha.SelectedValue, ddlPartido.SelectedValue, ddlEquipo.SelectedValue, ddlJugador.SelectedValue, txtFecha.Value, ddlMotivo.SelectedValue, txtObservacion.Value, txtPuntosAQuitar.Value, txtCantidadFechasSuspendidas.Value);
                }
                if (gestorSancion.sancion.idJugador == null && gestorSancion.sancion.idPartido == null)
                {
                    gestorSancion.modificarSancion(idSancionAModificar.ToString(), null, null, ddlEquipoSinPartido.SelectedValue, null, txtFecha.Value, ddlMotivo.SelectedValue, txtObservacion.Value, txtPuntosAQuitar.Value, txtCantidadFechasSuspendidas.Value);
                }

                if (gestorSancion.sancion.idJugador == null && gestorSancion.sancion.idPartido != null)
                {
                    gestorSancion.modificarSancion(idSancionAModificar.ToString(), ddlFecha.SelectedValue, ddlPartido.SelectedValue, ddlEquipo.SelectedValue, null, txtFecha.Value, ddlMotivo.SelectedValue, txtObservacion.Value, txtPuntosAQuitar.Value, txtCantidadFechasSuspendidas.Value);
                }
                if (gestorSancion.sancion.idJugador != null && gestorSancion.sancion.idPartido == null)
                {
                    gestorSancion.modificarSancion(idSancionAModificar.ToString(), null, null, ddlEquipoSinPartido.SelectedValue, ddlJugador.SelectedValue, txtFecha.Value, ddlMotivo.SelectedValue, txtObservacion.Value, "", txtCantidadFechasSuspendidas.Value);
                }
                gestorSancion.sancion = null;
                cargarRepeaterSanciones(gestorEdicion.edicion.idEdicion.ToString());
                btnRegistrarSancion.Visible            = true;
                btnModificarSancion.Visible            = false;
                btnCancelarModificacionSancion.Visible = false;
                limpiarCampos();
                habilitarCombos();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarSancion');", true);
            }
            catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    torneo  = GestorUrl.validarTorneo();
                    edicion = GestorUrl.validarEdicion(torneo.nick);

                    gestorTorneo        = new GestorTorneo();
                    gestorTorneo.torneo = torneo;

                    litFavicon.Text = "<link rel='shortcut icon' href='" + torneo.obtenerImagenChicha() + "'>";

                    serializador = new JavaScriptSerializer();
                    string estilos = serializador.Serialize(gestorTorneo.obtenerConfiguracionVisual(torneo.idTorneo));
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "variable", "cargarEstilosVisuales(" + estilos + ");", true);

                    Utils.GestorControles.cargarRepeaterList(rptEdicionesMaster, new GestorEdicion().obtenerEdicionesPorTorneo(torneo.idTorneo));

                    validarAdministradorLogueado();
                }
            }
            catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    Torneo  torneo  = GestorUrl.validarTorneo();
                    Edicion edicion = GestorUrl.validarEdicion(torneo.nick);

                    gestorTorneo        = new GestorTorneo();
                    gestorTorneo.torneo = torneo;
                    nickTorneo          = torneo.nick;

                    gestorEdicion               = new GestorEdicion();
                    gestorEdicion.edicion       = edicion;
                    idEdicion                   = edicion.idEdicion;
                    gestorEdicion.edicion.fases = gestorEdicion.obtenerFases();

                    gestorEstadistica         = new GestorEstadisticas(edicion);
                    gestorEstadistica.edicion = edicion;

                    gestorJugador = new GestorJugador();
                    GestorControles.cargarRepeaterTable(rptGoleadores, gestorEstadistica.obtenerTablaGoleadores());
                    cargarGoleadoresFases();
                    sinGoleadoresTodas.Visible = !GestorControles.cargarRepeaterTable(rptGoleadoresTodasLasFases, gestorEstadistica.obtenerTablaGoleadores());
                    sinEquipos.Visible         = !GestorControles.cargarRepeaterTable(rptEquiposQueConvirtieron, gestorEstadistica.cantidadGolesPorEquipo(false));
                    sinTiposDeGoles.Visible    = !GestorControles.cargarRepeaterTable(rptGolesPorTipoGol, gestorEstadistica.cantidadGolesPorTipoGol(false));
                    cargarGraficos();
                }
            }
            catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
        }
Пример #7
0
 /// <summary>
 /// Obtiene el torneo donde se va agregar la edición
 /// autor: Paula Pedrosa
 /// </summary>
 protected void rptTorneos_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     try
     {
         gestorTorneo.torneo = gestorTorneo.obtenerTorneoPorId(int.Parse(e.CommandArgument.ToString()));
         if (e.CommandName == "editarTorneo")
         {
             lblTituloModalTorneo.Text  = "Modificar Torneo";
             txtUrlTorneo.Disabled      = true;
             btnRegistrarTorneo.Visible = false;
             btnModificarTorneo.Visible = true;
             txtUrlTorneo.Value         = gestorTorneo.torneo.nick;
             txtNombreTorneo.Value      = gestorTorneo.torneo.nombre;
             txtDescripcion.Value       = gestorTorneo.torneo.descripcion;
             imagenpreview.Src          = gestorTorneo.torneo.obtenerImagenMediana();
             ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal('modalTorneo');", true);
         }
         if (e.CommandName == "administrarTorneo")
         {
             Sesion.setTorneo(gestorTorneo.torneo);
             Sesion.setEdicion(null);
             Sesion.setGestorEdicion(null);
             Response.Redirect(GestorUrl.aINDEX);
         }
         if (e.CommandName == "eliminarTorneo")
         {
             litNombreTorneo.Text = gestorTorneo.torneo.nombre;
             ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal('eliminarTorneo');", true);
             limpiarPaneles();
         }
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #8
0
 /// <summary>
 /// Limpia y muestra el modal para registrar un torneo.
 /// autor: Facundo Allemand
 /// </summary>
 protected void btnRegistrarNuevoTorneo_Click(object sender, EventArgs e)
 {
     try
     {
         limpiarModalTorneo();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal('modalTorneo');", true);
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #9
0
        protected void btnRegistrarSancion_Click(object sender, EventArgs e)
        {
            try
            {
                if (gestorEdicion == null)
                {
                    throw new Exception("Debe seleccionar una edición");
                }
                if ((ddlEquipo.SelectedValue.Equals(string.Empty) && ddlEquipoSinPartido.SelectedValue.Equals(string.Empty)))
                {
                    throw new Exception("Debe seleccionar un equipo");
                }
                if (txtFecha.Value.Equals(string.Empty))
                {
                    throw new Exception("Debe ingresar la fecha de registro de la sanción");
                }
                if (ddlMotivo.SelectedValue.Equals(string.Empty))
                {
                    throw new Exception("Debe seleccionar un motivo");
                }

                if (rdEquipos.Checked && rdSinDefinir.Checked) //CASO MÁS SIMPLE
                {
                    gestorSancion.registrarSancion(ddlEdiciones.SelectedValue, string.Empty, string.Empty, ddlEquipoSinPartido.SelectedValue, string.Empty, txtFecha.Value, ddlMotivo.SelectedValue, txtObservacion.Value, txtPuntosAQuitar.Value, txtCantidadFechasSuspendidas.Value, gestorEdicion.faseActual.idFase.ToString());
                }
                if (rdEquipos.Checked && rdPartido.Checked)
                {
                    gestorSancion.registrarSancion(ddlEdiciones.SelectedValue, ddlFecha.SelectedValue, ddlPartido.SelectedValue, ddlEquipo.SelectedValue, string.Empty, txtFecha.Value, ddlMotivo.SelectedValue, txtObservacion.Value, txtPuntosAQuitar.Value, txtCantidadFechasSuspendidas.Value, gestorEdicion.faseActual.idFase.ToString());
                }
                if (rdJugadores.Checked && rdSinDefinir.Checked)
                {
                    gestorSancion.registrarSancion(ddlEdiciones.SelectedValue, string.Empty, string.Empty, ddlEquipoSinPartido.SelectedValue, ddlJugador.SelectedValue, txtFecha.Value, ddlMotivo.SelectedValue, txtObservacion.Value, txtPuntosAQuitar.Value, txtCantidadFechasSuspendidas.Value, gestorEdicion.faseActual.idFase.ToString());
                }
                if (rdJugadores.Checked && rdPartido.Checked)
                {
                    gestorSancion.registrarSancion(ddlEdiciones.SelectedValue, ddlFecha.SelectedValue, ddlPartido.SelectedValue, ddlEquipo.SelectedValue, ddlJugador.SelectedValue, txtFecha.Value, ddlMotivo.SelectedValue, txtObservacion.Value, txtPuntosAQuitar.Value, txtCantidadFechasSuspendidas.Value, gestorEdicion.faseActual.idFase.ToString());
                }

                cargarRepeaterSanciones(ddlEdiciones.SelectedValue);
                gestorSancion.sancion = null;
                ScriptManager.RegisterStartupScript(this, this.GetType(), "OpcionPorDefecto", "deshabilitarPanel(); limpiarCombos(); equipoYSinDefinir();", true);
                cargarComboEquipos();
                cargarComboFechas();
                cargarComboMotivos();
                rdEquipos.Checked    = true;
                rdSinDefinir.Checked = true;
                limpiarCamposSanciones();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarSancion');", true);
            }
            catch (Exception ex)
            {
                GestorError.mostrarPanelFracaso(ex.Message);
                rdEquipos.Checked    = true;
                rdSinDefinir.Checked = true;
                ScriptManager.RegisterStartupScript(this, this.GetType(), "equipoYSinDefinir()", "equipoYSinDefinir();", true);
            }
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    Torneo  torneo  = GestorUrl.validarTorneo();
                    Edicion edicion = GestorUrl.validarEdicion(torneo.nick);
                    idFase  = GestorUrl.validarFase(torneo.nick, edicion.idEdicion);
                    idFecha = GestorUrl.validarFecha(torneo.nick, edicion.idEdicion, idFase);

                    gestorTorneo              = new GestorTorneo();
                    gestorTorneo.torneo       = torneo;
                    nickTorneo                = torneo.nick;
                    nombreTorneo              = torneo.nombre;
                    ViewState["nickTorneo"]   = nickTorneo;
                    ViewState["nombreTorneo"] = nombreTorneo;

                    gestorEdicion               = new GestorEdicion();
                    gestorEdicion.edicion       = edicion;
                    gestorEdicion.edicion.fases = gestorEdicion.obtenerFases();
                    idEdicion = edicion.idEdicion;
                    ViewState["idEdicion"] = idEdicion;

                    serializer = new JavaScriptSerializer();
                    ViewState["gestorEdicion"] = serializer.Serialize(gestorEdicion);

                    ViewState["idFase"]  = idFase;
                    ViewState["idFecha"] = idFecha;
                    litFase.Text         = idFase.ToString();
                    litFecha.Text        = idFecha.ToString();
                    litLnkFase.Text      = idFase.ToString();
                    litLnkFecha.Text     = idFecha.ToString();

                    sinFases.Visible = !GestorControles.cargarRepeaterList(rptFases, gestorEdicion.edicion.fases);
                    if (sinFases.Visible == true)
                    {
                        sinFechas.Visible = true;
                    }
                    else
                    {
                        cargarFase();
                    }
                }
                else
                {
                    nickTorneo    = ViewState["nickTorneo"].ToString();
                    nombreTorneo  = ViewState["nombreTorneo"].ToString();
                    serializer    = new JavaScriptSerializer();
                    gestorEdicion = serializer.Deserialize <GestorEdicion>(ViewState["gestorEdicion"].ToString());
                    idEdicion     = int.Parse(ViewState["idEdicion"].ToString());
                    idFase        = int.Parse(ViewState["idFase"].ToString());
                    idFecha       = int.Parse(ViewState["idFecha"].ToString());
                }
            }
            catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
        }
Пример #11
0
 protected void rptGrupos_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     try
     {
         Repeater rptPartidos = (Repeater)e.Item.FindControl("rptPartidos");
         GestorControles.cargarRepeaterList(rptPartidos, ((Grupo)e.Item.DataItem).fechas[idFecha - 1].partidos);
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #12
0
 /// <summary>
 /// Elimina de la BD un torneo
 /// autor: Pau Pedrosa
 /// </summary>
 protected void btnEliminarTorneo_Click(object sender, EventArgs e)
 {
     try
     {
         gestorTorneo.eliminarTorneo(gestorTorneo.torneo.idTorneo);
         cargarRepeaterTorneos();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "eliminarTorneo", "closeModal('eliminarTorneo');", true);
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #13
0
 protected void btnCancelarEdicion_Click(object sender, EventArgs e)
 {
     try
     {
         gestorEdicion.cancelarEdicion(gestorEdicion.edicion.idEdicion);
         cargarRepeaterEdiciones();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "cancelarEdicion", "closeModal('modalCancelarEdicion');", true);
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #14
0
 /// <summary>
 /// Modifica los Equipos seleccionados de la edición
 /// autor: Facundo Allemand
 /// </summary>
 protected void btnModificar_Click(object sender, EventArgs e)
 {
     try
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "modificarEquipos", "closeModal('modificarEquipos');", true);
         gestorEdicion.agregarEquiposEnEdicion(hfEquiposSeleccionados.Value);
         new GestorFase().eliminarConfiguracionGuardada(gestorEdicion.edicion.fases);
         Response.Redirect(GestorUrl.eFASES);
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #15
0
 protected void btnSiguienteEdicion_Click(object sender, EventArgs e)
 {
     try
     {
         limpiarPaneles();
         gestorEdicion.cargarDatos(txtNombreEdicion.Value, ddlTamañoCancha.SelectedValue, ddlTipoSuperficie.SelectedValue, txtPuntosPorGanar.Value, txtPuntosPorEmpatar.Value, txtPuntosPorPerder.Value, ddlGenero.SelectedValue);
         gestorEdicion.registrarEdicion(Sesion.getTorneo().idTorneo);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "closeModal('modalEdicion');", true);
         cargarRepeaterEdiciones();
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #16
0
 protected void btnCambioEnCantidadEquipos_Click(object sender, EventArgs e)
 {
     try
     {
         List <Fase> fasesParaElWidget = (List <Fase>)Session["fasesParaElWidget"];
         string      datosWidget       = armarFases(fasesParaElWidget, hfEquiposSeleccionados.Value, true);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "cambioEnEquipos(); $('#contenedorFases').generadorDeFases(" + datosWidget + "); ", true);
     }
     catch (Exception ex)
     {
         GestorError.mostrarPanelFracaso(ex.Message);
     }
 }
Пример #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         gestorTorneo  = Sesion.getGestorTorneo();
         gestorEdicion = Sesion.getGestorEdicion();
         if (!Page.IsPostBack)
         {
             cargarRepeaterTorneos();
         }
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #18
0
 protected void btnRegistrarNuevaEdicion_Click(object sender, EventArgs e)
 {
     try
     {
         btnModificarEdicion.Visible = false;
         lblTituloModalEdicion.Text  = "Agregar Nueva Edición";
         limpiarModalEdicion();
         txtTorneoAsociado.Value     = gestorTorneo.torneo.nombre;
         descripcionModifica.Visible = false;
         descripcionNueva.Visible    = true;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal('modalEdicion');", true);
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #19
0
 protected void btnCancelarModificacionSancion_Click(object sender, EventArgs e)
 {
     try
     {
         limpiarCampos();
         habilitarCombos();
         btnRegistrarSancion.Visible            = true;
         btnModificarSancion.Visible            = false;
         btnCancelarModificacionSancion.Visible = false;
         gestorSancion.sancion = null;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarSancion');", true);
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #20
0
 protected void btnEliminar_Click(object sender, EventArgs e)
 {
     try
     {
         gestorSancion.eliminarSancion(gestorSancion.sancion.idSancion);
         cargarRepeaterSanciones(gestorEdicion.edicion.idEdicion.ToString());
         ScriptManager.RegisterStartupScript(this, this.GetType(), "eliminarSancion", "closeModal('eliminarSancion');", true);
         //rdEquipos.Checked = true;
         //rdSinDefinir.Checked = true;
         //ScriptManager.RegisterStartupScript(this, this.GetType(), "equipoYSinDefinir()", "equipoYSinDefinir();", true);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "OpcionPorDefecto", "deshabilitarPanel(); limpiarCombos(); equipoYSinDefinir();", true);
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         gestorSancion = Sesion.getGestorSancion();
         gestorEdicion = Sesion.getGestorEdicion();
         gestorFase    = Sesion.getGestorFase();
         if (!Page.IsPostBack)
         {
             cargarComboEdiciones();
         }
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #22
0
 /// <summary>
 /// Carga las ediciones de un torneo en particular
 /// autor: Paula Pedrosa
 /// </summary>
 protected void rptTorneosItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     try
     {
         if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
         {
             Repeater rptEdiciones      = (Repeater)e.Item.FindControl("rptEdiciones");
             int      idTorneo          = ((Torneo)e.Item.DataItem).idTorneo;
             Panel    panelSinEdiciones = e.Item.FindControl("panelSinEdiciones") as Panel;
             panelSinEdiciones.Visible = !(GestorControles.cargarRepeaterList(rptEdiciones, gestorEdicion.obtenerEdicionesPorTorneo(idTorneo)));
         }
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!Page.IsPostBack)
         {
             torneo     = GestorUrl.validarTorneo();
             edicion    = GestorUrl.validarEdicion(torneo.nick);
             nickTorneo = torneo.nick;
             idEdicion  = edicion.idEdicion;
             cargarNoticias();
         }
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #24
0
 protected void btnSeleccionarEdicion_Click(object sender, EventArgs e)
 {
     try
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "DeshabilitaPanel", "deshabilitarPanel();", true);
         if (ddlEdiciones.Items.Count == 1) //Está cargada solo con "Seleccione Edición"
         {
             throw new Exception("No tiene ediciones registradas. Por favor registre una edición.");
         }
         else
         {
             sinEdicion.Visible = false;
         }
         gestorEdicion.edicion = gestorEdicion.obtenerEdicionPorId(Validador.castInt(ddlEdiciones.SelectedValue));
         if (!gestorSancion.manipulaSancionar(gestorEdicion.edicion).Equals(""))
         {
             throw new Exception(gestorSancion.manipulaSancionar(gestorEdicion.edicion));
         }
         //La edición permite la manipulación de sanciones
         gestorEdicion.edicion.fases = gestorEdicion.obtenerFases();
         gestorEdicion.getFaseActual();
         if (gestorEdicion.edicion.estado.idEstado == Estado.edicionINICIADA)
         {// Edición Iniciada, se puede cargar sanciones a partidos
             if (gestorEdicion.fasesFinalizadas())
             {
                 throw new Exception("La Edición tiene todas sus Fases Finalizadas. Ya no puede registrar sanciones.");
             }
             cargarComboFechas();
         }
         else // Edicion No Iniciada, por lo tanto se deshabilita la carga de fechas y partidos porque todavia no inició
         {
             rdPartido.Disabled = true;
         }
         cargarRepeaterSanciones(ddlEdiciones.SelectedValue);
         cargarComboEquipos();
         cargarComboMotivos();
         rdEquipos.Checked           = true;
         rdSinDefinir.Checked        = true;
         btnRegistrarSancion.Enabled = true;
         habilitarCheck();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "equipoYSinDefinir()", "equipoYSinDefinir();", true);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hideOnMobile", "hideOnMobile('agregarSancion');", true);
     }
     catch (Exception ex)
     {
         GestorError.mostrarPanelFracaso(ex.Message);
     }
 }
Пример #25
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);
     }
 }
Пример #26
0
 protected void rptFechas_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "SeleccionarFecha")
         {
             idFecha          = int.Parse(e.CommandArgument.ToString());
             litFecha.Text    = e.CommandArgument.ToString();
             litLnkFecha.Text = e.CommandArgument.ToString();
             if (gestorEdicion.edicion.fases[int.Parse(ViewState["idFase"].ToString()) - 1].grupos[0].fechas[idFecha - 1].estado.idEstado != Estado.fechaREGISTRADA)
             {
                 GestorControles.cargarRepeaterList(rptGrupos, gestorEdicion.edicion.fases[int.Parse(ViewState["idFase"].ToString()) - 1].grupos);
             }
         }
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #27
0
 /// <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);
     }
 }
Пример #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!Page.IsPostBack)
         {
             torneo     = GestorUrl.validarTorneo();
             edicion    = GestorUrl.validarEdicion(torneo.nick);
             noticia    = GestorUrl.validarNoticia(torneo.nick, edicion.idEdicion);
             nickTorneo = torneo.nick;
             idEdicion  = edicion.idEdicion;
             GestorNoticia gestorNoticia = new GestorNoticia();
             GestorControles.cargarRepeaterList(rptUltimasNoticias, (gestorNoticia.obtenerNoticiasXCategoria(edicion.idEdicion, noticia.categoria.idCategoriaNoticia).Count > 2) ? gestorNoticia.obtenerNoticiasXCategoria(edicion.idEdicion, noticia.categoria.idCategoriaNoticia).AsEnumerable().Take(3).ToList() : gestorNoticia.obtenerNoticiasXCategoria(edicion.idEdicion, noticia.categoria.idCategoriaNoticia));
         }
     }
     catch (Exception ex) { GestorError.mostrarPanelFracaso(ex.Message); }
 }
Пример #29
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);
     }
 }
Пример #30
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); }
 }