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


C# GroupTypeService.OrderBy方法代码示例

本文整理汇总了C#中Rock.Model.GroupTypeService.OrderBy方法的典型用法代码示例。如果您正苦于以下问题:C# GroupTypeService.OrderBy方法的具体用法?C# GroupTypeService.OrderBy怎么用?C# GroupTypeService.OrderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rock.Model.GroupTypeService的用法示例。


在下文中一共展示了GroupTypeService.OrderBy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindGrid

        /// <summary>
        /// Binds the grid.
        /// </summary>
        private void BindGrid()
        {
            using ( var rockContext = new RockContext() )
            {
                // limit to show only GroupTypes that have a group type purpose of Checkin Template
                int groupTypePurposeCheckInTemplateId = DefinedValueCache.Read( new Guid( Rock.SystemGuid.DefinedValue.GROUPTYPE_PURPOSE_CHECKIN_TEMPLATE ) ).Id;

                var qry = new GroupTypeService( rockContext )
                    .Queryable().AsNoTracking()
                    .Where( a => a.GroupTypePurposeValueId == groupTypePurposeCheckInTemplateId );

                SortProperty sortProperty = gGroupType.SortProperty;
                if ( sortProperty != null )
                {
                    gGroupType.DataSource = qry.Sort( sortProperty ).ToList();
                }
                else
                {
                    gGroupType.DataSource = qry.OrderBy( p => p.Name ).ToList();
                }

                gGroupType.DataBind();
            }
        }
开发者ID:RMRDevelopment,项目名称:Rockit,代码行数:27,代码来源:CheckInGroupTypeList.ascx.cs

示例2: GetGroupTypes

        /// <summary>
        /// Gets the group types.
        /// </summary>
        /// <returns></returns>
        private IQueryable<GroupType> GetGroupTypes( RockContext rockContext )
        {
            var qry = new GroupTypeService( rockContext ).Queryable();

            int? purposeId = rFilter.GetUserPreference( "Purpose" ).AsIntegerOrNull();
            if ( purposeId.HasValue )
            {
                qry = qry.Where( t => t.GroupTypePurposeValueId == purposeId.Value );
            }

            var isSystem = rFilter.GetUserPreference( "System Group Types" );
            if ( isSystem == "Yes" )
            {
                qry = qry.Where( t => t.IsSystem );
            }
            else if ( isSystem == "No" )
            {
                qry = qry.Where( t => !t.IsSystem );
            }

            var isShownInNavigation = rFilter.GetUserPreference("Shown in Navigation").AsBooleanOrNull();
            if (isShownInNavigation.HasValue)
            {
                if (isShownInNavigation.Value)
                {
                    qry = qry.Where(t => t.ShowInNavigation);
                }
                else if (!isShownInNavigation.Value)
                {
                    qry = qry.Where(t => !t.ShowInNavigation);
                }

            }

            return qry.OrderBy( g => g.Order );
        }
开发者ID:NewPointe,项目名称:Rockit,代码行数:40,代码来源:GroupTypeList.ascx.cs

示例3: EditControl

        /// <summary>
        /// Creates the control(s) necessary for prompting user for a new value
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id"></param>
        /// <returns>
        /// The control
        /// </returns>
        public override System.Web.UI.Control EditControl( Dictionary<string, ConfigurationValue> configurationValues, string id )
        {
            var editControl = new GroupTypePicker { ID = id };
            var qryGroupTypes = new GroupTypeService( new RockContext() ).Queryable();

            if ( configurationValues.ContainsKey( GROUP_TYPE_PURPOSE_VALUE_GUID ) )
            {
                var groupTypePurposeValueGuid = ( configurationValues[GROUP_TYPE_PURPOSE_VALUE_GUID] ).Value.AsGuidOrNull();
                if ( groupTypePurposeValueGuid.HasValue )
                {
                    qryGroupTypes = qryGroupTypes.Where( a => a.GroupTypePurposeValue.Guid == groupTypePurposeValueGuid.Value );
                }
            }

            editControl.GroupTypes = qryGroupTypes.OrderBy( a => a.Name ).ToList();
            return editControl;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:25,代码来源:GroupTypeFieldType.cs

示例4: GetGroupTypes

        /// <summary>
        /// Gets the group types.
        /// </summary>
        /// <returns></returns>
        private IQueryable<GroupType> GetGroupTypes()
        {
            var qry = new GroupTypeService( new RockContext() ).Queryable();

            int? purposeId = rFilter.GetUserPreference( "Purpose" ).AsIntegerOrNull();
            if ( purposeId.HasValue )
            {
                qry = qry.Where( t => t.GroupTypePurposeValueId == purposeId.Value );
            }

            var isSystem = rFilter.GetUserPreference( "System Group Types" );
            if ( isSystem == "Yes" )
            {
                qry = qry.Where( t => t.IsSystem );
            }
            else if ( isSystem == "No" )
            {
                qry = qry.Where( t => !t.IsSystem );
            }

            return qry.OrderBy( g => g.Order );
        }
开发者ID:Ganon11,项目名称:Rock,代码行数:26,代码来源:GroupTypeList.ascx.cs

示例5: GetGroupTypes

        /// <summary>
        /// Gets the group types.
        /// </summary>
        /// <returns></returns>
        private IQueryable<GroupType> GetGroupTypes()
        {
            var qry = new GroupTypeService().Queryable();

            int purposeId = int.MinValue;
            if ( int.TryParse( rFilter.GetUserPreference( "Purpose" ), out purposeId ) )
            {
                qry = qry.Where( t => t.GroupTypePurposeValueId == purposeId );
            }

            var isSystem = rFilter.GetUserPreference( "System Group Types" );
            if ( isSystem == "Yes" )
            {
                qry = qry.Where( t => t.IsSystem );
            }
            else if (isSystem == "No")
            {
                qry = qry.Where( t => !t.IsSystem);
            }

            return qry.OrderBy( g => g.Order );
        }
开发者ID:pkdevbox,项目名称:Rock,代码行数:26,代码来源:GroupTypeList.ascx.cs


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