示例#1
0
        /// <summary>
        /// Executes a query.
        /// </summary>
        /// <param name="agent">Agent who executes the query.</param>
        /// <param name="className">Class name to query.</param>
        /// <param name="alternateKeyName">Indicates the alternate key name of the .</param>
        /// <param name="displaySet">DisplaySet</param>
        /// <param name="queryInstance">Query to execute.</param>
        /// <param name="orderCriteria">Order criteria.</param>
        /// <param name="navigationalFiltering">Navigational Filtering object.</param>
        /// <returns>DataTable with rows of result Query.</returns>
        private DataTable ExecuteQuery(
            Oid agent,
            string className,
            string alternateKeyName,
            string displaySet,
            QueryInstance queryInstance,
            string orderCriteria,
            NavigationalFiltering navigationalFiltering)
        {
            //Create the Query Request.
            QueryRequest lQueryRequest = new QueryRequest(
                className, displaySet,
                queryInstance, orderCriteria,
                navigationalFiltering);

            lQueryRequest.AlternateKeyName = alternateKeyName;

            // Create the Request.
            Request lRequest = new Request(lQueryRequest, agent);
            // Send Request to Server.
            Response lResponse = this.Send(lRequest);

            if ((lResponse != null) && (lResponse.Query != null))
            {
                return(lResponse.Query.Data);
            }
            return(null);
        }
示例#2
0
 public QueryRequest(
     string className,
     List <string> displaySet,
     QueryInstance queryInstance,
     string orderCriteria,
     NavigationalFiltering navigationalFiltering)
     : this(className, string.Empty, queryInstance, orderCriteria, navigationalFiltering)
 {
     this.DisplaySet.AddRange(displaySet);
 }
示例#3
0
 /// <summary>
 /// Executes a query.
 /// </summary>
 /// <param name="agent">Agent who executes the query.</param>
 /// <param name="className">Class name to query.</param>
 /// <param name="displaySet">DisplaySet</param>
 /// <param name="queryInstance">Query to execute.</param>
 /// <param name="orderCriteria">Order criteria.</param>
 /// <param name="navigationalFiltering">Navigational Filtering object.</param>
 /// <returns>DataTable with rows of result Query.</returns>
 private DataTable ExecuteQuery(
     Oid agent,
     string className,
     string displaySet,
     QueryInstance queryInstance,
     string orderCriteria,
     NavigationalFiltering navigationalFiltering)
 {
     return(this.ExecuteQuery(agent, className, string.Empty, displaySet, queryInstance, orderCriteria, navigationalFiltering));
 }
示例#4
0
 public QueryRequest(
     string className,
     string displaySet,
     QueryInstance queryInstance,
     string orderCriteria,
     NavigationalFiltering navigationalFiltering)
 {
     this.Class                 = className;
     this.DisplayItems          = displaySet;
     this.QueryInstance         = queryInstance;
     this.OrderCriteria         = orderCriteria;
     this.NavigationalFiltering = navigationalFiltering;
 }
示例#5
0
        /// <summary>
        /// Executes a query related to an specific Oid.
        /// </summary>
        /// <param name="agent">Agent who initiates the query.</param>
        /// <param name="className">Class the query is executed on.</param>
        /// <param name="alternateKeyName">Indicates the name of the alternate key that is desired to use.</param>
        /// <param name="oid">Oid involved.</param>
        /// <param name="displaySet">DisplaySet where the query is executed.</param>
        /// <returns>DataTable with the result query.</returns>
        public DataTable ExecuteQueryInstance(Oid agent, string className, string alternateKeyName, Oid oid, string displaySet)
        {
            DataTable lResult = null;

            // Build Query Instance.
            if (oid != null)
            {
                QueryInstance lQueryInstance = new QueryInstance(oid);
                lResult = ExecuteQuery(agent, className, alternateKeyName, displaySet, lQueryInstance, null, null);
            }
            else
            {
                throw new ArgumentNullException("ExecuteQueryInstance ->Oid is null");
            }
            return(lResult);
        }
示例#6
0
 protected void SetAlternateKeyFromQueryInstance()
 {
     if (IsQueryInstance)
     {
         QueryInstance query = this.QueryInstance;
         if (!query.IsAlternateKey())
         {
             string alternateKeyName = string.Empty;
             if (HasAlternateKeyName())
             {
                 alternateKeyName = AlternateKeyName;
             }
             else
             {
                 alternateKeyName = query.Oid.AlternateKeyName;
             }
             AlternateKeyName = alternateKeyName;
         }
     }
 }
示例#7
0
        public QueryRequest(
			string className,
			string displaySet,
			QueryInstance queryInstance,
			string orderCriteria,
			NavigationalFiltering navigationalFiltering)
        {
            this.Class = className;
            this.DisplayItems = displaySet;
            this.QueryInstance = queryInstance;
            this.OrderCriteria = orderCriteria;
            this.NavigationalFiltering = navigationalFiltering;
        }
示例#8
0
        public QueryRequest(
				string className,
				List<string> displaySet,
				QueryInstance queryInstance,
				string orderCriteria,
				NavigationalFiltering navigationalFiltering)
            : this(className, string.Empty, queryInstance, orderCriteria, navigationalFiltering)
        {
            this.DisplaySet.AddRange(displaySet);
        }
示例#9
0
        /// <summary>
        /// Executes a query.
        /// </summary>
        /// <param name="agent">Agent who executes the query.</param>
        /// <param name="className">Class name to query.</param>
        /// <param name="alternateKeyName">Indicates the alternate key name of the .</param>
        /// <param name="displaySet">DisplaySet</param>
        /// <param name="queryInstance">Query to execute.</param>
        /// <param name="orderCriteria">Order criteria.</param>
        /// <param name="navigationalFiltering">Navigational Filtering object.</param>
        /// <returns>DataTable with rows of result Query.</returns>
        private DataTable ExecuteQuery(
			Oid agent,
			string className,
			string alternateKeyName,
			string displaySet,
			QueryInstance queryInstance,
			string orderCriteria,
			NavigationalFiltering navigationalFiltering)
        {
            //Create the Query Request.
            QueryRequest lQueryRequest = new QueryRequest(
                            className, displaySet,
                            queryInstance, orderCriteria,
                            navigationalFiltering);

            lQueryRequest.AlternateKeyName = alternateKeyName;

            // Create the Request.
            Request lRequest = new Request(lQueryRequest, agent);
            // Send Request to Server.
            Response lResponse = this.Send(lRequest);
            if ((lResponse != null) && (lResponse.Query != null))
            {
                return lResponse.Query.Data;
            }
            return null;
        }
示例#10
0
        /// <summary>
        /// Executes a query.
        /// </summary>
        /// <param name="agent">Agent who executes the query.</param>
        /// <param name="className">Class name to query.</param>
        /// <param name="displaySet">DisplaySet</param>
        /// <param name="queryInstance">Query to execute.</param>
        /// <param name="orderCriteria">Order criteria.</param>
        /// <param name="navigationalFiltering">Navigational Filtering object.</param>
        /// <returns>DataTable with rows of result Query.</returns>
        private DataTable ExecuteQuery(
				Oid agent,
				string className,
				string displaySet,
				QueryInstance queryInstance,
				string orderCriteria,
				NavigationalFiltering navigationalFiltering)
        {
            return this.ExecuteQuery(agent, className, string.Empty, displaySet, queryInstance, orderCriteria, navigationalFiltering);
        }
示例#11
0
 /// <summary>
 /// Executes a query related to an specific Oid.
 /// </summary>
 /// <param name="agent">Agent who initiates the query.</param>
 /// <param name="className">Class the query is executed on.</param>
 /// <param name="alternateKeyName">Indicates the name of the alternate key that is desired to use.</param>
 /// <param name="oid">Oid involved.</param>
 /// <param name="displaySet">DisplaySet where the query is executed.</param>
 /// <returns>DataTable with the result query.</returns>
 public DataTable ExecuteQueryInstance(Oid agent, string className, string alternateKeyName, Oid oid, string displaySet)
 {
     DataTable lResult = null;
     // Build Query Instance.
     if (oid != null)
     {
         QueryInstance lQueryInstance = new QueryInstance(oid);
         lResult = ExecuteQuery(agent, className, alternateKeyName, displaySet, lQueryInstance, null, null);
     }
     else
     {
         throw new ArgumentNullException("ExecuteQueryInstance ->Oid is null");
     }
     return lResult;
 }