public MemberStatistics CreateMemberStatistics(Member member) { MemberStatistics memberStatistics = new MemberStatistics() { MemberID = member.ID }; _dbContext.MemberStatistics.Add(memberStatistics); return memberStatistics; }
public void SaveMember(Member member) { if (member.ID == 0) { _dbContext.Members.Add(member); } _dbContext.SaveChanges(); }
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); }
protected void assignAchievementToMember(Member member, AchievementID achievementID) { Achievement achievement = _achievementsRepo.Achievements.FirstOrDefault(x => x.ID == (long)achievementID); if (achievement != null) { assignAchievementToMember(member, achievement); } }
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); } }
public void DeleteMember(Member member) { _dbContext.Members.Remove(member); }
public IQueryable<Vote> VotesForMember(Member member) { return _dbContext.Votes.Where(vote => vote.MemberID == member.ID); }
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)); }