Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Seguridad.ThereAreUserInSession())
        {
            Response.Redirect("login.aspx");
        }

        string idPokemon = Request["idPokemon"];

        if (idPokemon == null)
        {
            Response.Redirect("Usuario.aspx");
        }

        if (IsPostBack)
        {
            return;
        }

        Usuario user = Seguridad.GetUserInSession();

        GridViewPokemones.DataSource = PokemonBRL.getPokemones(user.Codigo_id);
        GridViewPokemones.DataBind();

        if (GridViewPokemones.Rows.Count <= 0)
        {
            Response.Redirect("Seleccion.aspx");
        }

        if (PokemonUsuarioBRL.getUsuarioPokemon(Seguridad.GetUserInSession().NickName, Seguridad.GetUserInSession().Password) == 0)
        {
            Response.Redirect("Seleccion.aspx");
        }

        if (PokemonUsuarioBRL.getUsuarioPokemonAtaque(Seguridad.GetUserInSession().Codigo_id, Convert.ToInt32(idPokemon)) > 0)
        {
            Response.Redirect("Usuario.aspx");
        }

        GridViewAtaques.DataSource = AtaquesBRL.getAtaquesByTipo(Convert.ToInt32(GridViewPokemones.Rows[0].Cells[0].Text));
        GridViewAtaques.DataBind();
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Seguridad.ThereAreUserInSession())
        {
            Response.Redirect("login.aspx");
        }
        string id = Request["id"];

        if (id == null)
        {
            Response.Redirect("Usuario.aspx");
        }

        if (IsPostBack)
        {
            return;
        }

        //Usuario user = Seguridad.GetUserInSession();
        //GridViewPokemones.DataSource = PokemonBRL.getPokemones(user.Codigo_id);
        //GridViewPokemones.DataBind();
        GridViewPokemones.DataSource = PokemonBRL.getPokemones(Seguridad.GetUserInSession().Codigo_id);
        GridViewPokemones.DataBind();
    }