예제 #1
0
        public IssueTypeDS GetIssueCategorys(string agentNumber)
        {
            //Get issue categories
            IssueMgtServiceClient client = null;
            IssueTypeDS           cats   = null;

            try {
                cats   = new IssueTypeDS();
                client = new IssueMgtServiceClient();
                IssueTypeDS _cats = client.GetIssueCategorys();
                if (agentNumber == null)
                {
                    cats.Merge(_cats);
                }
                else
                {
                    cats.Merge(_cats.IssueTypeTable.Select("Category='Agent/Local'"));
                }
                client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssueCategorys() service error.", fe); }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException("GetIssueCategorys() timeout error.", te); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException("GetIssueCategorys() communication error.", ce); }
            return(cats);
        }
예제 #2
0
        public IssueTypeDS GetIssueTypes(string issueCategory)
        {
            //Issue types- all or filtered by category
            IssueTypeDS issueTypes = new IssueTypeDS();

            try {
                DataSet ds = fillDataset(USP_ISSUETYPES, TBL_ISSUETYPES, new object[] { });
                if (ds.Tables[TBL_ISSUETYPES].Rows.Count > 0)
                {
                    if (issueCategory != null && issueCategory.Trim().Length > 0)
                    {
                        IssueTypeDS _ds = new IssueTypeDS();
                        _ds.Merge(ds.Tables[TBL_ISSUETYPES].Select("Category='" + issueCategory + "'"));
                        issueTypes.Merge(_ds);
                    }
                    else
                    {
                        issueTypes.Merge(ds);
                    }
                }
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while reading issue types.", ex); }
            return(issueTypes);
        }