Esempio n. 1
0
        public static CardList getPageItems(CardSearchModel model, int numPage)
        {
            CardList displayCards = new CardList();

            displayCards.PageNum = numPage;
            int nbrCards = model.AllCards.Count();

            displayCards.PageCount = (int)Math.Floor((decimal)(nbrCards / displayCards.PageSize)) + 1;
            displayCards.Cards     = model.AllCards.Skip(displayCards.PageSize * (numPage - 1)).Take(displayCards.PageSize);
            return(displayCards);
        }
Esempio n. 2
0
        public static DeckBuilder getPageItems(CardSearchModel model, int numPage)
        {
            DeckBuilder displayCards = new DeckBuilder();

            displayCards.PageNum = numPage;
            int nbrCards = model.AllCards.Count();

            displayCards.PageCount = (int)Math.Floor((decimal)(nbrCards / displayCards.PageSize)) + 1;
            displayCards.Cards     = model.AllCards.Skip(displayCards.PageSize * (numPage - 1)).Take(displayCards.PageSize);
            //KeyValuePair<string, int> DeckCards = new List<KeyValuePair<string, int>>();
            foreach (CardModel card in displayCards.Cards)
            {
                displayCards.DeckCards.Add(new KeyValuePair <string, int>(card.Id, 0));
            }
            return(displayCards);
        }