Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (coordenadaX.Items.Count == 0)
            {
                Session.Add("desplegadas", "0");
                n0      = ws.getDatoInt(0);
                n1      = ws.getDatoInt(1);
                n2      = ws.getDatoInt(2);
                n3      = ws.getDatoInt(3);
                y       = ws.getDatoInt(5);
                x       = ws.getDatoInt(4);
                jugador = ws.getJugador(Session["nickname"].ToString());

                for (int i = 0; i < x; i++)
                {
                    coordenadaX.Items.Add(Convert.ToChar(65 + i).ToString());
                    baseX.Items.Add(Convert.ToChar(65 + i).ToString());
                }

                int    medio    = y / 2;
                String nickname = Session["nickname"].ToString();
                if (ws.getJugador(nickname) == 1)
                {
                    for (int i = 1; i <= medio; i++)
                    {
                        coordenadaY.Items.Add(i.ToString());
                        baseY.Items.Add(i.ToString());
                    }
                }
                else
                {
                    for (int i = medio + 1; i <= y; i++)
                    {
                        coordenadaY.Items.Add(i.ToString());
                        baseY.Items.Add(i.ToString());
                    }
                }
            }


            if (ws.getTipo().Equals("Base"))
            {
                panelBase.Visible   = true;
                panelTiempo.Visible = false;
            }
            else if (ws.getTipo().Equals("Tiempo"))
            {
                if (ws.getTiempo().Equals(""))
                {
                    panelBase.Visible   = false;
                    panelTiempo.Visible = true;
                }
            }
            else
            {
                panelBase.Visible   = false;
                panelTiempo.Visible = false;
            }
        }