Example #1
0
        private void agregarItem()
        {
            bool existe = false;


            foreach (var item in (List <Juego>)Session["listaFav"])
            {
                if (item.ID == juegoBuscado.ID && item.PlataformaJuego.ID == juegoBuscado.PlataformaJuego.ID)
                {
                    existe = true; //
                }
            }
            if (!existe)
            {
                negocio.AgregarFavorito(IDUsuario, IDJuego, IDPlat);   //agrega en la DB
                ((List <Juego>)Session["listaFav"]).Add(juegoBuscado); //agrega a la session
            }
        }