Esempio n. 1
0
        public JsonResult deleteMatchup(Guid matchupId, Guid matchupResponseId)
        {
            var dal    = new DALMatchup();
            int result = dal.deleteMatchup(matchupId, matchupResponseId);

            return(Json("", JsonRequestBehavior.AllowGet));
        }
        public JsonResult ComputeDraft(DraftInfos draftInfos)
        {
            var matchupDal = new DALMatchup();
            var dal        = new DAL();

            var toplaner = dal.getPlayerByName("Vince");
            var jungler  = dal.getPlayerByName("Zokato");
            var mid      = dal.getPlayerByName("Decay");
            var adc      = dal.getPlayerByName("Neylan");
            var support  = dal.getPlayerByName("Dee");

            var listAnswerTop     = matchupDal.getAnswersForDraftByPlayer(toplaner.PlayerId, draftInfos);
            var listAnswerungle   = matchupDal.getAnswersForDraftByPlayer(jungler.PlayerId, draftInfos);
            var listAnswerMid     = matchupDal.getAnswersForDraftByPlayer(mid.PlayerId, draftInfos);
            var listAnswerAdc     = matchupDal.getAnswersForDraftByPlayer(adc.PlayerId, draftInfos);
            var listAnswerSupport = matchupDal.getAnswersForDraftByPlayer(support.PlayerId, draftInfos);

            var listAllAnswers = new List <List <Champion> >();

            listAllAnswers.Add(listAnswerTop);
            listAllAnswers.Add(listAnswerungle);
            listAllAnswers.Add(listAnswerMid);
            listAllAnswers.Add(listAnswerAdc);
            listAllAnswers.Add(listAnswerSupport);

            return(Json(listAllAnswers, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public JsonResult AddMatchup(MatchupInfos obj)
        {
            var dal    = new DALMatchup();
            int result = dal.AddMatchup(obj);

            return(Json("", JsonRequestBehavior.AllowGet));
        }
Esempio n. 4
0
        public JsonResult CreateNewMatchup(Guid playerId, MatchupInfos obj)
        {
            var dalMatchup = new DALMatchup();
            var matchupId  = dalMatchup.createNewMatchup(playerId, obj);

            if (matchupId != Guid.Empty)
            {
                return(Json(matchupId, JsonRequestBehavior.AllowGet));
            }
            return(Json(null, JsonRequestBehavior.AllowGet));
        }
Esempio n. 5
0
        public ActionResult UpdateSearchResultsBestAnswers(Guid playerId, string championId)
        {
            var       matchupDal     = new DALMatchup();
            Stopwatch s              = new Stopwatch();
            var       guidChampionId = Guid.Parse(championId);

            s.Start();
            var listMatchupInfos = matchupDal.getAllMatchupByBestAnswer(playerId, guidChampionId);

            s.Stop();
            ViewBag.CalculationTime = listMatchupInfos.Item2 / 1000d;
            return(PartialView("SearchResults", listMatchupInfos.Item1));
        }
Esempio n. 6
0
        public ActionResult UpdateSearchResults(Guid playerId, MatchupInfos matchupInfos)
        {
            var       matchupDal = new DALMatchup();
            Stopwatch s          = new Stopwatch();

            s.Start();
            var listMatchupInfos = matchupDal.getAllMatchupByParams(playerId, matchupInfos);

            s.Stop();
            ViewBag.CalculationTime  = listMatchupInfos.Item2 / 1000d;
            ViewBag.AutomaticResults = listMatchupInfos.Item3;
            return(PartialView("SearchResults", listMatchupInfos.Item1));
        }
Esempio n. 7
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 }));
        }