public AgentDS GetAgentsForClient(string clientNumber, string agentNumber) { //Get issue search data IssueMgtServiceClient client = null; AgentDS agents = null; try { agents = new AgentDS(); client = new IssueMgtServiceClient(); AgentDS _agents = client.GetAgentsForClient(clientNumber); if (agentNumber == null) { agents.Merge(_agents); } else { agents.Merge(_agents.AgentTable.Select("AgentNumber='" + agentNumber + "'")); } client.Close(); } catch (FaultException fe) { throw new ApplicationException("GetAgentsForClient() service error.", fe); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException("GetAgentsForClient() timeout error.", te); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException("GetAgentsForClient() communication error.", ce); } return(agents); }
public static AgentDS GetAgents(string clientNumber) { //Get a list of agents for the specified client AgentDS agents = null; try { _Client = new IssueMgtServiceClient(); agents = _Client.GetAgentsForClient(clientNumber); _Client.Close(); } catch (FaultException fe) { throw new ApplicationException("GetAgents() service error.", fe); } catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetAgents() timeout error.", te); } catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetAgents() communication error.", ce); } return(agents); }