Ejemplo n.º 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);
        }