Example #1
0
        /// <summary>
        /// Finds all notes that should be listed based on the current date of the calendar
        /// </summary>
        /// <returns></returns>
        public List <Note> findNotesToList()
        {
            List <Note> listOfNotes = new List <Note>();

            foreach (Note n in GeneralNoteList)
            {
                if (n.Importance == AlertScope.global && calendar.isAnniversary(n.Date) || (n.Importance == AlertScope.dontAlert && calendar.sameDate(n.Date)))
                {
                    listOfNotes.Add(n);
                }
            }

            foreach (Campaign c in CampaignList)
            {
                foreach (Note n in c.notes)
                {
                    if (c.Equals(activeCampaign)) // If the note belongs to current campaign, and has appropriate visibilty, and is anniversary of this date
                    {
                        if ((n.Importance == AlertScope.campaign || n.Importance == AlertScope.global) && calendar.isAnniversary(n.Date))
                        {
                            if (n.NoteContent.Equals("Current Date") == false) // don't print the current date of current campaign, as that is always the current date
                            {
                                listOfNotes.Add(n);
                            }
                        }
                        else if (n.Importance == AlertScope.dontAlert && calendar.sameDate(n.Date))
                        {
                            listOfNotes.Add(n);
                        }
                    }

                    else // If the note does not belong in the current campaign
                    if ((n.Importance == AlertScope.global) && calendar.isAnniversary(n.Date))     // if the note happened on this day and is of                                                                                        // sufficient importance level
                    {
                        listOfNotes.Add(n);
                    }
                } // end foreach note
            }     // end foreach campaign

            return(listOfNotes);
        }