public void LoadLiveData(IWorkflowsQueryService client) { ActivitySearchRequestDC request = new ActivitySearchRequestDC(); request.SearchText = SearchFilter; request.PageNumber = resetPageIndex ? 1 : this.DataPagingVM.PageIndex; request.PageSize = pageSize; request.FilterByCreator = FilterByCreatedBy; request.FilterByDescription = FilterByDescription; request.FilterByName = filterByName; request.FilterByVersion = FilterByVersion; request.FilterByTags = FilterByTags; request.FilterByType = FilterByType; request.FilterOlder = FilterOldVersions; if (!string.IsNullOrEmpty(sortColumn)) { request.SortColumn = sortColumn.ToLower().Trim(); request.SortAscending = sortDirection == ListSortDirection.Ascending; } try { ActivitySearchReplyDC searchResults = null; Utility.DoTaskWithBusyCaption("Loading...", () => { searchResults = client.SearchActivities(request); this.DataPagingVM.ResultsLength = searchResults.ServerResultsLength; ExistingWorkflows = new ObservableCollection<StoreActivitiesDC>(searchResults.SearchResults); }); WorkflowsView = new CollectionViewSource(); WorkflowsView.Source = existingWorkflows; } catch (FaultException<ServiceFault> ex) { throw new CommunicationException(ex.Detail.ErrorMessage); } catch (FaultException<ValidationFault> ex) { throw new BusinessValidationException(ex.Detail.ErrorMessage); } catch (Exception ex) { throw new CommunicationException(ex.Message); } finally { IsBusy = false; } }
private void GetActivities(IWorkflowsQueryService client) { ActivitySearchRequestDC request = new ActivitySearchRequestDC(); request.SearchText = this.SearchFilter; request.PageNumber = this.DataPagingVM.ResetPageIndex ? 1 : this.DataPagingVM.PageIndex; request.PageSize = pageSize; request.FilterByCreator = false; request.FilterByDescription = false; request.FilterByName = true; request.FilterByVersion = false; request.FilterByTags = false; request.FilterByType = false; request.FilterOlder = this.FilterOldVersions; try { ActivitySearchReplyDC searchResults = null; searchResults = client.SearchActivities(request); this.DataPagingVM.ResultsLength = searchResults.ServerResultsLength; this.Activities = new ObservableCollection<StoreActivitiesDC>(searchResults.SearchResults); } catch (FaultException<ServiceFault> ex) { IsBusy = false; throw new CommunicationException(ex.Detail.ErrorMessage); } catch (FaultException<ValidationFault> ex) { IsBusy = false; throw new BusinessValidationException(ex.Detail.ErrorMessage); } catch (Exception ex) { IsBusy = false; throw new CommunicationException(ex.Message); } }