public async Task <bool> getCompetitionsList() { try { var datalist = (await serivce.GET_list <Competitions>("endDate", DateTime.Now.convertDateFire(), OrderChild.startAt, (int)ListCount.mid)).OrderBy(x => x.Object.endDate); foreach (var item in datalist) { if (item.Object.endDate > DateTime.Now) { var result = await checkUserResponse(item.Key); if (!result) { if (eventList.Any(x => x.Key == item.Key)) { var listItem = eventList.FirstOrDefault(x => x.Key == item.Key); eventList[eventList.IndexOf(listItem)] = item; } else { eventList.Add(item); } } } } return(true); } catch (Exception ex) { Console.WriteLine("SurveyError " + ex.Message); return(false); } }
public async Task <bool> getSurveyList(string key) { try { var datalist = (await service.GET_list <Surveys>("endDate", DateTime.Now.convertDateFire(), OrderChild.startAt, (int)ListCount.mid)).OrderBy(x => x.Object.endDate); var emptyList = new ObservableCollection <FirebaseObject <Surveys> >(); foreach (var item in datalist) { if (item.Object.endDate > DateTime.Now) { var result = await checkUserResponse(item.Key); if (!result) { surveyList.Add(item); } } } return(true); } catch (Exception ex) { Console.WriteLine("SurveyError " + ex.Message); return(false); } }