Example #1
0
 /// <summary>
 /// Execute a query to retrieve an instance.
 /// </summary>
 /// <param name="context">Current context.</param>
 /// <returns>A DataTable with the instance searched.</returns>
 public static DataTable ExecuteQueryInstance(IUQueryContext context)
 {
     RevisionPasajeroOid lOid = null;
     if (context.ExchangeInformation != null && context.ExchangeInformation.SelectedOids.Count > 0)
     {
         lOid = new RevisionPasajeroOid(context.ExchangeInformation.SelectedOids[0]);
     }
     return ExecuteQueryInstance(context.Agent, lOid, context.DisplaySetAttributes);
 }
Example #2
0
        /// <summary>
        /// Execute a query to retrieve a set of instances, without any condition.
        /// </summary>
        /// <param name="context">Current context.</param>
        /// <returns>A DataTable with the instances searched.</returns>
        public static DataTable ExecuteQueryPopulation(IUPopulationContext context)
        {
            // Last Oid
            RevisionPasajeroOid lLastOid = null;
            if (context.LastOids.Count > 0)
            {
                lLastOid = new RevisionPasajeroOid(context.LastOids.Peek());
            }

            // Last Block
            bool lLastBlock = true;
            NavigationalFiltering navigationalFiltering = NavigationalFiltering.GetNavigationalFiltering(context);
            DataTable lDataTable = ExecuteQueryRelated(context.Agent, new Dictionary<string, Oid>(), context.DisplaySetAttributes, context.OrderCriteriaNameSelected, navigationalFiltering, lLastOid, context.BlockSize, ref lLastBlock);
            context.LastBlock = lLastBlock;

            return lDataTable;
        }
Example #3
0
 /// <summary>
 /// Execute a query to retrieve an instance.
 /// </summary>
 /// <param name="agent">Application agent.</param>
 /// <param name="oid">Specific 'RevisionPasajeroOid' Oid of the instance to be searched.</param>
 /// <param name="displaySet">Display set that will be retrieved.</param>
 /// <returns>A DataTable with the instance searched.</returns>
 public static DataTable ExecuteQueryInstance(Oid agent, RevisionPasajeroOid oid, string displaySet)
 {
     return Logic.Adaptor.ExecuteQueryInstance(agent, "RevisionPasajero", string.Empty, oid, displaySet);
 }
Example #4
0
        /// <summary>
        /// Execute a query related with a Revision
        /// </summary>
        /// <param name="agent">Application agent</param>
        /// <param name="relatedOid">Revision oid related</param>
        /// <param name="displaySet">List of attributes to return</param> 
        /// <param name="orderCriteria">Order criteria name</param>
        /// <param name="lastOid">Oid from whitch to search (not included)</param>
        /// <param name="blockSize">Number of instances to return (0 for all population)</param>
        /// <param name="lastBlock">Returns if it is last block</param>
        /// <returns>Query data</returns>
        public static DataTable ExecuteQueryRelatedRevision(Oid agent, RevisionOid relatedOid, string displaySet, string orderCriteria, RevisionPasajeroOid lastOid, int blockSize, ref bool lastBlock)
        {
            Dictionary<string, Oid> lLinkItems = new Dictionary<string, Oid>(StringComparer.CurrentCultureIgnoreCase);
            lLinkItems.Add("Revision", relatedOid);

            return ExecuteQueryRelated(agent, lLinkItems, displaySet, orderCriteria, lastOid, blockSize, ref lastBlock);
        }
Example #5
0
        /// <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">Return 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, RevisionPasajeroOid lastOid, int blockSize, ref bool lastBlock)
        {
            DataTable lDataTable = Logic.Adaptor.ExecuteQueryRelated(agent, "RevisionPasajero", linkItems, displaySet, orderCriteria, lastOid, blockSize);

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

            return lDataTable;
        }
Example #6
0
        /// <summary>
        /// Execute a query related with other instance.
        /// </summary>
        /// <param name="context">Current context.</param>
        /// <returns>A DataTable with the instances searched.</returns>
        public static DataTable ExecuteQueryRelated(IUQueryContext context)
        {
            try
            {
                ExchangeInfo lExchangeInfo = context.ExchangeInformation;

                if (lExchangeInfo.ExchangeType != ExchangeType.Navigation || lExchangeInfo.SelectedOids.Count == 0)
                {
                    return null;
                }

                IUPopulationContext lIUContext = context as IUPopulationContext;
                int blockSize=1;
                if (lIUContext != null)
                {
                    blockSize = lIUContext.BlockSize;
                }
                ExchangeInfoNavigation lNavInfo = lExchangeInfo as ExchangeInfoNavigation;
                // Specific case. No role name indicates Query by Instance.
                if (lNavInfo.RolePath == "")
                {
                    if (lIUContext != null)
                    {
                        lIUContext.LastBlock = true;
                    }

                    RevisionPasajeroOid lOidInstance = new RevisionPasajeroOid(lNavInfo.SelectedOids[0]);
                    return ExecuteQueryInstance(context.Agent, lOidInstance, context.DisplaySetAttributes);
                }

                // Get link items.
                Oid lOid = lNavInfo.SelectedOids[0];
                Dictionary<string, Oid> lLinkItems = new Dictionary<string, Oid>(StringComparer.CurrentCultureIgnoreCase);
                lLinkItems.Add(lNavInfo.RolePath, lOid);

                bool lLastBlock = true;
                RevisionPasajeroOid lLastOid = null;
                string lOrderCriteria = string.Empty;

                // Get population members.
                if (lIUContext != null)
                {
                    if (lIUContext.LastOid != null)
                    {
                        lLastOid = new RevisionPasajeroOid(lIUContext.LastOid);
                    }
                    lOrderCriteria = lIUContext.OrderCriteriaNameSelected;
                }
                NavigationalFiltering navigationalFiltering = NavigationalFiltering.GetNavigationalFiltering(context);
                DataTable lDataTable = ExecuteQueryRelated(context.Agent, lLinkItems, context.DisplaySetAttributes, lOrderCriteria, navigationalFiltering, lLastOid, blockSize, ref lLastBlock);

                if (lIUContext != null)
                {
                    lIUContext.LastBlock = lLastBlock;
                }

                return lDataTable;
            }
            catch (Exception e)
            {
                ScenarioManager.LaunchErrorScenario(e);
                return null;
            }
        }
Example #7
0
 /// <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, RevisionPasajeroOid lastOid, int blockSize, ref bool lastBlock)
 {
     return ExecuteQueryRelated(agent, new Dictionary<string, Oid>(), displaySet, orderCriteria, lastOid, blockSize, ref lastBlock);
 }
        /// <summary>
        /// Gets a list with the arguments values.
        /// </summary>
        /// <param name="p_thisRevisionPasajeroArg">Value of the inbound argument 'p_thisRevisionPasajero'.</param>
        /// <returns>List of inbound arguments values.</returns>
        private static Dictionary<string, object> GetInputFieldValues(RevisionPasajeroOid p_thisRevisionPasajeroArg)
        {
            // Fill values dictionary.
            Dictionary<string, object> lValues = new Dictionary<string, object>();
            lValues.Add("p_thisRevisionPasajero", p_thisRevisionPasajeroArg);

            return lValues;
        }