示例#1
0
 /// <summary>
 /// Enumerator's constructor
 /// </summary>
 /// <param name="src"></param>
 private CQRecordSqlQuery(CQRecordSqlQuery src)
     : base(src.m_userSession, src.m_recordFilter, src.m_serviceProvider)
 {
     m_queryStr           = src.m_queryStr;
     m_resultSetDbIds     = src.m_resultSetDbIds;
     m_queryTimeDelimiter = src.m_queryTimeDelimiter;
 }
示例#2
0
        /// <summary>
        /// Enumerate the diff items found based on the query passed in as well as the filterString and version passed
        /// to InitializeForDiff.  The return type is IEnumerable<> so that adapter implementations do not need download and keep
        /// all of the IWITDiffItems in memory at once.
        /// </summary>
        /// <param name="queryCondition">A string that specifies a query used to select a subset of the work items defined by
        /// the set that the filter string identified.</param>
        /// <returns>An enumeration of IWITDiffItems each representing a work item to be compared by the WIT Diff operation</returns>
        public IEnumerable <IWITDiffItem> GetWITDiffItems(string queryCondition)
        {
            List <CQRecordFilter> recordFilters = new List <CQRecordFilter>();

            recordFilters.Add(m_cqRecordFilter);
            if (!string.IsNullOrEmpty(queryCondition))
            {
                CQRecordFilter queryConditionRecordFilter = new CQRecordFilter(m_cqRecordFilter.RecordType, m_cqRecordFilter.SelectFromTable, queryCondition);
                recordFilters.Add(queryConditionRecordFilter);
            }
            CQRecordSqlQuery recordQuery = new CQRecordSqlQuery(m_userSession, recordFilters, null, this);

            foreach (OAdEntity record in recordQuery)
            {
                if (record != null) // this if check is HACK
                {
                    OAdHistoryFields histFields = CQWrapper.GetHistoryFields(record);
                    int historyFldCount         = CQWrapper.HistoryFieldsCount(histFields);
                    yield return(new CQWITDiffItem(this, record, historyFldCount - 1));
                }
            }
        }