public MemberStatistics CreateMemberStatistics(Member member)
        {
            MemberStatistics memberStatistics = new MemberStatistics() { MemberID = member.ID };
            _dbContext.MemberStatistics.Add(memberStatistics);

            return memberStatistics;
        }
Exemplo n.º 2
0
        public void SaveMember(Member member)
        {
            if (member.ID == 0)
            {
                _dbContext.Members.Add(member);
            }

            _dbContext.SaveChanges();
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 6
0
 public void DeleteMember(Member member)
 {
     _dbContext.Members.Remove(member);
 }
Exemplo n.º 7
0
 public IQueryable<Vote> VotesForMember(Member member)
 {
     return _dbContext.Votes.Where(vote => vote.MemberID == member.ID);
 }
Exemplo n.º 8
0
 public MemberRegisteredEvent(Member registeredMember)
 {
     this.RegisteredMember = registeredMember;
 }
        public bool LogInMember(Member member)
        {
            if (member != null)
            {
                LoggedInMember = member;
                return true;
            }

            return false;
        }
        public void RegisterMember(Member member)
        {
            member.Password = EncryptPassword(member.Password);

            MembersRepository.SaveMember(member);

            LogInMember(member);

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