Пример #1
0
        public void saveScore(Models.Scorecard scorecard)
        {
            ScoreRepository repo  = new ScoreRepository();
            Score           score = new Score()
            {
                HoleID       = scorecard.HoleID,
                Value        = scorecard.Value,
                TeamID       = scorecard.TeamID,
                DateUpdated  = DateTime.Now,
                DateInserted = scorecard.ID == 0 ? DateTime.Now : scorecard.DateInserted,
                ID           = scorecard.ID
            };

            repo.InsertOrUpdate(score);
            repo.Save();
            SendTeamScoreUpdate(score.TeamID);
            SendLeaderboardUpdate();
        }