/// <summary>
        /// Initializes a new instance of ArgumentNavigationFiltering.
        /// </summary>
        /// <param name="className">Class that initiates the navigation.</param>
        /// <param name="serviceName">Service invoked in the navigation.</param>
        /// <param name="argumentName">Indicates the filter argument group.</param>
        /// <param name="arguments">Argument list.</param>
        public ArgumentNavigationFiltering(
			string className,
			string serviceName,
			string argumentName,
			ArgumentsList arguments)
            : base(className, serviceName, argumentName, arguments)
        {
        }
        /// <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);
        }
        /// <summary>
        /// Initializes a new instance of ArgumentNavigationFiltering.
        /// </summary>
        /// <param name="className">Class that initiates the navigation.</param>
        /// <param name="serviceName">Service invoked in the navigation.</param>
        /// <param name="argumentName">Indicates the filter argument group.</param>
        /// <param name="arguments">Argument list.</param>
        public FilterVariableNavigationFiltering(
			string className,
			string filterName,
			string argumentName,
			ArgumentsList arguments)
            : base(className, filterName, argumentName, arguments)
        {
        }
 public ServiceIUNavigationFiltering(string navigationalFilterID, ArgumentsList arguments)
 {
     NavigationalFilterID = navigationalFilterID;
     Arguments = arguments;
 }
        public NavigationFilteringDataColumns(
			string className,
			string interactionUnitName,
			string argumentName,
			ArgumentsList arguments)
        {
            ClassName = className;
            InteractionUnitName = interactionUnitName;
            ArgumentName = argumentName;
            Arguments = arguments;
        }
        /// <summary>
        /// Obtains the ArgumentsList contained in a IUServiceContext.
        /// </summary>
        /// <param name="arguments">Context Arguments.</param>
        /// <param name="argumentTypes">Arguments Types.</param>
        /// <returns>ArgumentsList contained in the context.</returns>
        private static ArgumentsList GetArgumentListFromArgumentInfoContext(
			Dictionary<string, IUContextArgumentInfo> arguments,
			Dictionary<string, ModelType> argumentTypes)
        {
            ArgumentsList lResult = null;
            if ((arguments != null) && (argumentTypes != null))
            {
                lResult = new ArgumentsList();
                foreach (KeyValuePair<string, ModelType> largumentType in argumentTypes)
                {
                    IUContextArgumentInfo argumentInfo = arguments[largumentType.Key];

                    if (argumentInfo != null)
                    {
                        if (largumentType.Value == ModelType.Oid)
                        {
                            List<Oid> lOids = argumentInfo.Value as List<Oid>;
                            if (lOids != null && lOids.Count == 1)
                            {
                                lResult.Add(largumentType.Key, largumentType.Value, lOids[0], lOids[0].ClassName);
                            }
                        }
                        else
                        {
                            if (argumentInfo.Value != null)
                            {
                                lResult.Add(largumentType.Key, largumentType.Value, argumentInfo.Value, string.Empty);
                            }
                        }
                    }
                }
            }
            return lResult;
        }
Beispiel #7
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);
        }
Beispiel #8
0
 public ServiceIUNavigationFiltering(string navigationalFilterID, ArgumentsList arguments)
 {
     NavigationalFilterID = navigationalFilterID;
     Arguments            = arguments;
 }