コード例 #1
0
        public ICollection<RelaxWorkItem> GetWorkItemsByPage(RelaxWorkItemType baseEntity, string page, string pageSize)
        {
            ICollection<RelaxWorkItem> workItems = new List<RelaxWorkItem>();

            try
            {
                int pg;
                int pgSize;

                int.TryParse(page, out pg);
                int.TryParse(pageSize, out pgSize);

                var repository = new WorkItemRepository(baseEntity);
                if (pg != 0 && pgSize != 0)
                    workItems = repository.GetWorkItems(baseEntity.TfsTeamProject, baseEntity.Name, pg, pgSize);
                else
                    workItems = repository.GetWorkItems(baseEntity.TfsTeamProject, baseEntity.Name, 1, 6);
            }
            catch (Exception e)
            {
                _eventLog.WriteEntry(e.Message, EventLogEntryType.Error);
                return null;
            }
            return workItems;
        }
コード例 #2
0
        public ICollection<RelaxWorkItem> GetWorkItems(RelaxWorkItemType baseEntity)
        {
            ICollection<RelaxWorkItem> workItems = new List<RelaxWorkItem>();

            try
            {

                var repository = new WorkItemRepository(baseEntity);

                workItems = repository.GetWorkItems(baseEntity.TfsTeamProject, baseEntity.Name);
            }
            catch (Exception e)
            {
                _eventLog.WriteEntry(e.Message, EventLogEntryType.Error);
                return null;
            }
            return workItems;
        }