/// <summary>
        /// The add possible value.
        /// </summary>
        /// <param name="possibleValue">
        /// The possible value.
        /// </param>
        /// <param name="key">
        /// The key.
        /// </param>
        public void AddPossibleValue(UPMRepPossibleValue possibleValue, string key)
        {
            if (this.possibleValues == null)
            {
                this.possibleValues = new Dictionary <string, UPMRepPossibleValue>();
            }

            string groupKey = possibleValue.RepOrgGroupId;

            if (!string.IsNullOrEmpty(groupKey))
            {
                UPMRepPossibleValue groupValue = this.possibleGroups.ValueOrDefault(groupKey);
                if (groupValue != null && groupValue.GroupReps == null)
                {
                    groupValue.GroupReps = new List <UPMRepPossibleValue>();
                }

                if (groupValue != null)
                {
                    groupValue.GroupReps.Add(possibleValue);
                    this.possibleGroups.SetObjectForKey(groupValue, groupKey);
                }
            }

            this.possibleValues.SetObjectForKey(possibleValue, key);
        }
        /// <summary>
        /// The add root rep group.
        /// </summary>
        /// <param name="repOrgGroup">
        /// The rep org group.
        /// </param>
        /// <returns>
        /// The <see cref="UPMRepEditFieldFilter"/>.
        /// </returns>
        public UPMRepEditFieldFilter AddRootRepGroup(UPMRepPossibleValue repOrgGroup)
        {
            if (repOrgGroup == null)
            {
                return(null);
            }

            if (this.RepEditFieldFilters == null)
            {
                this.RepEditFieldFilters = new List <UPMRepEditFieldFilter>();
            }

            UPMRepEditFieldFilter repEditFieldFilter = new UPMRepEditFieldFilter(repOrgGroup);

            if (this.RepEditFieldFilters.Contains(repEditFieldFilter) == false)
            {
                this.RepEditFieldFilters.Add(repEditFieldFilter);
            }
            else
            {
                repEditFieldFilter = this.RepEditFieldFilters[this.RepEditFieldFilters.IndexOf(repEditFieldFilter)];
            }

            return(repEditFieldFilter);
        }
        /// <summary>
        /// The add possible rep group value.
        /// </summary>
        /// <param name="possibleValue">
        /// The possible value.
        /// </param>
        /// <param name="key">
        /// The key.
        /// </param>
        public void AddPossibleRepGroupValue(UPMRepPossibleValue possibleValue, string key)
        {
            if (this.possibleGroups == null)
            {
                this.possibleGroups = new Dictionary <string, UPMRepPossibleValue>();
            }

            this.possibleGroups[key] = possibleValue;
        }