Ejemplo n.º 1
0
        public IssueTypeDataset GetIssueCategories(string agentNumber)
        {
            //Issue type category
            IssueTypeDataset categorys = new IssueTypeDataset();

            try {
                IssueTypeDataset _categorys = new IssueTypeDataset();
                IssueTypeDataset issueTypes = GetIssueTypes("");
                Hashtable        groups     = new Hashtable();
                for (int i = 0; i < issueTypes.IssueTypeTable.Rows.Count; i++)
                {
                    if (!groups.ContainsKey(issueTypes.IssueTypeTable[i].Category))
                    {
                        groups.Add(issueTypes.IssueTypeTable[i].Category, issueTypes.IssueTypeTable[i].Category);
                        _categorys.IssueTypeTable.AddIssueTypeTableRow(0, "", issueTypes.IssueTypeTable[i].Category, "");
                    }
                }
                if (agentNumber == null)
                {
                    categorys.Merge(_categorys);
                }
                else
                {
                    categorys.Merge(_categorys.IssueTypeTable.Select("Category='Agent/Local'"));
                }
                categorys.AcceptChanges();
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message); }
            return(categorys);
        }
Ejemplo n.º 2
0
        public IssueTypeDataset GetIssueTypes(string issueCategory)
        {
            //Issue types for a category, or category="" for all types
            IssueTypeDataset issueTypes = new IssueTypeDataset();
            CRMServiceClient client     = new CRMServiceClient();

            try {
                DataSet ds = client.GetIssueTypes(issueCategory);
                client.Close();
                if (ds.Tables["IssueTypeTable"] != null && ds.Tables["IssueTypeTable"].Rows.Count > 0)
                {
                    issueTypes.Merge(ds);
                }
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(issueTypes);
        }