コード例 #1
0
        public MemberStatistics CreateMemberStatistics(Member member)
        {
            MemberStatistics memberStatistics = new MemberStatistics() { MemberID = member.ID };
            _dbContext.MemberStatistics.Add(memberStatistics);

            return memberStatistics;
        }
コード例 #2
0
        public void SaveMember(Member member)
        {
            if (member.ID == 0)
            {
                _dbContext.Members.Add(member);
            }

            _dbContext.SaveChanges();
        }
コード例 #3
0
        public PagedList<EarnedAchievement> GetPagedEarnedAchievementsForMember(Member member, int currentPage, int pageSize, int pageLinksToDisplay)
        {
            var contentKeys = _contentTypeRepository.GetContentKeysForContentType(member);

            return _earnedAchievementsRepository.EarnedAchievements
                .Where(x => x.ContentTypeID == contentKeys.ContentTypeID && x.ContentObjectPK == contentKeys.ContentObjectPK)
                .OrderByDescending(x => x.Created)
                .ToPagedList(currentPage, pageSize, pageLinksToDisplay);
        }
コード例 #4
0
        protected void assignAchievementToMember(Member member, AchievementID achievementID)
        {
            Achievement achievement = _achievementsRepo.Achievements.FirstOrDefault(x => x.ID == (long)achievementID);

            if (achievement != null)
            {
                assignAchievementToMember(member, achievement);
            }
        }
コード例 #5
0
        protected void assignAchievementToMember(Member member, Achievement achievement)
        {
            long contentTypeID = _contentTypesRepo.GetIDForContentType(member);

            Boolean achievementAlreadyEarned = _earnedAchievementsRepo.EarnedAchievements.Any(x => x.AchievementID == achievement.ID && x.ContentObjectPK == member.ID && x.ContentTypeID == contentTypeID);

            if (!achievementAlreadyEarned)
            {
                EarnedAchievement earnedAchievement = new EarnedAchievement()
                {
                    ContentObjectPK = member.ID,
                    ContentTypeID = contentTypeID,
                    AchievementID = achievement.ID,
                    Created = DateTime.Now
                };

                _earnedAchievementsRepo.SaveEarnedAchievement(earnedAchievement);
            }
        }
コード例 #6
0
 public void DeleteMember(Member member)
 {
     _dbContext.Members.Remove(member);
 }
コード例 #7
0
 public IQueryable<Vote> VotesForMember(Member member)
 {
     return _dbContext.Votes.Where(vote => vote.MemberID == member.ID);
 }
コード例 #8
0
 public MemberRegisteredEvent(Member registeredMember)
 {
     this.RegisteredMember = registeredMember;
 }
コード例 #9
0
        public bool LogInMember(Member member)
        {
            if (member != null)
            {
                LoggedInMember = member;
                return true;
            }

            return false;
        }
コード例 #10
0
        public void RegisterMember(Member member)
        {
            member.Password = EncryptPassword(member.Password);

            MembersRepository.SaveMember(member);

            LogInMember(member);

            _eventAggregator.SendMessage(new MemberRegisteredEvent(member));
        }