Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string cpais = Request.QueryString["codigo"];

            Coneccion a       = new Coneccion();
            string    LPaises = a.getPaises();

            string nombreE = a.getEquipoNombre(cpais);

            PNombre = nombreE;

            nombreE = Request.Form["Nombre"];

            string pais = a.getEquipoPais(cpais);

            string[] Paises = LPaises.Split(';');

            for (int i = 0; i < (Paises.Length - 1); i++)
            {
                string[] opcion = Paises[i].Split(',');

                if (opcion[0].Equals(pais))
                {
                    OPais += "<option value=\"" + opcion[0] + "\" selected=\"selected\">" + opcion[1] + "</option>\n";
                }
                else
                {
                    OPais += "<option value=\"" + opcion[0] + "\">" + opcion[1] + "</option>\n";
                }
            }
            string Pais = Request.Form["Pais"];

            string operacion = cpais + "," + nombreE + "," + Pais;

            a = new Coneccion("ActualizarEQuipo", operacion, 8);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpPostedFile file = Request.Files["Archivo"];

            Coneccion a = new Coneccion();

            if (file != null)
            {
                for (int i = 0; i < Request.Files.Count; i++)
                {
                    HttpPostedFile archivo = Request.Files[i];
                    if (archivo.ContentLength > 0)
                    {
                        string info = new StreamReader(archivo.InputStream).ReadToEnd();

                        string[] datos = info.Split(new[] { "\r\n" }, StringSplitOptions.None);

                        for (int x = 1; x < datos.Length - 1; x++)
                        {
                            string[] usuario = datos[x].Split(',');

                            string ncompleto = usuario[0];
                            string edad      = usuario[1];
                            string pais      = usuario[2];

                            bool epais = a.getPaisNE(pais);

                            if (epais)
                            {
                                pais = a.getPaisN(pais);
                            }
                            else
                            {
                                string op = pais + ",";
                                a    = new Coneccion("NuevoPais", op, 5);
                                pais = a.getPaisN(pais);
                            }

                            string[] persona  = ncompleto.Split(' ');
                            string   nombre   = persona[0];
                            string   apellido = persona[1];

                            string operacion = ncompleto + "," + nombre + "," + apellido + ",123," + pais + "," + edad;
                            a = new Coneccion("NuevoUser", operacion, 1);

                            string pago = usuario[3];

                            operacion = "1," + ncompleto;
                            a         = new Coneccion("EntrarQuiniela", operacion, 2);


                            if (pago.Equals("100"))
                            {
                                operacion = "1," + ncompleto;
                                a         = new Coneccion("EntrarQuiniela", operacion, 2);
                            }
                        }
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Coneccion a       = new Coneccion();
            string    LPaises = a.getPaises();
            string    codj    = Request.QueryString["codigo"];

            string pais = a.getJugadorPais(codj);

            string djugador = a.getJugadoresD(codj);

            string[] detalle = djugador.Split(',');

            Nnombre = detalle[0];
            Ngoles  = detalle[1];
            string posicion = detalle[2];

            if (posicion.Equals("GK"))
            {
                NPortero = "selected=\"selected\"";
            }
            else if (posicion.Equals("DF"))
            {
                NDefensa = "selected=\"selected\"";
            }
            else if (posicion.Equals("MF"))
            {
                NMedio = "selected=\"selected\"";
            }
            else if (posicion.Equals("FW"))
            {
                NDelantero = "selected=\"selected\"";
            }

            Nestatura   = detalle[3];
            Npeso       = detalle[4];
            Nnacimiento = detalle[6];


            string[] Paises = LPaises.Split(';');

            for (int i = 0; i < (Paises.Length - 1); i++)
            {
                string[] opcion = Paises[i].Split(',');

                if (opcion[0].Equals(pais))
                {
                    OPais += "<option value=\"" + opcion[0] + "\" selected=\"selected\">" + opcion[1] + "</option>\n";
                }
                else
                {
                    OPais += "<option value=\"" + opcion[0] + "\">" + opcion[1] + "</option>\n";
                }
            }



            if (!IsPostBack)
            {
                string Nombre = Request.Form["Nombre"];

                if (Nombre != null)
                {
                    string Posicion   = Request.Form["Posicion"];
                    string Goles      = Request.Form["Goles"];
                    string Estatura   = Request.Form["Estatura"];
                    string Peso       = Request.Form["Peso"];
                    string Nacimiento = Request.Form["Nacimiento"];
                    string Pais       = Request.Form["Pais"];

                    string Operacion = codj + "," + Nombre + "," + Posicion + "," + Estatura + "," + Peso + "," + Goles + "," + Pais + "," + Nacimiento;

                    a = new Coneccion("ActualizarJugador", Operacion, 10);
                }
            }
        }