コード例 #1
0
        /// <summary>
        /// Provides a user-friendly description of the specified filter values.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="selection">A formatted string representing the filter settings.</param>
        /// <returns>
        /// A string containing the user-friendly description of the settings.
        /// </returns>
        public override string FormatSelection(Type entityType, string selection)
        {
            var settings = new FilterSettings(selection);

            string result = "Connected to Location";

            if (!settings.IsValid)
            {
                return(result);
            }

            using (var context = new RockContext())
            {
                var dataView = new DataViewService(context).Get(settings.DataViewGuid.GetValueOrDefault());

                string locationTypeName = null;

                if (settings.LocationTypeGuid.HasValue)
                {
                    locationTypeName = DefinedValueCache.Get(settings.LocationTypeGuid.Value, context).Value;
                }

                result = string.Format("Location {0} is in filter: {1}",
                                       (locationTypeName != null ? "type \"" + locationTypeName + "\"" : string.Empty),
                                       (dataView != null ? dataView.ToString() : string.Empty));
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Formats the selection.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        /// <param name="selection">The selection.</param>
        /// <returns></returns>
        public override string FormatSelection(Type entityType, string selection)
        {
            var settings = new FilterSettings(selection);

            string result = "In Personal Device Data View";

            if (!settings.IsValid)
            {
                return(result);
            }

            using (var context = new RockContext())
            {
                var dataView = new DataViewService(context).Get(settings.DataViewGuid.GetValueOrDefault());

                result = string.Format("In Personal Device Data View filter: {0}",
                                       (dataView != null ? dataView.ToString() : string.Empty));
            }

            return(result);
        }
コード例 #3
0
        /// <summary>
        /// Provides a user-friendly description of the specified filter values.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="selection">A formatted string representing the filter settings.</param>
        /// <returns>
        /// A string containing the user-friendly description of the settings.
        /// </returns>
        public override string FormatSelection(Type entityType, string selection)
        {
            var settings = new FilterSettings(selection);

            string result = GetTitle(null);

            if (!settings.IsValid)
            {
                return(result);
            }

            using (var context = new RockContext())
            {
                var dataView = new DataViewService(context).Get(settings.GroupMemberDataViewGuid.GetValueOrDefault());

                result = string.Format("Group Memberships in Data View \"{0}\" is {1} {2}",
                                       (dataView != null ? dataView.ToString() : string.Empty),
                                       settings.MemberCountComparison.ConvertToString(),
                                       settings.MemberCount);
            }

            return(result);
        }
コード例 #4
0
        /// <summary>
        /// Provides a user-friendly description of the specified filter values.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="selection">A formatted string representing the filter settings.</param>
        /// <returns>
        /// A string containing the user-friendly description of the settings.
        /// </returns>
        public override string FormatSelection(Type entityType, string selection)
        {
            var settings = new FilterSettings(selection);

            var relatedEntityName = GetRelatedEntityName();

            string result = $"Connected to { relatedEntityName }";

            if (!settings.IsValid)
            {
                return(result);
            }

            using (var context = new RockContext())
            {
                var dataView = new DataViewService(context).Get(settings.DataViewGuid.GetValueOrDefault());

                var dataViewName = (dataView != null ? dataView.ToString() : string.Empty);

                result = $"Is associated with any { relatedEntityName } in Data View: { dataViewName }";
            }

            return(result);
        }
コード例 #5
0
        /// <summary>
        /// Provides a user-friendly description of the specified filter values.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="selection">A formatted string representing the filter settings.</param>
        /// <returns>
        /// A string containing the user-friendly description of the settings.
        /// </returns>
        public override string FormatSelection(Type entityType, string selection)
        {
            var settings = new FilterSettings(selection);

            string result = "Connected to Financial Transaction";

            if (!settings.IsValid)
            {
                return(result);
            }

            using (var context = new RockContext())
            {
                var dataView = new DataViewService(context).Get(settings.DataViewGuid.GetValueOrDefault());

                result = string.Format("Person in Data View \"{0}\"", (dataView != null ? dataView.ToString() : string.Empty));
            }

            return(result);
        }
コード例 #6
0
        /// <summary>
        /// Provides a user-friendly description of the specified filter values.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="selection">A formatted string representing the filter settings.</param>
        /// <returns>
        /// A string containing the user-friendly description of the settings.
        /// </returns>
        public override string FormatSelection(Type entityType, string selection)
        {
            var settings = new SelectSettings(selection);

            string result = GetTitle(null);

            if (!settings.IsValid)
            {
                return(result);
            }

            using (var context = new RockContext())
            {
                var dataView = new DataViewService(context).Get(settings.DataViewGuid.GetValueOrDefault());

                result = string.Format("Members of Groups in Data View \"{0}\"", (dataView != null ? dataView.ToString() : string.Empty));

                var groupMemberStatus = settings.MemberStatus;

                if (groupMemberStatus.HasValue)
                {
                    result += ", with Status: " + groupMemberStatus.ToString();
                }

                if (settings.RoleType.HasValue &&
                    settings.RoleType != RoleTypeSpecifier.Any)
                {
                    result += ", with Role Type: " + settings.RoleType.ToString();
                }
            }

            return(result);
        }
コード例 #7
0
        /// <summary>
        /// Provides a user-friendly description of the specified filter values.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="selection">A formatted string representing the filter settings.</param>
        /// <returns>
        /// A string containing the user-friendly description of the settings.
        /// </returns>
        public override string FormatSelection(Type entityType, string selection)
        {
            var settings = new FilterSettings(selection);

            string result = GetTitle(null);

            if (!settings.IsValid)
            {
                return(result);
            }

            using (var context = new RockContext())
            {
                var dataView = new DataViewService(context).Get(settings.PersonDataViewGuid.GetValueOrDefault());

                result = string.Format("Members matching Person filter \"{0}\"", (dataView != null ? dataView.ToString() : string.Empty));
            }

            return(result);
        }
コード例 #8
0
        /// <summary>
        /// Provides a user-friendly description of the specified filter values.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="selection">A formatted string representing the filter settings.</param>
        /// <returns>
        /// A string containing the user-friendly description of the settings.
        /// </returns>
        public override string FormatSelection(Type entityType, string selection)
        {
            var settings = new SelectSettings(selection);

            string result = GetTitle(null);

            if (!settings.IsValid)
            {
                return(result);
            }

            using (var context = new RockContext())
            {
                var dataView = new DataViewService(context).Get(settings.DataViewGuid.GetValueOrDefault());

                result = string.Format("People - matched to the Requestor \"{0}\"", dataView != null ? dataView.ToString() : string.Empty);
            }

            return(result);
        }