예제 #1
0
        private void BuscarCargarGrilla()
        {
            try
            {
                _ldtoPlant = new List <DtoPlantilla>();
                DtoPlantilla dto = new DtoPlantilla();
                dto.codEquipo = Request.QueryString["codEquipo"];
                ClassResultV cr = new CTR.CtrPlantilla().Usp_PlantillaxEquipo_GetAll(dto);
                if (!cr.HuboError)
                {
                    foreach (DtoPlantilla dtoB in cr.List)
                    {
                        _ldtoPlant.Add(dtoB);
                    }
                    _ldtoPlant = _ldtoPlant.Where(x => (x.nombreCompleto.ToLower().Trim()).Trim().Contains(txtBuscar.Text.ToLower().Trim())).ToList();

                    gvPlantillaxEquipo.DataSource = _ldtoPlant;
                    gvPlantillaxEquipo.DataBind();
                }
                else
                {
                    gvPlantillaxEquipo.DataBind();
                }
            }
            catch { }
        }
예제 #2
0
        public ClassResultV Usp_TotalJugadores_GetAll()
        {
            ClassResultV cr = new ClassResultV();

            try
            {
                SqlDataReader reader = SqlHelper.ExecuteReader(objCn, CommandType.StoredProcedure, "Usp_TotalJugadores_GetAll");
                cr.List = new List <DtoB>();
                while (reader.Read())
                {
                    DtoPlantilla dtoS = new DtoPlantilla();
                    dtoS.codPlantilla        = getValue("codPlantilla", reader).Value_String;
                    dtoS.codEquipo           = getValue("codEquipo", reader).Value_String;
                    dtoS.equipoNombre        = getValue("equipoNombre", reader).Value_String;
                    dtoS.codJugador          = getValue("codJugador", reader).Value_String;
                    dtoS.nombreCompleto      = getValue("nombreCompleto", reader).Value_String;
                    dtoS.descripcionPosicion = getValue("descripcionPosicion", reader).Value_String;
                    cr.List.Add(dtoS);
                }
            }
            catch (Exception ex)
            {
                cr.DT         = null;
                cr.LugarError = ex.StackTrace;
                cr.ErrorEx    = ex.Message;
                cr.ErrorMsj   = "Error al consultar todos los jugadores";
            }
            objCn.Close();
            return(cr);
        }
예제 #3
0
        public ClassResultV Usp_PlantillaxEquipo_GetAll(DtoB dtoBase)
        {
            ClassResultV cr  = new ClassResultV();
            var          dto = (DtoPlantilla)dtoBase;
            var          pr  = new SqlParameter[3];

            try
            {
                pr[0]       = new SqlParameter("@codEquipo", SqlDbType.VarChar, 4);
                pr[0].Value = V_ValidaPrNull(dto.codEquipo);

                SqlDataReader reader = SqlHelper.ExecuteReader(objCn, CommandType.StoredProcedure, "Usp_PlantillaxEquipo_GetAll", pr);
                cr.List = new List <DtoB>();
                while (reader.Read())
                {
                    DtoPlantilla dtoP = new DtoPlantilla();
                    dtoP.codPlantilla        = getValue("codPlantilla", reader).Value_String;
                    dtoP.codEquipo           = getValue("codEquipo", reader).Value_String;
                    dtoP.nombreCompleto      = getValue("nombreCompleto", reader).Value_String;
                    dtoP.descripcionPosicion = getValue("Posicion", reader).Value_String;
                    dtoP.peso       = getValue("pesoInicial", reader).Value_String;
                    dtoP.talla      = getValue("tallaInicial", reader).Value_String;
                    dtoP.codJugador = getValue("codJugador", reader).Value_String;


                    /*
                     * TPo.descripcionPosicion [Posicion]
                     * , TJ.pesoInicial, TJ.tallaInicial
                     *
                     */
                    cr.List.Add(dtoP);
                }
            }
            catch (Exception ex)
            {
                cr.DT         = null;
                cr.LugarError = ex.StackTrace;
                cr.ErrorEx    = ex.Message;
                cr.ErrorMsj   = "Error al consultar plantillas";
            }
            objCn.Close();
            return(cr);
        }
예제 #4
0
 protected void gvJugadoresAll_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.Footer)
     {
     }
     else if (e.Row.RowType == DataControlRowType.DataRow)
     {
         DtoPlantilla dto = (DtoPlantilla)e.Row.DataItem;
         if ((e.Row.RowState == DataControlRowState.Edit) || (e.Row.RowState == (DataControlRowState.Alternate | DataControlRowState.Edit)))
         {
             //Cuando estoy en edición
         }
         else
         {
             if (dto.codEquipo.Equals(0))
             {
                 ((Label)e.Row.FindControl("lblCodPlantillaAdd")).Visible = false;
             }
         }
     }
 }
예제 #5
0
        public ClassResultV Usp_Plantilla_Insert(DtoPlantilla dtoBase)
        {
            var cr  = new ClassResultV();
            var dto = (DtoPlantilla)dtoBase;
            var pr  = new SqlParameter[4];

            try
            {
                pr[0]           = new SqlParameter("@codEquipo", SqlDbType.VarChar, 4);
                pr[0].Value     = dto.codEquipo;
                pr[1]           = new SqlParameter("@codJugador", SqlDbType.Char, 9);
                pr[1].Value     = dto.codJugador;
                pr[2]           = new SqlParameter("@IB_Mostrar", SqlDbType.Bit);
                pr[2].Value     = dto.IB_Mostrar;
                pr[3]           = new SqlParameter("@msj", SqlDbType.VarChar, 100);
                pr[3].Direction = ParameterDirection.Output;

                SqlHelper.ExecuteNonQuery(objCn, CommandType.StoredProcedure, "Usp_Plantilla_Insert", pr);
                if (Convert.ToString(pr[3].Value) != "")
                {
                    cr.LugarError = ToString("Usp_Plantilla_Insert");
                    cr.ErrorMsj   = Convert.ToString(pr[3].Value);
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                cr.LugarError = ex.StackTrace;
                cr.ErrorEx    = ex.Message;
                cr.ErrorMsj   = "Error al registrar plantillas";
            }

            objCn.Close();
            return(cr);
        }
예제 #6
0
        private void CargarGrilla()
        {
            try
            {
                _ldtoPlant = new List <DtoPlantilla>();
                DtoPlantilla dto = new DtoPlantilla();
                dto.codEquipo = Request.QueryString["codEquipo"];
                //dto.IB_Mostrar = true;
                ClassResultV cr = new CTR.CtrPlantilla().Usp_PlantillaxEquipo_GetAll(dto);
                if (!cr.HuboError)
                {
                    foreach (DtoB dtoB in cr.List)
                    {
                        _ldtoPlant.Add((DtoPlantilla)dtoB);
                    }
                    gvPlantillaxEquipo.DataSource = _ldtoPlant;
                    gvPlantillaxEquipo.DataBind();

                    gvConvocables.DataSource = _ldtoPlant;
                    gvConvocables.DataBind();
                }
            }
            catch { }
        }
예제 #7
0
        /*
         * private void ConsultarPosicion(DropDownList ddlPrincipal, DropDownList ddlAlternativo)
         * {
         *  try
         *  {
         *      _ldtoPos = new List<DtoPosicion>(); ///Objeto Salida
         *      ClassResultV cr = new CtrPosicion().Usp_Posicion_GetAll();
         *      if (!cr.HuboError)
         *      {
         *          _ldtoPos.AddRange(cr.List.Cast<DtoPosicion>());
         *          _ldtoPos.Insert(0, new DtoPosicion() { codPosicion = "0", descripcionPosicion = "Seleccionar una posicion" });
         *
         *          ddlPrincipal.DataSource = _ldtoPos;
         *          ddlPrincipal.DataValueField = "codPosicion";
         *          ddlPrincipal.DataTextField = "descripcionPosicion";
         *          ddlPrincipal.DataBind();
         *
         *          ddlAlternativo.DataSource = _ldtoPos;
         *          ddlAlternativo.DataValueField = "codPosicion";
         *          ddlAlternativo.DataTextField = "descripcionPosicion";
         *          ddlAlternativo.DataBind();
         *      }
         *  }
         *  catch { }
         * }
         */
        //private void ConsultarEquipo(DropDownList ddlEquipo)
        //{
        //    try
        //    {
        //        _ldtoEquip = new List<DtoEquipo>(); ///Objeto Salida
        //        ClassResultV cr = new CtrEquipo().Usp_EquipoNombres_GetAll(TipoCons.cbx);
        //        if (!cr.HuboError)
        //        {
        //            _ldtoEquip.AddRange(cr.List.Cast<DtoEquipo>());
        //            _ldtoEquip.Insert(0, new DtoEquipo() { codEquipo = "0", equipoNombre = "Seleccionar un equipo" });

        //            ddlEquipo.DataSource = _ldtoEquip;
        //            ddlEquipo.DataValueField = "codEquipo";
        //            ddlEquipo.DataTextField = "equipoNombre";
        //            ddlEquipo.DataBind();
        //        }
        //    }
        //    catch { }
        //}
        private bool AgregarNuevoUsuarioJugador()
        {
            bool valido = false;

            try
            {
                ClassResultV cr   = new ClassResultV();
                DtoUsuario   dtoU = new DtoUsuario();
                DtoJugador   dtoJ = new DtoJugador();
                DtoPlantilla dtoP = new DtoPlantilla();
                DtoEquipo    dtoE = new DtoEquipo();
                //Usuario
                dtoU.codPerfil         = 3;
                dtoU.usuario           = txtUsuarioJugador.Text.Trim();
                dtoU.usuarioClave      = txtJugadorClave.Text.Trim();
                dtoU.usuarioNombre     = txtNombreUsu.Text.Trim();
                dtoU.usuarioApePaterno = txtApellidoPatUsu.Text.Trim();
                dtoU.usuarioApeMaterno = txtApellidoMatUsu.Text.Trim();
                dtoU.usuarioCorreo     = txtCorreo.Text.Trim();
                dtoU.usuarioDireccion  = txtDireccionJugador.Text.Trim();
                dtoU.usuarioNumDNI     = Convert.ToInt32(txtNumDNI.Text.Trim());
                dtoU.usuarioTelefono   = Convert.ToInt32(txtTelefono.Text.Trim());
                dtoU.usuarioEstado     = "1";
                dtoU = new CtrUsuario().Usp_Usuario_Insert(dtoU);
                //Persona - Jugador
                dtoJ.codUsuario          = dtoU.codUsuario;
                dtoJ.aliasDeportivo      = txtAliasJug.Text.Trim();
                dtoJ.numDorsal           = Convert.ToInt32(txtNumDorsalJug.Text.Trim());
                dtoJ.clubProcedencia     = txtProcedJug.Text.Trim();
                dtoJ.lateralidad         = (ddlLateralidad.SelectedValue);
                dtoJ.posicionPrincipal   = ddlPrincipal.SelectedValue;
                dtoJ.posicionAlternativa = ddlAlternativa.SelectedValue;
                dtoJ.pesoInicial         = Convert.ToDecimal(txtPesoJug.Text);
                if (dtoJ.pesoInicial > 55 && dtoJ.pesoInicial < 90)
                {
                    dtoJ.tallaInicial = Convert.ToDecimal(txtTallaJug.Text);
                    if (Convert.ToDouble(dtoJ.tallaInicial) > 1.55 && Convert.ToDouble(dtoJ.tallaInicial) < 2.00)
                    {
                        dtoJ.codEquipo       = hdnEquipo2.Value.Equals("0") ? String.Empty : hdnEquipo2.Value;
                        dtoJ.jugadorFechaNac = Convert.ToDateTime(txtFechNacJug.Text.Trim());
                        dtoJ = new CtrJugador().Usp_Jugador_Insert(dtoJ);
                        //Plantilla
                        dtoP.codEquipo  = hdnEquipo2.Value.Equals("0") ? String.Empty : hdnEquipo2.Value;
                        dtoP.codJugador = dtoJ.codJugador;
                        dtoP.IB_Mostrar = true;
                        cr = new CtrPlantilla().Usp_Plantilla_Insert(dtoP);
                        if (!cr.HuboError)
                        {
                            dtoE.codEquipo  = dtoP.codEquipo;
                            dtoE.IB_Mostrar = false;
                            cr = new CtrEquipo().Usp_EstadoEquipoByCupos_Update(dtoE);
                            Response.Write("<script>alert('" + cr.ErrorMsj + "')</script>");
                            //Response.Write("<script>alert('Jugador Registrado Correctamente')</script>");
                            Limpiar();
                        }
                        else
                        {
                            Response.Write("<script>alert('" + cr.ErrorMsj + "')</script>");
                            dtoE.codEquipo  = dtoP.codEquipo;
                            dtoE.IB_Mostrar = false;
                            cr = new CtrEquipo().Usp_EstadoEquipoByCupos_Update(dtoE);
                        }
                    }
                    else
                    {
                        Response.Write("<script>alert('Talla del jugador debe estar entre 1.55 y 2.00 cm.')</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('Peso del jugador debe estar entre los 55 y 90 kg.')</script>");
                }
            }
            catch (Exception ex)
            {
            }
            return(valido);
        }
예제 #8
0
 public ClassResultV Usp_PlantillaxEquipo_GetAll(DtoPlantilla dto)
 {
     return(new DaoPlantilla().Usp_PlantillaxEquipo_GetAll(dto));
 }
예제 #9
0
 public ClassResultV Usp_Plantilla_Insert(DtoPlantilla dto)
 {
     return(new DaoPlantilla().Usp_Plantilla_Insert(dto));
 }