예제 #1
0
        /// <summary>
        /// Queries the DB using the existing ListProvidersHandler
        /// </summary>
        private ListProviderGroupsResponse QueryData()
        {
            var listRequest = new ListProviderGroupsRequest();

            //Paging
            listRequest.PageSize = _viewModel.PageSize;
            listRequest.RequestedPage = _viewModel.PageNumber;

            //Sorting
            if (!string.IsNullOrEmpty(_viewModel.SortColumn))
            {
                listRequest.SortExpression = _viewModel.SortColumn + " " + _viewModel.SortDirection;
            }

            var enabledFilterValue = string.IsNullOrEmpty(_viewModel.FilterFields.Single(f => f.FieldName == "Enabled").FieldValue) ? string.Empty : _viewModel.FilterFields.Single(f => f.FieldName == "Enabled").FieldValue;
            if (!string.IsNullOrEmpty(enabledFilterValue) && enabledFilterValue != "All")
                listRequest.EnabledOnly = enabledFilterValue == "Enabled";

            return ProcessRequest<ListProviderGroupsResponse>(listRequest);
        }
 private List<ProviderGroupDto> GetProviderGroups(ProviderDto providerDto)
 {
     var request = new ListProviderGroupsRequest() { EnabledOnly = true };
     return ProcessRequest<ListProviderGroupsResponse>(request).ProviderGroups.ToList();
 }