Ejemplo n.º 1
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); }
        }