public ActionResult DeleteChampion(Guid championId, Guid playerId)
        {
            var dal    = new DALChampionPool();
            int result = dal.DeleteChampion(championId, playerId);

            //TODO : manage result value
            return(RedirectToAction("ChampionPool", new { playerId = playerId }));
        }
        // GET: ChampionPool
        public ActionResult ChampionPool(Guid playerId)
        {
            var dal            = new DALChampionPool();
            var MyChampionPool = dal.getChampionPool(playerId);

            ViewBag.ListChampions = SelectListHelper.getAllChampions();
            ViewBag.PlayerId      = playerId;
            ViewBag.Nickname      = new DAL().getPlayerById(playerId).Nickname;

            return(View(MyChampionPool));
        }
예제 #3
0
        public ActionResult SearchMatchup(Guid playerId)
        {
            ViewBag.PlayerId = playerId;
            var champPoolDal = new DALChampionPool();
            var playerDal    = new DAL();
            var player       = playerDal.getPlayerById(playerId);

            ViewBag.Role          = player?.Role;
            ViewBag.Nickname      = player?.Nickname;
            ViewBag.MyChampList   = champPoolDal.getChampionPool(playerId);
            ViewBag.ListChampions = SelectListHelper.getAllChampions();
            return(View());
        }
예제 #4
0
        // GET: Tag
        public ActionResult Tag(Guid playerId)
        {
            var dalChampionPool = new DALChampionPool();
            var dalTag          = new DALTag();

            ViewBag.MyChampionPool  = dalChampionPool.getChampionPool(playerId);
            ViewBag.PlayerId        = playerId;
            ViewBag.Nickname        = new DAL().getPlayerById(playerId).Nickname;
            ViewBag.ListTags        = SelectListHelper.getAllTags(playerId);
            ViewBag.ListChampionTag = dalTag.GetAllChampionTagsByPlayerId(playerId);
            var tags = dalTag.GetAllTagsByPlayerId(playerId);

            return(View(tags));
        }
        public ActionResult CooldownChampion(FormCollection form)
        {
            var    champId   = form["listChamp"];
            string champName = new DALChampionPool().GetChampionByChampionId(Guid.Parse(champId)).ChampionName;
            string json      = "";

            using (WebClient wc = new WebClient())
            {
                var url        = ConfigurationManager.AppSettings["UrlChamp"] + champName + ".json";
                var stringJson = wc.DownloadString(url);
                var obj        = JObject.Parse(stringJson);
                json = obj.SelectToken("data").Last.Last.ToString();
            }
            var championInfo = JsonConvert.DeserializeObject <ChampionJsonToObject>(json);
            ChampionSpellInfosViewModel csvm = CreateChampionSpellInfoViewModel(championInfo);

            return(View(csvm));
        }
예제 #6
0
        public ActionResult CustomMatchup(Guid playerId, Guid matchupId)
        {
            ViewBag.PlayerId = playerId;
            var dal          = new DAL();
            var champPoolDal = new DALChampionPool();
            var playerDal    = new DAL();

            ViewBag.MyChampList   = champPoolDal.getChampionPool(playerId);
            ViewBag.ListChampions = SelectListHelper.getAllChampions();
            var player = playerDal.getPlayerById(playerId);

            ViewBag.Role     = player?.Role;
            ViewBag.Nickname = player?.Nickname;
            if (matchupId != Guid.Empty)
            {
                var matchupDal = new DALMatchup();
                var matchup    = matchupDal.getMatchupByMatchupId(matchupId);
                ViewBag.MatchupId = matchupId;
                return(View("Matchup", matchup));
            }
            return(RedirectToAction("Matchup", new { matchupId = matchupId }));
        }