コード例 #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
        /// <summary>
        /// Executes a query and applies a filter on a population related to a navigational filtering.
        /// The filter variables are ArgumentsList.
        /// </summary>
        /// <param name="agent">Agent</param>
        /// <param name="className">Class Name.</param>
        /// <param name="filterName">Filter Name.</param>
        /// <param name="filterVariables">Filter variables.</param>
        /// <param name="linkItems">Related Oids.</param>
        /// <param name="displaySet">Display Set in format "Atribute1, attribute2, ...".</param>
        /// <param name="orderCriteria">Order Criteria.</param>
        /// <param name="navigationalFiltering">Navigational Filtering.</param>
        /// <param name="lastOid">Last Oid</param>
        /// <param name="blockSize">Block Size 0 = All.</param>
        /// <returns>DataTable with rows of result Query.</returns>
        public DataTable ExecuteQueryFilter(
            Oid agent,
            string className,
            string filterName,
            ArgumentsList filterVariables,
            Dictionary <string, Oid> linkItems,
            string displaySet,
            string orderCriteria,
            NavigationalFiltering navigationalFiltering,
            Oid lastOid,
            int blockSize)
        {
            // Create Filter Variables.
            FilterVariables lFilterVariables = null;

            if (filterVariables != null)
            {
                lFilterVariables = new FilterVariables();
                foreach (ArgumentInfo lArgumentInfo in filterVariables)
                {
                    lFilterVariables.Add(lArgumentInfo.Name, lArgumentInfo.Type, lArgumentInfo.Value, lArgumentInfo.ClassName);
                }
            }
            return(ExecuteFilter(agent, className, filterName, lFilterVariables, linkItems, displaySet, orderCriteria, navigationalFiltering, lastOid, blockSize));
        }
コード例 #3
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);
 }
コード例 #4
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));
 }
コード例 #5
0
        /// <summary>
        /// Executes a query related with an Oid and Navigational Filtering.
        /// </summary>
        /// <param name="agent">Agent.</param>
        /// <param name="className">Class name.</param>
        /// <param name="displaySet">DisplaySet.</param>
        /// <param name="navigationalFiltering">Navigational filtering.</param>
        /// <param name="blockSize">Block size.</param>
        /// <returns>DataTable.</returns>
        public DataTable ExecuteQueryRelated(
            Oid agent,
            string className,
            string displaySet,
            NavigationalFiltering navigationalFiltering,
            int blockSize)
        {
            QueryRelated lQueryRelated = new QueryRelated(blockSize);

            return(ExecuteQuery(agent, className, displaySet, lQueryRelated, string.Empty, navigationalFiltering));
        }
コード例 #6
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;
 }
コード例 #7
0
        /// <summary>
        /// Executes a query related with an Oid in a Navigational Filtering. Related Oids are indicated.
        /// </summary>
        /// <param name="agent">Agent for Query.</param>
        /// <param name="className">Class Name to Query.</param>
        /// <param name="linkItems">Related Items to Query.</param>
        /// <param name="displaySet">Display set of attributes to show</param>
        /// <param name="orderCriteria">Sort or order Criteria.</param>
        /// <param name="NavigationalFiltering">Navigational Filtering.</param>
        /// <param name="lastOid">Last Oid.</param>
        /// <param name="blockSize">Block Size.</param>
        /// <returns>DataTable with Block Size of Rows.</returns>
        public DataTable ExecuteQueryRelated(
            Oid agent,
            string className,
            Dictionary <string, Oid> linkItems,
            string displaySet,
            string orderCriteria,
            NavigationalFiltering navigationalFiltering,
            Oid lastOid,
            int blockSize)
        {
            QueryRelated lQueryRelated = new QueryRelated(linkItems, lastOid, blockSize);

            return(ExecuteQuery(agent, className, displaySet, lQueryRelated, orderCriteria, navigationalFiltering));
        }
コード例 #8
0
        /// <summary>
        /// Executes a query and applies a filter on a population related to a navigational filtering.
        /// The filter variables are two collections.
        /// </summary>
        /// <param name="agent">Agent</param>
        /// <param name="className">Class Name.</param>
        /// <param name="filterName">Filter Name.</param>
        /// <param name="variableTypes">Filter variables types.</param>
        /// <param name="variableValues">Filter variables values.</param>
        /// <param name="variableDomains">Filter variables domains.</param>
        /// <param name="linkItems">Related Oids.</param>
        /// <param name="displaySet">Display Set in format "Atribute1, attribute2, ...".</param>
        /// <param name="orderCriteria">Order Criteria.</param>
        /// <param name="navigationalFiltering">Navigational Filter.</param>
        /// <param name="lastOid">Last Oid</param>
        /// <param name="blockSize">Block Size 0 = All.</param>
        /// <returns>DataTable with rows of result Query.</returns>
        public DataTable ExecuteQueryFilter(
			Oid agent,
			string className,
			string filterName,
			Dictionary<string, ModelType> variableTypes,
			Dictionary<string, object> variableValues,
			Dictionary<string, string> variableDomains,
			Dictionary<string, Oid> linkItems,
			string displaySet,
			string orderCriteria,
			NavigationalFiltering navigationalFiltering,
			Oid lastOid,
			int blockSize)
        {
            // Create Filter Variables.
            FilterVariables lFilterVariables = new FilterVariables(variableTypes, variableValues, variableDomains);
            return ExecuteFilter(agent,className,filterName,lFilterVariables,linkItems,displaySet, orderCriteria,navigationalFiltering,lastOid,blockSize);
        }
コード例 #9
0
        /// <summary>
        /// Executes a query and applies a filter on a population related to a navigational filtering.
        /// The filter variables are two collections.
        /// </summary>
        /// <param name="agent">Agent</param>
        /// <param name="className">Class Name.</param>
        /// <param name="filterName">Filter Name.</param>
        /// <param name="variableTypes">Filter variables types.</param>
        /// <param name="variableValues">Filter variables values.</param>
        /// <param name="variableDomains">Filter variables domains.</param>
        /// <param name="linkItems">Related Oids.</param>
        /// <param name="displaySet">Display Set in format "Atribute1, attribute2, ...".</param>
        /// <param name="orderCriteria">Order Criteria.</param>
        /// <param name="navigationalFiltering">Navigational Filter.</param>
        /// <param name="lastOid">Last Oid</param>
        /// <param name="blockSize">Block Size 0 = All.</param>
        /// <returns>DataTable with rows of result Query.</returns>
        public DataTable ExecuteQueryFilter(
            Oid agent,
            string className,
            string filterName,
            Dictionary <string, ModelType> variableTypes,
            Dictionary <string, object> variableValues,
            Dictionary <string, string> variableDomains,
            Dictionary <string, Oid> linkItems,
            string displaySet,
            string orderCriteria,
            NavigationalFiltering navigationalFiltering,
            Oid lastOid,
            int blockSize)
        {
            // Create Filter Variables.
            FilterVariables lFilterVariables = new FilterVariables(variableTypes, variableValues, variableDomains);

            return(ExecuteFilter(agent, className, filterName, lFilterVariables, linkItems, displaySet, orderCriteria, navigationalFiltering, lastOid, blockSize));
        }
コード例 #10
0
        /// <summary>
        /// Creates an instance of QueryFilter & call ExecuteQuery.
        /// </summary>
        /// <param name="agent">Agent authenticate.</param>
        /// <param name="className">Class name.</param>
        /// <param name="filterName">Filter name.</param>
        /// <param name="filterVariables">Filter variables.</param>
        /// <param name="linkItems">Related Oids.</param>
        /// <param name="displaySet">Display set to retrive.</param>
        /// <param name="orderCriteria">Order criteria name.</param>
        /// <param name="navigationalFiltering">Navegational Filtering.</param>
        /// <param name="lastOid">Last Oid</param>
        /// <param name="blockSize">Block Size.</param>
        /// <returns>Datable with result of query.</returns>
        private DataTable ExecuteFilter(
            Oid agent,
            string className,
            string filterName,
            FilterVariables filterVariables,
            Dictionary <string, Oid> linkItems,
            string displaySet,
            string orderCriteria,
            NavigationalFiltering navigationalFiltering,
            Oid lastOid,
            int blockSize)
        {
            // Create the Query Filter.
            QueryFilter lQueryFilter = new QueryFilter(filterName, filterVariables, linkItems, lastOid, blockSize);
            DataTable   lResult      = ExecuteQuery(agent, className, displaySet, lQueryFilter, orderCriteria, navigationalFiltering);

            if (lResult != null)
            {
                // Add the name of Query Filter.
                lResult.ExtendedProperties.Add("QueryFilterName", filterName);
            }
            return(lResult);
        }
コード例 #11
0
ファイル: ClassLogic.cs プロジェクト: sgon1853/UPM_MDD_Thesis
        /// <summary>
        /// Execute a query related with other instance.
        /// </summary>
        /// <param name="agent">Application agent.</param>
        /// <param name="linkItems">List of related instance oids (path - role).</param>
        /// <param name="displaySet">List of attributes to return.</param>
        /// <param name="orderCriteria">Order criteria name.</param>
        /// <param name="lastOid">Oid from which to search (not included).</param>
        /// <param name="blockSize">Number of instances to return (0 for all population).</param>
        /// <param name="lastBlock">Indicates if it is last block.</param>
        /// <returns>A DataTable with the instances searched.</returns>
        public static DataTable ExecuteQueryRelated(Oid agent, Dictionary<string, Oid> linkItems, string displaySet, string orderCriteria, NavigationalFiltering navigationalFiltering, Oid lastOid, int blockSize, ref bool lastBlock)
        {
            DataTable lDataTable = Logic.Adaptor.ExecuteQueryRelated(agent, "RevisionPasajero", linkItems, displaySet, orderCriteria, navigationalFiltering, lastOid, blockSize);

            // Last block
            if (lDataTable.ExtendedProperties.Contains("LastBlock"))
            {
                lastBlock = (bool)lDataTable.ExtendedProperties["LastBlock"];
            }
            else
            {
                lastBlock = false;
            }

            return lDataTable;
        }
コード例 #12
0
        /// <summary>
        /// Executes a query related with an Oid and Navigational Filtering.
        /// </summary>
        /// <param name="agent">Agent.</param>
        /// <param name="className">Class name.</param>
        /// <param name="displaySet">DisplaySet.</param>
        /// <param name="navigationalFiltering">Navigational filtering.</param>
        /// <param name="blockSize">Block size.</param>
        /// <returns>DataTable.</returns>
        public DataTable ExecuteQueryRelated(
			Oid agent,
			string className,
			string displaySet,
			NavigationalFiltering navigationalFiltering,
			int blockSize)
        {
            QueryRelated lQueryRelated = new QueryRelated(blockSize);

            return ExecuteQuery(agent, className, displaySet, lQueryRelated, string.Empty, navigationalFiltering);
        }
コード例 #13
0
ファイル: ClassLogic.cs プロジェクト: sgon1853/UPM_MDD_Thesis
 /// <summary>
 /// Execute a query to retrieve a set of instances, without any condition.
 /// </summary>
 /// <param name="agent">Application agent.</param>
 /// <param name="displaySet">List of attributes to return.</param>
 /// <param name="orderCriteria">Order criteria name.</param>
 /// <param name="lastOid">Oid from which to search (not included).</param>
 /// <param name="blockSize">Number of instances to return (0 for all population).</param>
 /// <returns>A DataTable with the instances searched.</returns>
 public static DataTable ExecuteQueryPopulation(Oid agent, string displaySet, string orderCriteria, NavigationalFiltering navigationalFiltering, Oid lastOid, int blockSize, ref bool lastBlock)
 {
     return ExecuteQueryRelated(agent, new Dictionary<string, Oid>(), displaySet, orderCriteria, navigationalFiltering, lastOid, blockSize, ref lastBlock);
 }
コード例 #14
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;
        }
コード例 #15
0
        /// <summary>
        /// Executes a query related with an Oid in a Navigational Filtering. Related Oids are indicated.
        /// </summary>
        /// <param name="agent">Agent for Query.</param>
        /// <param name="className">Class Name to Query.</param>
        /// <param name="linkItems">Related Items to Query.</param>
        /// <param name="displaySet">Display set of attributes to show</param>
        /// <param name="orderCriteria">Sort or order Criteria.</param>
        /// <param name="NavigationalFiltering">Navigational Filtering.</param>
        /// <param name="lastOid">Last Oid.</param>
        /// <param name="blockSize">Block Size.</param>
        /// <returns>DataTable with Block Size of Rows.</returns>
        public DataTable ExecuteQueryRelated(
			Oid agent,
			string className,
			Dictionary<string, Oid> linkItems,
			string displaySet,
			string orderCriteria,
			NavigationalFiltering navigationalFiltering,
			Oid lastOid,
			int blockSize)
        {
            QueryRelated lQueryRelated = new QueryRelated(linkItems, lastOid, blockSize);

            return ExecuteQuery(agent, className, displaySet, lQueryRelated, orderCriteria, navigationalFiltering);
        }
コード例 #16
0
        /// <summary>
        /// Obtains the NavigationalFiltering contained in a IUContext.
        /// </summary>
        /// <param name="context">Context the NavigationalFiltering is obtained from.</param>
        /// <returns>NavigationalFiltering contained in the context.</returns>
        public static NavigationalFiltering GetNavigationalFiltering(IUContext context)
        {
            NavigationalFiltering lResult = null;
            if (HasNavigationalFiltering(context))
            {
                switch (context.ExchangeInformation.ExchangeType)
                {
                    case ExchangeType.Navigation:
                        {
                            ExchangeInfoNavigation lExchangeInfo = context.ExchangeInformation as ExchangeInfoNavigation;
                            lResult = new NavigationalFiltering(
                            new SelectedObjectNavigationFiltering(
                            lExchangeInfo.NavigationalFilterIdentity,
                            lExchangeInfo.SelectedOids[0]));
                        }
                        break;
                    case ExchangeType.Action:
                        {
                            ExchangeInfoAction lExchangeInfo = context.ExchangeInformation as ExchangeInfoAction;
                            if ((lExchangeInfo.SelectedOids == null) || (lExchangeInfo.SelectedOids.Count == 0) || (lExchangeInfo.SelectedOids[0] == null))
                            {
                                IUServiceContext lServiceContext = context.ExchangeInformation.Previous as IUServiceContext;

                                ArgumentsList lArguments = ArgumentsList.GetArgumentsFromContext(lServiceContext);
                                lResult = new NavigationalFiltering(
                                new ServiceIUNavigationFiltering(
                                lExchangeInfo.NavigationalFilterIdentity,
                                lArguments));
                            }
                            else
                            {
                                lResult = new NavigationalFiltering(
                                new SelectedObjectNavigationFiltering(
                                lExchangeInfo.NavigationalFilterIdentity,
                                lExchangeInfo.SelectedOids[0]));
                            }
                        }
                        break;
                    case ExchangeType.SelectionForward:
                        {
                            ExchangeInfoSelectionForward lExchangeInfo = context.ExchangeInformation as ExchangeInfoSelectionForward;
                            ArgumentsList lArguments = null;
                            IUServiceContext lServiceContext = null;
                            IUPopulationContext lPopulationContext = null;
                            string lClassName = string.Empty;

                            // context is of IUServiceContext type.
                            if (context.ExchangeInformation.Previous.ContextType == ContextType.Service)
                            {
                                lServiceContext = context.ExchangeInformation.Previous as IUServiceContext;
                                lArguments = ArgumentsList.GetArgumentsFromContext(lServiceContext);
                                lClassName = lServiceContext.ClassName;
                            if (string.Compare(lClassName, "Global", true) == 0)
                            {
                                lClassName = string.Empty;
                            }

                            lResult = new NavigationalFiltering(
                                new ArgumentNavigationFiltering(
                                        lClassName,
                                        lServiceContext.ServiceName,
                                        lServiceContext.SelectedInputField,
                                        lArguments));
                            }
                            // context is of lPopulationContext type.
                            if (context.ExchangeInformation.Previous.ContextType == ContextType.Population)
                            {
                                lPopulationContext = context.ExchangeInformation.Previous as IUPopulationContext;
                                lClassName = lPopulationContext.ClassName;
                                string lFilterName = lExchangeInfo.ServiceName;
                                string lFilterVariableName = lExchangeInfo.ArgumentName;
                                lArguments = ArgumentsList.GetArgumentsFromContext(lPopulationContext.Filters[lFilterName]);

                                lResult = new NavigationalFiltering(
                                    new FilterVariableNavigationFiltering(
                                        lClassName,
                                        lFilterName,
                                        lFilterVariableName,
                                        lArguments));
                            }
                        }
                        break;
                    case ExchangeType.SelectionBackward:
                        break;
                    default:
                        break;
                }
            }
            return lResult;
        }
コード例 #17
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);
        }
コード例 #18
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;
        }
コード例 #19
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);
        }
コード例 #20
0
        /// <summary>
        /// Creates an instance of QueryFilter & call ExecuteQuery.
        /// </summary>
        /// <param name="agent">Agent authenticate.</param>
        /// <param name="className">Class name.</param>
        /// <param name="filterName">Filter name.</param>
        /// <param name="filterVariables">Filter variables.</param>
        /// <param name="linkItems">Related Oids.</param>
        /// <param name="displaySet">Display set to retrive.</param>
        /// <param name="orderCriteria">Order criteria name.</param>
        /// <param name="navigationalFiltering">Navegational Filtering.</param>
        /// <param name="lastOid">Last Oid</param>
        /// <param name="blockSize">Block Size.</param>
        /// <returns>Datable with result of query.</returns>
        private DataTable ExecuteFilter(
			Oid agent,
			string className,
			string filterName,
			FilterVariables filterVariables,
			Dictionary<string, Oid> linkItems,
			string displaySet,
			string orderCriteria,
			NavigationalFiltering navigationalFiltering,
			Oid lastOid,
			int blockSize)
        {
            // Create the Query Filter.
            QueryFilter lQueryFilter = new QueryFilter(filterName, filterVariables, linkItems, lastOid, blockSize);
            DataTable lResult = ExecuteQuery(agent, className, displaySet, lQueryFilter, orderCriteria, navigationalFiltering);
            if (lResult != null)
            {
                // Add the name of Query Filter.
                lResult.ExtendedProperties.Add("QueryFilterName", filterName);
            }
            return lResult;
        }
コード例 #21
0
        /// <summary>
        /// Executes a query and applies a filter on a population related to a navigational filtering.
        /// The filter variables are ArgumentsList.
        /// </summary>
        /// <param name="agent">Agent</param>
        /// <param name="className">Class Name.</param>
        /// <param name="filterName">Filter Name.</param>
        /// <param name="filterVariables">Filter variables.</param>
        /// <param name="linkItems">Related Oids.</param>
        /// <param name="displaySet">Display Set in format "Atribute1, attribute2, ...".</param>
        /// <param name="orderCriteria">Order Criteria.</param>
        /// <param name="navigationalFiltering">Navigational Filtering.</param>
        /// <param name="lastOid">Last Oid</param>
        /// <param name="blockSize">Block Size 0 = All.</param>
        /// <returns>DataTable with rows of result Query.</returns>
        public DataTable ExecuteQueryFilter(
			Oid agent,
			string className,
			string filterName,
			ArgumentsList filterVariables,
			Dictionary<string, Oid> linkItems,
			string displaySet,
			string orderCriteria,
			NavigationalFiltering navigationalFiltering,
			Oid lastOid,
			int blockSize)
        {
            // Create Filter Variables.
            FilterVariables lFilterVariables = null;
            if (filterVariables!= null)
            {
                lFilterVariables = new FilterVariables();
                foreach (ArgumentInfo lArgumentInfo in filterVariables)
                {
                    lFilterVariables.Add(lArgumentInfo.Name, lArgumentInfo.Type, lArgumentInfo.Value, lArgumentInfo.ClassName);
                }
            }
            return ExecuteFilter(agent,className, filterName, lFilterVariables, linkItems, displaySet, orderCriteria, navigationalFiltering, lastOid, blockSize);
        }
コード例 #22
0
        /// <summary>
        /// Obtains the NavigationalFiltering contained in a IUContext.
        /// </summary>
        /// <param name="context">Context the NavigationalFiltering is obtained from.</param>
        /// <returns>NavigationalFiltering contained in the context.</returns>
        public static NavigationalFiltering GetNavigationalFiltering(IUContext context)
        {
            NavigationalFiltering lResult = null;

            if (HasNavigationalFiltering(context))
            {
                switch (context.ExchangeInformation.ExchangeType)
                {
                case ExchangeType.Navigation:
                {
                    ExchangeInfoNavigation lExchangeInfo = context.ExchangeInformation as ExchangeInfoNavigation;
                    lResult = new NavigationalFiltering(
                        new SelectedObjectNavigationFiltering(
                            lExchangeInfo.NavigationalFilterIdentity,
                            lExchangeInfo.SelectedOids[0]));
                }
                break;

                case ExchangeType.Action:
                {
                    ExchangeInfoAction lExchangeInfo = context.ExchangeInformation as ExchangeInfoAction;
                    if ((lExchangeInfo.SelectedOids == null) || (lExchangeInfo.SelectedOids.Count == 0) || (lExchangeInfo.SelectedOids[0] == null))
                    {
                        IUServiceContext lServiceContext = context.ExchangeInformation.Previous as IUServiceContext;


                        ArgumentsList lArguments = ArgumentsList.GetArgumentsFromContext(lServiceContext);
                        lResult = new NavigationalFiltering(
                            new ServiceIUNavigationFiltering(
                                lExchangeInfo.NavigationalFilterIdentity,
                                lArguments));
                    }
                    else
                    {
                        lResult = new NavigationalFiltering(
                            new SelectedObjectNavigationFiltering(
                                lExchangeInfo.NavigationalFilterIdentity,
                                lExchangeInfo.SelectedOids[0]));
                    }
                }
                break;

                case ExchangeType.SelectionForward:
                {
                    ExchangeInfoSelectionForward lExchangeInfo = context.ExchangeInformation as ExchangeInfoSelectionForward;
                    ArgumentsList       lArguments             = null;
                    IUServiceContext    lServiceContext        = null;
                    IUPopulationContext lPopulationContext     = null;
                    string lClassName = string.Empty;

                    // context is of IUServiceContext type.
                    if (context.ExchangeInformation.Previous.ContextType == ContextType.Service)
                    {
                        lServiceContext = context.ExchangeInformation.Previous as IUServiceContext;
                        lArguments      = ArgumentsList.GetArgumentsFromContext(lServiceContext);
                        lClassName      = lServiceContext.ClassName;
                        if (string.Compare(lClassName, "Global", true) == 0)
                        {
                            lClassName = string.Empty;
                        }

                        lResult = new NavigationalFiltering(
                            new ArgumentNavigationFiltering(
                                lClassName,
                                lServiceContext.ServiceName,
                                lServiceContext.SelectedInputField,
                                lArguments));
                    }
                    // context is of lPopulationContext type.
                    if (context.ExchangeInformation.Previous.ContextType == ContextType.Population)
                    {
                        lPopulationContext = context.ExchangeInformation.Previous as IUPopulationContext;
                        lClassName         = lPopulationContext.ClassName;
                        string lFilterName         = lExchangeInfo.ServiceName;
                        string lFilterVariableName = lExchangeInfo.ArgumentName;
                        lArguments = ArgumentsList.GetArgumentsFromContext(lPopulationContext.Filters[lFilterName]);

                        lResult = new NavigationalFiltering(
                            new FilterVariableNavigationFiltering(
                                lClassName,
                                lFilterName,
                                lFilterVariableName,
                                lArguments));
                    }
                }
                break;

                case ExchangeType.SelectionBackward:
                    break;

                default:
                    break;
                }
            }
            return(lResult);
        }