Example #1
0
        public JsonResult Add(GameParticipationViewModel gameParticipationViewModel)
        {
            var dbGameParticipation = Mapper.Map <GameParticipation>(gameParticipationViewModel);

            _gameParticipationService.AddGameParticipation(dbGameParticipation);
            return(Json(null, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public void EditGameTableParticipations(List <GameParticipation> gameParticipations, Gamer modifiedGamer)
        {
            foreach (var gameParticipation in gameParticipations)
            {
                var dbGameParticipation = _gameParticipationService.GetGameParticipation(gameParticipation.Id);
                if (dbGameParticipation != null)
                {
                    _gameParticipationService.Edit(gameParticipation);
                }
                else
                {
                    _gameParticipationService.AddGameParticipation(gameParticipation);
                }
            }

            _gameTableRepository.EditGameTableParticipations(gameParticipations, modifiedGamer);
        }