/// <summary> /// Searches for clients that match the search criteria. /// </summary> public ServiceSearchItem[] SearchService(int startRow, int pageSize, string sortBy, string industry, bool forceRefresh) { TimeServiceClient timeService = null; ServiceSearchItem[] services = null; try { if (HttpContext.Current.Session[SessionName.LogonSettings] != null) { Guid _logonId = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId; CollectionRequest collectionRequest = new CollectionRequest(); collectionRequest.ForceRefresh = forceRefresh; collectionRequest.StartRow = startRow; collectionRequest.RowCount = pageSize; ServiceSearchCriteria criteria = new ServiceSearchCriteria(); criteria.IndustryId = Convert.ToInt32(industry); criteria.OrderBy = sortBy; timeService = new TimeServiceClient(); ServiceSearchReturnValue returnValue = timeService.ServiceSearchOnIndustry(_logonId, collectionRequest, criteria); if (returnValue.Success) { _serviceRowCount = returnValue.Service.TotalRowCount; services = returnValue.Service.Rows; } else { throw new Exception(returnValue.Message); } } return(services); } catch (Exception ex) { throw ex; } finally { if (timeService != null) { if (timeService.State != System.ServiceModel.CommunicationState.Faulted) { timeService.Close(); } } } }
/// <summary> /// Searches for clients that match the search criteria. /// </summary> public ServiceSearchItem[] SearchService(int startRow, int pageSize, string sortBy, string industry, bool forceRefresh) { TimeServiceClient timeService = null; ServiceSearchItem[] services = null; try { if (HttpContext.Current.Session[SessionName.LogonSettings] != null) { Guid _logonId = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId; CollectionRequest collectionRequest = new CollectionRequest(); collectionRequest.ForceRefresh = forceRefresh; collectionRequest.StartRow = startRow; collectionRequest.RowCount = pageSize; ServiceSearchCriteria criteria = new ServiceSearchCriteria(); criteria.IndustryId = Convert.ToInt32(industry); criteria.OrderBy = sortBy; timeService = new TimeServiceClient(); ServiceSearchReturnValue returnValue = timeService.ServiceSearchOnIndustry(_logonId, collectionRequest, criteria); if (returnValue.Success) { _serviceRowCount = returnValue.Service.TotalRowCount; services = returnValue.Service.Rows; } else { throw new Exception(returnValue.Message); } } return services; } catch (Exception ex) { throw ex; } finally { if (timeService != null) { if (timeService.State != System.ServiceModel.CommunicationState.Faulted) timeService.Close(); } } }