Esempio n. 1
0
        private async Task LoadActivityRecords()
        {
            var browseActivityRecordsWithActivityQuery = new BrowseActivityRecordsForDayRecordPanel(DayRecord.Id);
            var getActivityRecordsQueryResult          =
                await _dispatcher.DispatchQueryAndGetResultAsync <IEnumerable <ActivityRecordForDayRecordPanel>, BrowseActivityRecordsForDayRecordPanel>(browseActivityRecordsWithActivityQuery);

            if (getActivityRecordsQueryResult.Successful == false)
            {
                // TODO - show error notyfication
                return;
            }

            foreach (var activityRecord in getActivityRecordsQueryResult.Result)
            {
                await AddActivityRecordItemAsync(activityRecord);
            }
        }
Esempio n. 2
0
        public async Task <IEnumerable <ActivityRecordForDayRecordPanel> > HandleAndGetResultAsync(BrowseActivityRecordsForDayRecordPanel query)
        {
            var activityRecordsWithActivity = await _activityRecordsRepository.BrowseWithActivityAsync(
                new BrowseWithActivityQuery(query.DayRecordId));

            var activityRecordsForDayRecordPanel = activityRecordsWithActivity.Select(activityRecordWithActivity => _activityRecordForDayRecordPanelMapper.Map(activityRecordWithActivity));

            return(activityRecordsForDayRecordPanel);
        }