Ejemplo n.º 1
0
        public IssueDS SearchIssues(string agentNumber, string searchText)
        {
            //Get issue search data
            IssueMgtServiceClient client = null;
            IssueDS issues = new IssueDS();

            try {
                if (searchText.Trim().Length > 0)
                {
                    client = new IssueMgtServiceClient();
                    if (agentNumber == null)
                    {
                        issues = client.SearchIssues(searchText);
                    }
                    else
                    {
                        issues = client.SearchIssuesForAgent(agentNumber, searchText);
                    }
                    client.Close();
                }
            }
            catch (FaultException fe) { throw new ApplicationException("SearchIssues() service error.", fe); }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException("SearchIssues() timeout error.", te); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException("SearchIssues() communication error.", ce); }
            return(issues);
        }