示例#1
0
        public static DataSet GetIssues()
        {
            //Get issues
            IssueDS issues = new IssueDS();

            try {
                if (_IssueCache == null)
                {
                    _IssueCacheLastUpdate = DateTime.Today.AddDays(-IssueDaysBack);
                }
                DateTime fromDate = _IssueCacheLastUpdate;

                _Client = new IssueMgtServiceClient();
                DataSet ds = _Client.GetIssuesForDate(fromDate);
                _Client.Close();

                System.Diagnostics.Debug.WriteLine("PAYLOAD: fromDate=" + fromDate.ToString("MM/dd/yyyy HH:mm:ss") + "; bytes=" + ds.GetXml().Length);
                updateIssueCache(ds);
                if (_IssueCache != null)
                {
                    issues.Merge(_IssueCache);
                }
            }
            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(issues);
        }
示例#2
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);
        }
示例#3
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);
        }
示例#4
0
        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);
        }
示例#5
0
        public IssueDS GetIssues(string agentNumber)
        {
            //Get issue search data
            IssueMgtServiceClient client = null;
            IssueDS issues = null;

            try {
                client = new IssueMgtServiceClient();
                if (agentNumber == null)
                {
                    issues = client.GetIssues();
                }
                else
                {
                    issues = new IssueDS();
                    IssueDS _issues = client.GetIssues();
                    issues.Merge(_issues.IssueTable.Select("AgentNumber='" + agentNumber + "'"));
                    issues.Merge(_issues.IssueTable.Select("AgentNumber=''"));
                }
                client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssues() service error.", fe); }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException("GetIssues() timeout error.", te); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException("GetIssues() communication error.", ce); }
            return(issues);
        }
示例#6
0
 public static Attachment[] GetAttachments(long issueID, long actionID)
 {
     //Get attachments for the specified action
     Attachment[] attachments = null;
     try {
         _Client     = new IssueMgtServiceClient();
         attachments = _Client.GetAttachments(issueID, actionID);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("GetAttachments() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetAttachments() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetAttachments() communication error.", ce); }
     return(attachments);
 }
示例#7
0
        public static bool UpdateContact(Contact contact)
        {
            bool res = false;

            try {
                _Client = new IssueMgtServiceClient();
                res     = _Client.UpdateContact(contact);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("UpdateContact() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("UpdateContact() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("UpdateContact() communication error.", ce); }
            return(res);
        }
示例#8
0
 public static Action[] GetActions(long issueID, long actionID)
 {
     //Get all actions chronologically prior to and including the specified action for the specified issue
     Action[] actions = null;
     try {
         _Client = new IssueMgtServiceClient();
         actions = _Client.GetActions(issueID, actionID);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("GetActions() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetActions() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetActions() communication error.", ce); }
     return(actions);
 }
示例#9
0
 public static byte[] GetAttachment(int id)
 {
     //Get an existing file attachment from database
     byte[] bytes = null;
     try {
         _Client = new IssueMgtServiceClient();
         bytes   = _Client.GetAttachment(id);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("GetAttachment() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetAttachment() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetAttachment() communication error.", ce); }
     return(bytes);
 }
示例#10
0
        public static int CreateContact(Contact contact)
        {
            int id = 0;

            try {
                _Client = new IssueMgtServiceClient();
                id      = _Client.CreateContact(contact);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CreateContact() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CreateContact() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CreateContact() communication error.", ce); }
            return(id);
        }
示例#11
0
        public static ContactDS GetContacts(int companyID, string regionNumber, string districtNumber, string agentNumber, string storeNumber)
        {
            ContactDS contacts = null;

            try {
                _Client  = new IssueMgtServiceClient();
                contacts = _Client.GetContactsForLocation(companyID, regionNumber, districtNumber, agentNumber, storeNumber);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetContacts() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetContacts() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetContacts() communication error.", ce); }
            return(contacts);
        }
示例#12
0
        public static CompanyDS GetCompanies(bool activeOnly)
        {
            //Companies
            CompanyDS companies = null;

            try {
                _Client   = new IssueMgtServiceClient();
                companies = _Client.GetActiveCompanies(activeOnly);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetCompanies() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetCompanies() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetCompanies() communication error.", ce); }
            return(companies);
        }
示例#13
0
        public static Issue GetIssue(long issueID)
        {
            //Get an existing issue
            Issue issue = null;

            try {
                _Client = new IssueMgtServiceClient();
                issue   = _Client.GetIssue(issueID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssue() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetIssue() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetIssue() communication error.", ce); }
            return(issue);
        }
示例#14
0
        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);
        }
示例#15
0
        public static string GetActionType(int typeID)
        {
            //Get an action type  for the specified id
            string actionType = "";

            try {
                _Client    = new IssueMgtServiceClient();
                actionType = _Client.GetActionType(typeID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetActionType() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetActionType() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetActionType() communication error.", ce); }
            return(actionType);
        }
示例#16
0
        public static StoreDS GetStoreDetail(int companyID, string subStore)
        {
            //Get a list of store locations
            StoreDS stores = null;

            try {
                _Client = new IssueMgtServiceClient();
                stores  = _Client.GetSubStoreDetail(companyID, subStore);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetStoreDetail() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetStoreDetail() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetStoreDetail() communication error.", ce); }
            return(stores);
        }
示例#17
0
        public static IssueDS SearchIssuesAdvanced(object[] criteria)
        {
            //Get issue search data
            IssueDS search = new IssueDS();

            try {
                _Client = new IssueMgtServiceClient();
                search  = _Client.SearchIssuesAdvanced(criteria);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("SearchIssuesAdvanced() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("SearchIssuesAdvanced() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("SearchIssuesAdvanced() communication error.", ce); }
            return(search);
        }
示例#18
0
        public static bool UpdateIssue(Issue issue)
        {
            //Update an existing issue
            bool b = false;

            try {
                _Client = new IssueMgtServiceClient();
                b       = _Client.UpdateIssue(issue);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("UpdateIssue() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("UpdateIssue() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("UpdateIssue() communication error.", ce); }
            return(b);
        }
示例#19
0
        public static bool CreateIssueAction(byte typeID, long issueID, string userID, string comment)
        {
            //Create a new action
            bool b = false;

            try {
                _Client = new IssueMgtServiceClient();
                b       = _Client.CreateIssueAction(typeID, issueID, userID, comment);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CreateIssueAction() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CreateIssueAction() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CreateIssueAction() communication error.", ce); }
            return(b);
        }
示例#20
0
        public static Contact GetContact(int contactID)
        {
            //Get issue types
            Contact contact = null;

            try {
                _Client = new IssueMgtServiceClient();
                contact = _Client.GetContact(contactID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetContact() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetContact() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetContact() communication error.", ce); }
            return(contact);
        }
示例#21
0
        public static ScanDS GetPODScans(long cProID)
        {
            //Get a list of store locations
            ScanDS scans = null;

            try {
                _Client = new IssueMgtServiceClient();
                scans   = _Client.GetPODScans(cProID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetPODScans() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetPODScans() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetPODScans() communication error.", ce); }
            return(scans);
        }
示例#22
0
        public static DeliveryDS GetDelivery(int companyID, int storeNumber, DateTime from, DateTime to, long proID)
        {
            //Get a list of store locations
            DeliveryDS delivery = null;

            try {
                _Client  = new IssueMgtServiceClient();
                delivery = _Client.GetDelivery(companyID, storeNumber, from, to, proID);
                _Client.Close();
            }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetDelivery() timeout error.", te); }
            catch (FaultException fe) { throw new ApplicationException("GetDelivery() service error.", fe); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetDelivery() communication error.", ce); }
            return(delivery);
        }
示例#23
0
        public static long CreateIssue(Issue issue)
        {
            //Create a new issue
            long iid = 0;

            try {
                _Client = new IssueMgtServiceClient();
                iid     = _Client.CreateIssue(issue);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CreateIssue() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CreateIssue() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CreateIssue() communication error.", ce); }
            return(iid);
        }
示例#24
0
        public static IssueTypeDS GetIssueCategorys()
        {
            //Issue type category
            IssueTypeDS categorys = new IssueTypeDS();

            try {
                _Client   = new IssueMgtServiceClient();
                categorys = _Client.GetIssueCategorys();
                _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(categorys);
        }
示例#25
0
        public static bool CreateIssueAttachment(string name, byte[] bytes, long actionID)
        {
            //Create a new issue
            bool saved = false;

            try {
                _Client = new IssueMgtServiceClient();
                saved   = _Client.CreateIssueAttachment(name, bytes, actionID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CreateIssueAttachment() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CreateIssueAttachment() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CreateIssueAttachment() communication error.", ce); }
            return(saved);
        }
示例#26
0
        public static IssueTypeDS GetIssueTypes(string issueCategory)
        {
            //Issue types- all or filtered by category
            IssueTypeDS issueTypes = null;

            try {
                _Client    = new IssueMgtServiceClient();
                issueTypes = _Client.GetIssueTypes(issueCategory);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetIssueTypes() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetIssueTypes() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetIssueTypes() communication error.", ce); }
            return(issueTypes);
        }
示例#27
0
        public static IssueDS IssueHistory(Issue issue)
        {
            //Get issue history data
            IssueDS history = new IssueDS();

            try {
                _Client = new IssueMgtServiceClient();
                history = new IssueDS(); //_Client.IssueHistory(issue);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("IssueHistory() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("IssueHistory() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("IssueHistory() communication error.", ce); }
            return(history);
        }
示例#28
0
        public static ActionTypeDS GetActionTypes(long issueID)
        {
            //Action types for an issue (state driven)
            ActionTypeDS actionTypes = null;

            try {
                _Client     = new IssueMgtServiceClient();
                actionTypes = _Client.GetIssueActionTypes(issueID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetActionTypes() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetActionTypes() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetActionTypes() communication error.", ce); }
            return(actionTypes);
        }
示例#29
0
        public static string GetCompany(int companyID)
        {
            //Get a company for the specified id
            string company = "";

            try {
                _Client = new IssueMgtServiceClient();
                company = _Client.GetCompany(companyID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetCompany() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetCompany() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetCompany() communication error.", ce); }
            return(company);
        }
示例#30
0
        public static TerminalInfo GetTerminalInfo()
        {
            //Get the operating enterprise terminal
            TerminalInfo terminal = null;

            try {
                _Client  = new IssueMgtServiceClient();
                terminal = _Client.GetTerminalInfo();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTerminalInfo() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() communication error.", ce); }
            return(terminal);
        }