public ActionResult Guild(string region, string server, string guildName, int? start, int? size)
        {
            int realStart = 0;
            int realSize = 100;

            if (start != null)
            {
                realStart = start.Value;
            }

            if (size != null)
            {
                realSize = size.Value;
            }

            IList<Character> roster = _worldRepository.GetCharactersInGuild(region, server, guildName);

            int count = roster.Count;
            var characters = roster.Skip(realStart).Take(realSize).ToList();

            CharacterList listOfCharacters = new CharacterList()
            {
                Characters = characters,
                TotalNumber = count,
                PageSize = realSize
            };
            return View(listOfCharacters);
        }
예제 #2
0
        public ActionResult All(int? start, int? size)
        {
            int realStart = 0;
            int realSize = 100;

            if (start != null)
            {
                realStart = start.Value;
            }

            if (size != null)
            {
                realSize = size.Value;
            }

            int count = _characterRepository.FindAll().Count;
            var characters = _characterRepository.FindAll().OrderByDescending(c => c.CurrentPoints).Skip(realStart).Take(realSize).ToList();
            CharacterList listOfCharacters = new CharacterList()
            {
                Characters = characters,
                TotalNumber = count,
                PageSize = realSize
            };

            return View(listOfCharacters);
        }
예제 #3
0
        public ActionResult Search(string query)
        {
            var characterList = _characterRepository.SearchByName(string.Format(".*{0}.*", query));
            CharacterList listOfCharacters = new CharacterList()
            {
                Characters = characterList,
                TotalNumber = characterList.Count,
                PageSize = 100
            };

            return View(listOfCharacters);
        }
        public ActionResult ServerRanking(string region, string server, int? start, int? size)
        {
            int realStart = 0;
            int realSize = 100;

            if (start != null)
            {
                realStart = start.Value;
            }

            if (size != null)
            {
                realSize = size.Value;
            }

            int count = _worldRepository.NumberCharactersOnServer(region, server);
            var characters = _worldRepository.ListCharactersOnServerByPoints(region, server, realStart, realSize);

            CharacterList listOfCharacters = new CharacterList()
            {
                Characters = characters,
                TotalNumber = count,
                PageSize = realSize
            };

            return View(listOfCharacters);
        }