Пример #1
0
        public ActionResult GetWeeklyActivityAutoComplete(string id, long paramPlayerID)
        {
            PlayerWeeklyActivityRepository playerWeeklyActivityRepo = new PlayerWeeklyActivityRepository();
            var data = playerWeeklyActivityRepo.GeWeeklyActivityAutoComplete(paramPlayerID);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult _GetPlayerWeeklyActivity(long PlayerID, DateTime ActivityDate)
        {
            PlayerWeeklyActivityRepository pweeklyRepo = new PlayerWeeklyActivityRepository();

            var activity = pweeklyRepo.GetWeeklyActivityData(PlayerID, ActivityDate, this);

            return(PartialView(activity));
        }
Пример #3
0
        public ActionResult RemoveWeeklyActivity(long PlayerWeeklyActivityID)
        {
            PlayerWeeklyActivityRepository pweeklyRepo = new PlayerWeeklyActivityRepository();

            pweeklyRepo.DeleteWeeklyActivity(PlayerWeeklyActivityID, this);

            return(new JsonResult {
                Data = true
            });
        }
Пример #4
0
        public ActionResult _AddNewWeeklyActivity(vmWeeklyActivity model)
        {
            PlayerWeeklyActivityExt m = new PlayerWeeklyActivityExt()
            {
                PlayerID     = model.PlayerID,
                ActivityDate = model.ActivityDate
            };
            string Msg    = "";
            bool   status = true;

            PlayerWeeklyActivityRepository pweeklyRepo = new PlayerWeeklyActivityRepository();

            m.PlayerWeeklyActivityID = pweeklyRepo.CreateOrUpdate(m, ref Msg, ref status, this);

            return(PartialView(m));
        }
Пример #5
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
            });
        }
Пример #6
0
        public ActionResult GetWeeklyActivityTime(int?ParamActivityTime)
        {
            PlayerWeeklyActivityRepository modelRepo     = new PlayerWeeklyActivityRepository();
            List <SelectListItem>          ListOfObejcts = new List <SelectListItem>();

            for (int i = 15; i <= 180; i = i + 15)
            {
                SelectListItem item = new SelectListItem()
                {
                    Text     = modelRepo.ActivityMinutesToString(i),
                    Value    = i.ToString(),
                    Selected = ParamActivityTime == i
                };

                ListOfObejcts.Add(item);
            }

            SelectList result = new SelectList(ListOfObejcts, "Value", "Text");

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #7
0
        public ActionResult SaveWeeklyActivityData(PlayerWeeklyActivityExt model)
        {
            string Msg    = "";
            bool   status = true;
            PlayerWeeklyActivityRepository pweeklyRepo = new PlayerWeeklyActivityRepository();

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

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

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

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