示例#1
0
        public CQRecordStoredQueryQuery(
            Session userSession,
            CQRecordFilter recordFilter,
            string hwmStr,
            IServiceProvider serviceProvider)
            : base(userSession, recordFilter, serviceProvider)
        {
            if (!(recordFilter is CQRecordStoredQueryFilter))
            {
                throw new ArgumentException("recordFilter is not CQRecordStoredQueryFilter");
            }

            m_queryDef = CQWrapper.GetQueryDef(
                CQWrapper.GetWorkSpace(m_userSession), ((CQRecordStoredQueryFilter)m_recordFilter).StoredQueryName);

            string originalQueryString = NormalizeSqlQuery(m_queryDef.SQL);

            if (string.IsNullOrEmpty(hwmStr))
            {
                m_queryStr = originalQueryString;
            }
            else
            {
                m_queryStr = UtilityMethods.Format(QueryBase, originalQueryString, hwmStr);
            }

            Query();
        }
示例#2
0
        public CQRecordStoredQueryQuery(
            Session userSession,
            CQRecordFilter recordFilter,
            string hwmStr,
            IServiceProvider serviceProvider)
            : base(userSession, recordFilter, serviceProvider)
        {
            if (!(recordFilter is CQRecordStoredQueryFilter))
            {
                throw new ArgumentException("recordFilter is not CQRecordStoredQueryFilter");
            }

            ClearQuestMigrationContext cqContext = serviceProvider.GetService(typeof(ClearQuestMigrationContext)) as ClearQuestMigrationContext;

            m_queryTimeDelimiter = (cqContext == null) ? ClearQuestConstants.CQQueryDefaultTimeDelimiter : cqContext.CQQueryTimeDelimiter;

            m_queryDef = CQWrapper.GetQueryDef(
                CQWrapper.GetWorkSpace(m_userSession), ((CQRecordStoredQueryFilter)m_recordFilter).StoredQueryName);

            string originalQueryString = NormalizeSqlQuery(m_queryDef.SQL);

            if (string.IsNullOrEmpty(hwmStr))
            {
                m_queryStr = originalQueryString;
            }
            else
            {
                m_queryStr = UtilityMethods.Format(QueryBase, originalQueryString, m_queryTimeDelimiter, hwmStr, m_queryTimeDelimiter);
            }

            Query();
        }
示例#3
0
        public CQRecordStoredQueryFilter(string storedQueryName, ClearQuestOleServer.Session userSession)
            : base(string.Empty)
        {
            StoredQueryName = storedQueryName;

            if (null != userSession)
            {
                OAdQuerydef qryDef = CQWrapper.GetQueryDef(CQWrapper.GetWorkSpace(userSession), StoredQueryName);
                base.RecordType = CQWrapper.GetPrimaryEntityDefName(qryDef);
            }
        }