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


C# ScheduleService.OrderByDescending方法代码示例

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


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

示例1: BindGrid

        /// <summary>
        /// Binds the group members grid.
        /// </summary>
        protected void BindGrid()
        {
            if ( _group != null )
            {
                lHeading.Text = _group.Name;

                var qry = new ScheduleService( _rockContext ).GetGroupOccurrences( _group ).AsQueryable();

                SortProperty sortProperty = gOccurrences.SortProperty;
                List<ScheduleOccurrence> occurrences = null;
                if ( sortProperty != null )
                {
                    occurrences = qry.Sort( sortProperty ).ToList();
                }
                else
                {
                    occurrences = qry.OrderByDescending( a => a.StartDateTime ).ToList();
                }

                gOccurrences.DataSource = occurrences;
                gOccurrences.DataBind();
            }
        }
开发者ID:Higherbound,项目名称:Higherbound-2016-website-upgrades,代码行数:26,代码来源:GroupAttendanceList.ascx.cs

示例2: BindGrid

        /// <summary>
        /// Binds the group members grid.
        /// </summary>
        protected void BindGrid()
        {
            if ( _group != null )
            {
                lHeading.Text = _group.Name;

                DateTime? fromDateTime = drpDates.LowerValue;
                DateTime? toDateTime = drpDates.UpperValue;
                List<int> locationIds = new List<int>();
                List<int> scheduleIds = new List<int>();

                // Location Filter
                if ( ddlLocation.Visible )
                {
                    string locValue = ddlLocation.SelectedValue;
                    if ( locValue.StartsWith( "P" ) )
                    {
                        int? parentLocationId = locValue.Substring( 1 ).AsIntegerOrNull();
                        if ( parentLocationId.HasValue )
                        {
                            locationIds = new LocationService( _rockContext )
                                .GetAllDescendents( parentLocationId.Value )
                                .Select( l => l.Id )
                                .ToList();
                        }
                    }
                    else
                    {
                        int? locationId = locValue.AsIntegerOrNull();
                        if ( locationId.HasValue )
                        {
                            locationIds.Add( locationId.Value );
                        }
                    }
                }

                // Schedule Filter
                if ( ddlSchedule.Visible && ddlSchedule.SelectedValue != "0" )
                {
                    scheduleIds.Add( ddlSchedule.SelectedValueAsInt() ?? 0 );
                }

                var qry = new ScheduleService( _rockContext )
                    .GetGroupOccurrences( _group, fromDateTime, toDateTime, locationIds, scheduleIds, true, bddlCampus.SelectedValueAsInt() )
                    .AsQueryable();

                SortProperty sortProperty = gOccurrences.SortProperty;
                List<ScheduleOccurrence> occurrences = null;
                if ( sortProperty != null )
                {
                    occurrences = qry.Sort( sortProperty ).ToList();
                }
                else
                {
                    occurrences = qry.OrderByDescending( a => a.Date ).ThenByDescending( a => a.StartTime ).ToList();
                }

                gOccurrences.DataSource = occurrences;
                gOccurrences.DataBind();
            }
        }
开发者ID:NewPointe,项目名称:Rockit,代码行数:64,代码来源:GroupAttendanceList.ascx.cs


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