当前位置: 首页>>代码示例>>C#>>正文


C# Controls.FilterField类代码示例

本文整理汇总了C#中Rock.Web.UI.Controls.FilterField的典型用法代码示例。如果您正苦于以下问题:C# FilterField类的具体用法?C# FilterField怎么用?C# FilterField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FilterField类属于Rock.Web.UI.Controls命名空间,在下文中一共展示了FilterField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            RockDropDownList groupLocationTypeList = new RockDropDownList();
            groupLocationTypeList.Items.Clear();
            foreach ( var value in Rock.Web.Cache.DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid() ).DefinedValues.OrderBy( a => a.Order ).ThenBy( a => a.Value ) )
            {
                groupLocationTypeList.Items.Add( new ListItem( value.Value, value.Guid.ToString() ) );
            }

            groupLocationTypeList.Items.Insert( 0, Rock.Constants.None.ListItem );

            groupLocationTypeList.ID = filterControl.ID + "_groupLocationTypeList";
            groupLocationTypeList.Label = "Location Type";
            filterControl.Controls.Add( groupLocationTypeList );

            LocationPicker locationPicker = new LocationPicker();
            locationPicker.ID = filterControl.ID + "_locationPicker";
            locationPicker.Label = "Location";

            filterControl.Controls.Add( locationPicker );

            NumberBox numberBox = new NumberBox();
            numberBox.ID = filterControl.ID + "_numberBox";
            numberBox.NumberType = ValidationDataType.Double;
            numberBox.Label = "Miles";
            numberBox.AddCssClass( "number-box-miles" );
            filterControl.Controls.Add( numberBox );

            return new Control[3] { groupLocationTypeList, locationPicker, numberBox };
        }
开发者ID:azturner,项目名称:Rock,代码行数:34,代码来源:DistanceFromFilter.cs

示例2: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var ddlGroupType = new RockDropDownList();
            ddlGroupType.ID = filterControl.ID + "_0";
            filterControl.Controls.Add( ddlGroupType );

            foreach ( Rock.Model.GroupType groupType in new GroupTypeService( new RockContext() ).Queryable() )
            {
                ddlGroupType.Items.Add( new ListItem( groupType.Name, groupType.Guid.ToString() ) );
            }

            var ddl = ComparisonControl( NumericFilterComparisonTypes );
            ddl.ID = filterControl.ID + "_1";
            filterControl.Controls.Add( ddl );

            var tb = new RockTextBox();
            tb.ID = filterControl.ID + "_2";
            filterControl.Controls.Add( tb );

            var tb2 = new RockTextBox();
            tb2.ID = filterControl.ID + "_3";
            filterControl.Controls.Add( tb );

            var controls = new Control[4] { ddlGroupType, ddl, tb, tb2 };

            SetSelection(
                entityType,
                controls,
                string.Format( "{0}|{1}|4|16", ddlGroupType.Items.Count > 0 ? ddlGroupType.Items[0].Value : "0", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString() ) );

            return controls;
        }
开发者ID:Ganon11,项目名称:Rock,代码行数:36,代码来源:GroupTypeAttendanceFilter.cs

示例3: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var ddlGroupType = new RockDropDownList();
            ddlGroupType.ID = filterControl.ID + "_0";
            filterControl.Controls.Add( ddlGroupType );

            foreach ( Rock.Model.GroupType groupType in new GroupTypeService( new RockContext() ).Queryable() )
            {
                ddlGroupType.Items.Add( new ListItem( groupType.Name, groupType.Guid.ToString() ) );
            }

            var ddlIntegerCompare = ComparisonHelper.ComparisonControl( ComparisonHelper.NumericFilterComparisonTypes );
            ddlIntegerCompare.ID = filterControl.ID + "_ddlIntegerCompare";
            filterControl.Controls.Add( ddlIntegerCompare );

            var tbAttendedCount = new RockTextBox();
            tbAttendedCount.ID = filterControl.ID + "_2";
            filterControl.Controls.Add( tbAttendedCount );

            var tbInLastWeeksCount = new RockTextBox();
            tbInLastWeeksCount.ID = filterControl.ID + "_tbInLastWeeksCount";
            filterControl.Controls.Add( tbInLastWeeksCount );

            var controls = new Control[4] { ddlGroupType, ddlIntegerCompare, tbAttendedCount, tbInLastWeeksCount };

            // set the default values in case this is a newly added filter
            SetSelection(
                entityType,
                controls,
                string.Format( "{0}|{1}|4|16", ddlGroupType.Items.Count > 0 ? ddlGroupType.Items[0].Value : "0", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString() ) );

            return controls;
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:37,代码来源:GroupTypeAttendanceFilter.cs

示例4: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var comparisonControl = this.ComparisonControl( ComparisonType.LessThan | ComparisonType.GreaterThanOrEqualTo );
            comparisonControl.ID = filterControl.ID + "_0";
            filterControl.Controls.Add( comparisonControl );

            var globalAttributes = Rock.Web.Cache.GlobalAttributesCache.Read();

            NumberBox numberBoxAmount = new NumberBox();
            numberBoxAmount.PrependText = globalAttributes.GetValue("CurrencySymbol") ?? "$";
            numberBoxAmount.NumberType = ValidationDataType.Currency;
            numberBoxAmount.ID = filterControl.ID + "_1";
            numberBoxAmount.Label = "Amount";

            filterControl.Controls.Add( numberBoxAmount );

            DateRangePicker dateRangePicker = new DateRangePicker();
            dateRangePicker.ID = filterControl.ID + "_2";
            dateRangePicker.Label = "Date Range";
            dateRangePicker.Required = true;
            filterControl.Controls.Add( dateRangePicker );

            var controls = new Control[3] { comparisonControl, numberBoxAmount, dateRangePicker };

            SetSelection( entityType, controls, string.Format( "{0}|||", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString() ) );

            return controls;
        }
开发者ID:Ganon11,项目名称:Rock,代码行数:32,代码来源:GivingAmountFilter.cs

示例5: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var controls = new List<Control>();

            var ddlIntegerCompare = ComparisonHelper.ComparisonControl( ComparisonHelper.NumericFilterComparisonTypes );
            ddlIntegerCompare.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
            ddlIntegerCompare.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlIntegerCompare );
            controls.Add( ddlIntegerCompare );

            var ddlGradeDefinedValue = new RockDropDownList();
            ddlGradeDefinedValue.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
            ddlGradeDefinedValue.AddCssClass( "js-filter-control" );

            ddlGradeDefinedValue.Items.Clear();

            // add blank item as first item
            ddlGradeDefinedValue.Items.Add( new ListItem() );

            var schoolGrades = DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.SCHOOL_GRADES.AsGuid() );
            if ( schoolGrades != null )
            {
                foreach ( var schoolGrade in schoolGrades.DefinedValues.OrderByDescending( a => a.Value.AsInteger() ) )
                {
                    ddlGradeDefinedValue.Items.Add( new ListItem( schoolGrade.Description, schoolGrade.Guid.ToString() ) );
                }
            }

            filterControl.Controls.Add( ddlGradeDefinedValue );
            controls.Add( ddlGradeDefinedValue );

            return controls.ToArray();
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:37,代码来源:GradeFilter.cs

示例6: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var controls = new List<Control>();

            var ddlIntegerCompare = ComparisonHelper.ComparisonControl( ComparisonHelper.NumericFilterComparisonTypes | ComparisonType.Between );
            ddlIntegerCompare.ID = string.Format( "{0}_{1}", filterControl.ID, "ddlIntegerCompare" );
            ddlIntegerCompare.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlIntegerCompare );
            controls.Add( ddlIntegerCompare );

            var numberBox = new NumberBox();
            numberBox.ID = string.Format( "{0}_{1}", filterControl.ID, "numberBox" );
            numberBox.AddCssClass( "js-filter-control" );
            filterControl.Controls.Add( numberBox );
            controls.Add( numberBox );

            numberBox.FieldName = "Age";

            var numberRangeEditor = new Rock.Web.UI.Controls.NumberRangeEditor();
            numberRangeEditor.ID = string.Format( "{0}_{1}", filterControl.ID, "numberRangeEditor" );
            numberRangeEditor.RangeLabel = "and";
            numberRangeEditor.AddCssClass( "js-filter-control-between" );
            filterControl.Controls.Add( numberRangeEditor );
            controls.Add( numberRangeEditor );

            return controls.ToArray();
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:31,代码来源:AgeFilter.cs

示例7: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            gp = new GroupPicker();
            gp.ID = filterControl.ID + "_gp";
            gp.Label = "Group";
            filterControl.Controls.Add( gp );

            return new Control[1] { gp };
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:13,代码来源:InGroupGeofenceFilter.cs

示例8: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            CampusPicker campusPicker = new CampusPicker();
            campusPicker.ID = filterControl.ID + "_campusPicker";
            campusPicker.Label = "Campus";
            campusPicker.Campuses = CampusCache.All();
            filterControl.Controls.Add( campusPicker );

            return new Control[] { campusPicker };
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:14,代码来源:CampusFilter.cs

示例9: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            WorkflowTypePicker workflowTypePicker = new WorkflowTypePicker();
            workflowTypePicker.ID = filterControl.ID + "_workflowTypePicker";
            workflowTypePicker.CssClass = "js-workflow-type-picker";
            workflowTypePicker.Label = "Workflow Type";
            filterControl.Controls.Add( workflowTypePicker );

            return new Control[] { workflowTypePicker };
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:14,代码来源:WorkflowTypeFilter.cs

示例10: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            CampusPicker campusPicker = new CampusPicker();
            campusPicker.ID = filterControl.ID + "_campusPicker";
            campusPicker.Label = "Campus";
            campusPicker.Campuses = new CampusService( new RockContext() ).Queryable().OrderBy( a => a.Name ).ToList();
            filterControl.Controls.Add( campusPicker );

            return new Control[] { campusPicker };
        }
开发者ID:Ganon11,项目名称:Rock,代码行数:14,代码来源:CampusFilter.cs

示例11: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            GroupTypePicker groupTypePicker = new GroupTypePicker();
            groupTypePicker.ID = filterControl.ID + "_groupTypePicker";
            groupTypePicker.Label = "Group Type";
            groupTypePicker.GroupTypes = new GroupTypeService( new RockContext() ).Queryable().OrderBy( a => a.Order ).ThenBy( a => a.Name ).ToList();
            filterControl.Controls.Add( groupTypePicker );

            return new Control[] { groupTypePicker };
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:14,代码来源:GroupTypeFilter.cs

示例12: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            lp = new LocationPicker();
            lp.ID = filterControl.ID + "_lp";
            lp.Label = "Location";
            lp.AllowedPickerModes = LocationPickerMode.Named | LocationPickerMode.Polygon;
            lp.CurrentPickerMode = lp.GetBestPickerModeForLocation( null );
            filterControl.Controls.Add( lp );

            return new Control[1] { lp };
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:15,代码来源:InLocationGeofenceFilter.cs

示例13: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var rbl = new RockRadioButtonList();
            rbl.ID = filterControl.ID + "_0";
            rbl.RepeatDirection = RepeatDirection.Horizontal;
            rbl.Items.Add( new ListItem( "Yes", "1" ) );
            rbl.Items.Add( new ListItem( "No", "0" ) );
            filterControl.Controls.Add( rbl );
            rbl.SelectedValue = "1";

            return new Control[1] { rbl };
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:16,代码来源:HasPictureFilter.cs

示例14: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            CampusesPicker campusesPicker = new CampusesPicker();
            campusesPicker.ID = filterControl.ID + "_0";
            campusesPicker.Label = string.Empty;
            campusesPicker.CssClass = "js-campuses-picker campuses-picker";
            campusesPicker.Campuses = CampusCache.All();

            filterControl.Controls.Add( campusesPicker );

            return new Control[1] { campusesPicker };
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:16,代码来源:CampusesFilter.cs

示例15: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var gtpGroupType = new GroupTypePicker();
            gtpGroupType.ID = filterControl.ID + "_0";
            gtpGroupType.AddCssClass( "js-group-type" );
            filterControl.Controls.Add( gtpGroupType );

            gtpGroupType.UseGuidAsValue = true;
            gtpGroupType.GroupTypes = new GroupTypeService( new RockContext() ).Queryable().OrderBy(a => a.Name).ToList();

            var cbChildGroupTypes = new RockCheckBox();
            cbChildGroupTypes.ID = filterControl.ID + "_cbChildGroupTypes";
            cbChildGroupTypes.AddCssClass( "js-child-group-types" );
            cbChildGroupTypes.Text = "Include Child Group Types(s)";
            filterControl.Controls.Add( cbChildGroupTypes );

            var ddlIntegerCompare = ComparisonHelper.ComparisonControl( ComparisonHelper.NumericFilterComparisonTypes );
            ddlIntegerCompare.Label = "Attendance Count";
            ddlIntegerCompare.ID = filterControl.ID + "_ddlIntegerCompare";
            ddlIntegerCompare.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlIntegerCompare );

            var tbAttendedCount = new RockTextBox();
            tbAttendedCount.ID = filterControl.ID + "_2";
            tbAttendedCount.Label = "&nbsp;"; // give it whitespace label so it lines up nicely
            tbAttendedCount.AddCssClass( "js-attended-count" );
            filterControl.Controls.Add( tbAttendedCount );

            var slidingDateRangePicker = new SlidingDateRangePicker();
            slidingDateRangePicker.Label = "Date Range";
            slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker";
            slidingDateRangePicker.AddCssClass( "js-sliding-date-range" );
            filterControl.Controls.Add( slidingDateRangePicker );

            var controls = new Control[5] { gtpGroupType, cbChildGroupTypes, ddlIntegerCompare, tbAttendedCount, slidingDateRangePicker };

            // convert pipe to comma delimited
            var defaultDelimitedValues = slidingDateRangePicker.DelimitedValues.Replace( "|", "," );
            var defaultCount = 4;

            // set the default values in case this is a newly added filter
            SetSelection(
                entityType,
                controls,
                string.Format( "{0}|{1}|{2}|{3}|false", gtpGroupType.Items.Count > 0 ? gtpGroupType.Items[0].Value : "0", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString(), defaultCount, defaultDelimitedValues ) );

            return controls;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:52,代码来源:GroupTypeAttendanceFilter.cs


注:本文中的Rock.Web.UI.Controls.FilterField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。