public DojoMemberCollection Clone() { DojoMemberCollection clonedDojoMember = new DojoMemberCollection(count); lock (this) { foreach (DojoMember item in this) { clonedDojoMember.Add(item); } } return(clonedDojoMember); }
public DojoMemberCollection GetEligibleMembers(DojoTest test) { DojoMemberManager m; DojoMemberCollection members; DojoMemberCollection eligibleMembers; // Load active members eligibleMembers = new DojoMemberCollection(); m = new DojoMemberManager(); members = m.GetCollection("DojoMember.IsPrimaryOrgActive=true", "DojoMember.RankID, DojoMember.RankDate DESC", new DojoMemberFlags[] { DojoMemberFlags.PrivateContact, DojoMemberFlags.Rank }); // Create temp test if none specified if (test == null) { test = new DojoTest(); test.TestDate = DateTime.Now; } // Add members that satisfy requirements foreach (DojoMember member in members) { if (member.Rank.PromotionRank != null) { if (member.TestEligibilityDate <= DateTime.Now & member.TestEligibilityHoursBalance >= TimeSpan.Zero) { eligibleMembers.Add(member); } } } return(eligibleMembers); }
public void CompileTestList(DojoTestList list) { TestCandidateCollection buildResults; DojoMemberCollection compile; TestCandidate candidate; buildResults = BuildTestList(list); compile = new DojoMemberCollection(buildResults.Count); for (int i = 0; i < buildResults.Count; i++) { candidate = buildResults[i]; if (!candidate.IsRemoved) { compile.Add(candidate.Member); } } list.Candidates = compile; list.CandidatesCompileDate = DateTime.Now; list.Save(); }