Example #1
0
        /// <summary>
        /// Updates the AvailableSearchChoices list with the options per the search category
        /// </summary>
        private void UseSelectedSearchCategory(EventRecipientsTypes searchCategory)
        {
            AvailableSearchChoices = CreateRecipientsList(searchCategory);

            // Use the first choice in the AvailableSearchChoices dictioanry as the default choice
            if (AvailableSearchChoices.Count > 0)
            {
                SelectedSearchChoice = AvailableSearchChoices.First().Key;
            }
        }
 /// <summary>
 /// Assistant method that clears all the ViewModel properties
 /// </summary>
 private void ResetData()
 {
     AvailableSearchChoices.Clear();
     LessonsTableData.Clear();
     AvailableClasses.Clear();
     AvailableCourses.Clear();
     AvailableTeachers.Clear();
     AvailableRooms.Clear();
     SelectedLesson       = null;
     SelectedSearchChoice = NOT_ASSIGNED;
     SelectedTeacher      = NOT_ASSIGNED;
     SelectedClass        = NOT_ASSIGNED;
     LessonFirstDay       = NOT_ASSIGNED;
     LessonSecondDay      = NOT_ASSIGNED;
     LessonThirdDay       = NOT_ASSIGNED;
     LessonFourthDay      = NOT_ASSIGNED;
     LessonFirstHour      = NOT_ASSIGNED;
     LessonSecondHour     = NOT_ASSIGNED;
     LessonThirdHour      = NOT_ASSIGNED;
     LessonFourthHour     = NOT_ASSIGNED;
 }
        /// <summary>
        /// Updates the AvailableSearchChoices list with the options per the search category
        /// </summary>
        /// <param name="category">The category to search by</param>
        private void UseSelectedSearchCategory(SearchCategory category)
        {
            // Check which category the search choice is from, and fill the LessonsTableData with the relevent lessons
            if (category == SearchCategory.Classes)
            {
                // Find the class that was chosen, and get its lessons
                AvailableSearchChoices = AvailableClasses;
            }
            else if (category == SearchCategory.Courses)
            {
                // Find the course that was chosen, and get its lessons
                AvailableSearchChoices = AvailableCourses;
            }
            else if (category == SearchCategory.Teachers)
            {
                AvailableSearchChoices = AvailableTeachers;
            }
            else
            {
                throw new ArgumentException("Couldn't use search category - unknown category type");
            }

            SelectedSearchChoice = AvailableSearchChoices.First().Key;
        }