/// <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> /// /// </summary> /// <param name="oHostSecurityToken"></param> /// <param name="collectionRequest"></param> /// <returns></returns> public ServiceSearchReturnValue ServiceSearch(HostSecurityToken oHostSecurityToken, CollectionRequest collectionRequest, int associationRoleId) { ServiceSearchReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oTimeService = new TimeService(); returnValue = oTimeService.ServiceSearch(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest, associationRoleId); } else { returnValue = new ServiceSearchReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return(returnValue); }
/// <summary> /// Get service search on industry /// </summary> /// <param name="oHostSecurityToken"></param> /// <param name="collectionRequest"></param> /// <param name="criteria"></param> /// <returns></returns> public ServiceSearchReturnValue ServiceSearchOnIndustry(HostSecurityToken oHostSecurityToken, CollectionRequest collectionRequest, ServiceSearchCriteria criteria) { ServiceSearchReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oTimeService = new TimeService(); returnValue = oTimeService.ServiceSearchOnIndustry(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest, criteria); } else { returnValue = new ServiceSearchReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return(returnValue); }
/// <summary> /// Get service search on industry /// </summary> /// <param name="oHostSecurityToken"></param> /// <param name="collectionRequest"></param> /// <param name="criteria"></param> /// <returns></returns> public ServiceSearchReturnValue ServiceSearchOnIndustry(HostSecurityToken oHostSecurityToken, CollectionRequest collectionRequest, ServiceSearchCriteria criteria) { ServiceSearchReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oTimeService = new TimeService(); returnValue = oTimeService.ServiceSearchOnIndustry(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest, criteria); } else { returnValue = new ServiceSearchReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return returnValue; }
/// <summary> /// /// </summary> /// <param name="oHostSecurityToken"></param> /// <param name="collectionRequest"></param> /// <returns></returns> public ServiceSearchReturnValue ServiceSearch(HostSecurityToken oHostSecurityToken, CollectionRequest collectionRequest, int associationRoleId) { ServiceSearchReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oTimeService = new TimeService(); returnValue = oTimeService.ServiceSearch(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest, associationRoleId); } else { returnValue = new ServiceSearchReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return returnValue; }