Esempio n. 1
0
        public ActionResult Play()
        {
            Guid   guid  = (Guid)Membership.GetUser().ProviderUserKey;
            GameVM model = new GameVM();

            model.Event        = db.GetEventByYear((int)HttpContext.Profile.GetPropertyValue("CurrentGame"));
            model.EventPlayer  = db.GetCurrentEventPlayer(model.Event.Year, guid);
            model.PlayerScores = db.GetPlayerScoresForYear(model.Event.Year, guid);
            return(View(model));
        }
        public ActionResult Wackiest(int id)
        {
            PlayerEventCountryScore pecs = db.GetPlayerScoreByID(id);

            //get current user
            Guid playerID = pecs.PlayerGuid;

            //get any fattest scores==true
            var Wackos = db.GetPlayerScoresForYear(pecs.EventCountry.Event.Year, playerID).Where(x => x.Wackiest == true);

            if (Wackos.Count() > 0)
            {
                return(Json(new { success = true, matches = Wackos.Select(x => x.EventCountry.Country.Name) }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
            }
        }