public async Task Load(DateTime?startTime = null, DateTime?endTime = null, SortColumnItem sortColumn = null)
        {
            try
            {
                IsBusy = true;
                if (sortColumn == null)
                {
                    sortColumn = new SortColumnItem(NotificationSortColumns.RecordId, null);
                }
                var context = new CustomerNotificationsQueryContext
                {
                    CustomerInfo = Api.GetCustomerContext(),
                    FromDate     = startTime ?? DateTime.Now.AddMonths(-3),
                    ToDate       = endTime ?? DateTimeOffset.Now
                };
                var notificationsResponse = await Api.GetNotifications(context);

                if (!notificationsResponse.Successful.GetValueOrDefault())
                {
                    await Alert.ShowMessage(notificationsResponse.ExceptionMessage);

                    return;
                }
                var sortedList = SortList(sortColumn, notificationsResponse.Data);
                List      = new ObservableCollection <CustomerNotification>(sortedList);
                NoResults = !_list.Any();
            }
            catch (Exception e)
            {
                await Alert.DisplayError(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#2
0
        public async Task <ApiResponseOfListOfCustomerNotification> GetNotifications(CustomerNotificationsQueryContext context)
        {
            var result = await AXClient.Instance.GetCustomerNotificationsAsync(context);

            return(result);
        }