Exemplo n.º 1
0
        public ActionResult GetDailyActivityAutoComplete(string id, long paramPlayerID, enumDailyActivityTypes activityType)
        {
            PlayerDailyActivityRepository playerDailyActivityRepo = new PlayerDailyActivityRepository();
            var data = playerDailyActivityRepo.GetDailyActivityAutoComplete(paramPlayerID, activityType);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult _GetPlayerDailyActivity(long PlayerID, DateTime ActivityDate)
        {
            PlayerDailyActivityRepository pdaRepo = new PlayerDailyActivityRepository();

            var activity = pdaRepo.ReadOne(PlayerID, ActivityDate, this);

            return(PartialView(activity));
        }
Exemplo n.º 3
0
        //public ActionResult GetPlayerLeagueCoach(string id, long PlayerID)
        //{
        //    PlayersRepository playerRepo = new PlayersRepository();
        //    var result = playerRepo.GetPlayerLeagueCoach(PlayerID);

        //    return new JsonResult { Data = new { CoachUserID = result.CoachUserID, CoachFullName = result.CoachFullName, CoachEmail = result.CoachEmail } };
        //}

        //public ActionResult GetPlayerTeamEmails(string id, long PlayerID)
        //{
        //    PlayersRepository playerRepo = new PlayersRepository();
        //    var result = playerRepo.GetPlayerTeamMemberEmailAddresses(PlayerID);

        //    return new JsonResult { Data = new { TeamEmailAddresses = result } };
        //}

        public ActionResult ShareActivityData(string id, ShareActivity model)
        {
            if (model.ActivityTypeId == 1) //Daily Activity
            {
                PlayerDailyActivityRepository modelRepo = new PlayerDailyActivityRepository();
                modelRepo.ShareActivity(model, this);
            }
            else if (model.ActivityTypeId == 2) //Weekly Activity
            {
                PlayerWeeklyActivityRepository modelRepo = new PlayerWeeklyActivityRepository();
                modelRepo.ShareActivity(model, this);
            }

            return(new JsonResult {
                Data = true
            });
        }
Exemplo n.º 4
0
        public ActionResult SaveActivityData(PlayerDailyActivityExt model)
        {
            string Msg    = "";
            bool   status = true;
            PlayerDailyActivityRepository pdaRepo = new PlayerDailyActivityRepository();

            pdaRepo.CreateOrUpdate(model, ref Msg, ref status, this);

            if (status)
            {
                AchievementsRepository achRepo = new AchievementsRepository();

                Guid guid = Guid.NewGuid();
                AchievementThread      = new Thread(() => achRepo.DailyActivity_AchievementPoints(model.PlayerID, AchievementThread));
                AchievementThread.Name = "DailyActivity_AchievementPoints_" + guid.ToString();
                AchievementThread.Start();
            }

            return(new JsonResult {
                Data = true
            });
        }