public GetByCategoryIds ( List |
||
categoryIds | List |
A |
onlyApproved | bool | set false to include un-approved requests. |
onlyUnexpired | bool | set false to include expired requests. |
Результат | IEnumerable |
/// <summary> /// Finds all approved prayer requests for the given selected categories and orders them by least prayed-for. /// Also updates the prayer count for the first item in the list. /// </summary> /// <param name="categoriesList"></param> private void SetAndDisplayPrayerRequests( RockCheckBoxList categoriesList ) { RockContext rockContext = new RockContext(); PrayerRequestService service = new PrayerRequestService( rockContext ); var prayerRequests = service.GetByCategoryIds( categoriesList.SelectedValuesAsInt ).OrderByDescending( p => p.IsUrgent ).ThenBy( p => p.PrayerCount ); List<int> list = prayerRequests.Select( p => p.Id ).ToList<int>(); Session[_sessionKey] = list; if ( list.Count > 0 ) { UpdateSessionCountLabel( 1, list.Count ); hfPrayerIndex.Value = "0"; PrayerRequest request = prayerRequests.First(); ShowPrayerRequest( request, rockContext ); } }