Esempio n. 1
0
        private void DisplayTwoCats()
        {
            nbVotes = getNbCats();

            if ((SessionHelper.Get <List <Cat> >("Cats")) != null)
            {
                var catsForVote = SessionHelper.Get <List <Cat> >("Cats");
                if (catsForVote != null)
                {
                    var twoCats = CatsHelper.Random <Cat>(catsForVote);
                    btnLeftCat.ImageUrl = twoCats.First().url;
                    leftCatId.Value     = twoCats.First().id;

                    var rightCat = CatsHelper.Random <Cat>(catsForVote);
                    btnRightCat.ImageUrl = twoCats.Last().url;
                    rightCatId.Value     = twoCats.Last().id;
                }
            }
        }
Esempio n. 2
0
 private void LoadCats()
 {
     SessionHelper.Set <List <Cat> >("Cats", CatsHelper.GetCats("https://latelier.co/data/cats.json"));
 }