/// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void RenderContent(HtmlTextWriter output)
        {
            DojoTestListJournalEntryManager    m = new DojoTestListJournalEntryManager();
            DojoTestListJournalEntryCollection dojoTestListJournalEntryCollection = m.GetCollection(string.Empty, string.Empty, null);

            // Render Header Row
            this.headerLockEnabled = true;
            RenderRow(this.HeaderRowCssClass, "Entry");

            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DojoTestListJournalEntry dojoTestListJournalEntry in dojoTestListJournalEntryCollection)
            {
                if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", dojoTestListJournalEntry.ID.ToString());
                output.WriteLine(HtmlTextWriter.TagRightChar);
                output.Indent++;
                output.WriteBeginTag("td");
                output.WriteAttribute("class", rowCssClass);
                output.Write(HtmlTextWriter.TagRightChar);
                output.Write(dojoTestListJournalEntry.Member.PrivateContact.ConstructName("L,FMi"));
                output.WriteEndTag("td");
                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }
Exemple #2
0
        public TestCandidateCollection BuildTestList(DojoTestList list)
        {
            DojoTestListJournalEntryManager    journal;
            DojoTestListJournalEntryCollection entries;
            DojoTestListJournalEntry           entry;
            DojoTestListJournalEntry           lastEntry;
            DojoTestListJournalEntryType       type;
            TestCandidate           candidate;
            TestCandidateCollection candidates;

            journal =
                new DojoTestListJournalEntryManager();

            // Get journal entries by testlist and be sure to sort by
            // member and create date. This will allow processing members
            // without nested loops.
            entries =
                journal.GetCollection("TestListID=" + list.ID.ToString(),
                                      "RankID, " +
                                      "LastName, " +
                                      "FirstName, " +
                                      "MemberID, " +
                                      "Member.CreateDate ASC",
                                      DojoTestListJournalEntryFlags.Member,
                                      DojoTestListJournalEntryFlags.MemberPrivateContact);

            if (entries.Count > 0)
            {
                candidates = new TestCandidateCollection();
                candidate  = new TestCandidate(entries[0].Member);
                lastEntry  = entries[0];
                type       = lastEntry.EntryType;

                for (int i = 0; i < entries.Count; i++)
                {
                    entry = entries[i];

                    // If the new entry's member does not match the
                    // last member, then check to see if the last
                    // member was left in the add state. If so, add
                    // the member to the candidates list.
                    // The candidate's last type becomes the status
                    if (candidate.Member.ID != entry.Member.ID)
                    {
                        candidate.LastEntry = lastEntry;
                        candidates.Add(candidate);
                        candidate = new TestCandidate(entry.Member);
                    }

                    lastEntry = entry;
                    type      = entry.EntryType;

                    // Enable memberAdd flag if the entry
                    // was added.
                    if (entry.EntryType.Eligible)
                    {
                        candidate.IsRemoved = false;
                        candidate.Eligibility.Add(entry);
                    }

                    // Disable memberAdd flag if the entry
                    // was removed.
                    if (entry.EntryType.Ineligible)
                    {
                        candidate.IsRemoved = true;
                        candidate.Eligibility.Add(entry);
                    }

                    if (entry.EntryType.CertificateRequest |
                        entry.EntryType.CertificatePending |
                        entry.EntryType.CertificateReceived)
                    {
                        candidate.Certification.Add(entry);
                    }
                }

                // Process Last Entry
                candidate.LastEntry = lastEntry;
                candidates.Add(candidate);
            }
            else
            {
                candidates = null;
            }

            return(candidates);
        }