/// <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) { AeronaveOid lOid = null; if (context.ExchangeInformation != null && context.ExchangeInformation.SelectedOids.Count > 0) { lOid = new AeronaveOid(context.ExchangeInformation.SelectedOids[0]); } return ExecuteQueryInstance(context.Agent, lOid, context.DisplaySetAttributes); }
/// <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 AeronaveOid lLastOid = null; if (context.LastOids.Count > 0) { lLastOid = new AeronaveOid(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; }
/// <summary> /// Gets a list with the arguments values. /// </summary> /// <param name="p_thisAeronaveArg">Value of the inbound argument 'p_thisAeronave'.</param> /// <returns>List of inbound arguments values.</returns> private static Dictionary<string, object> GetInputFieldValues(AeronaveOid p_thisAeronaveArg) { // Fill values dictionary. Dictionary<string, object> lValues = new Dictionary<string, object>(); lValues.Add("p_thisAeronave", p_thisAeronaveArg); return lValues; }
/// <summary> /// Execute a query related with a Aeronave /// </summary> /// <param name="agent">Application agent</param> /// <param name="relatedOid">Aeronave 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 ExecuteQueryRelatedAeronave(Oid agent, AeronaveOid relatedOid, string displaySet, string orderCriteria, PasajeroAeronaveOid lastOid, int blockSize, ref bool lastBlock) { Dictionary<string, Oid> lLinkItems = new Dictionary<string, Oid>(StringComparer.CurrentCultureIgnoreCase); lLinkItems.Add("Aeronave", relatedOid); return ExecuteQueryRelated(agent, lLinkItems, displaySet, orderCriteria, lastOid, blockSize, ref lastBlock); }
/// <summary> /// Gets a list with the arguments values. /// </summary> /// <param name="p_agrAeronaveArg">Value of the inbound argument 'p_agrAeronave'.</param> /// <param name="p_agrPasajeroArg">Value of the inbound argument 'p_agrPasajero'.</param> /// <param name="p_atrid_PasajeroAeronaveArg">Value of the inbound argument 'p_atrid_PasajeroAeronave'.</param> /// <param name="p_atrNombreAeronaveArg">Value of the inbound argument 'p_atrNombreAeronave'.</param> /// <param name="p_atrNombrePasajeroArg">Value of the inbound argument 'p_atrNombrePasajero'.</param> /// <returns>List of inbound arguments values.</returns> private static Dictionary<string, object> GetInputFieldValues(AeronaveOid p_agrAeronaveArg, PasajeroOid p_agrPasajeroArg, int? p_atrid_PasajeroAeronaveArg, string p_atrNombreAeronaveArg, string p_atrNombrePasajeroArg) { // Fill values dictionary. Dictionary<string, object> lValues = new Dictionary<string, object>(); lValues.Add("p_agrAeronave", p_agrAeronaveArg); lValues.Add("p_agrPasajero", p_agrPasajeroArg); lValues.Add("p_atrid_PasajeroAeronave", p_atrid_PasajeroAeronaveArg); lValues.Add("p_atrNombreAeronave", p_atrNombreAeronaveArg); lValues.Add("p_atrNombrePasajero", p_atrNombrePasajeroArg); return lValues; }
/// <summary> /// Execute a query to retrieve an instance. /// </summary> /// <param name="agent">Application agent.</param> /// <param name="oid">Specific 'AeronaveOid' 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, AeronaveOid oid, string displaySet) { return Logic.Adaptor.ExecuteQueryInstance(agent, "Aeronave", string.Empty, oid, displaySet); }
/// <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, AeronaveOid lastOid, int blockSize, ref bool lastBlock) { DataTable lDataTable = Logic.Adaptor.ExecuteQueryRelated(agent, "Aeronave", linkItems, displaySet, orderCriteria, lastOid, blockSize); // Last block. if (lDataTable.ExtendedProperties.Contains("LastBlock")) lastBlock = (bool) lDataTable.ExtendedProperties["LastBlock"]; else lastBlock = false; return lDataTable; }
/// <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; } AeronaveOid lOidInstance = new AeronaveOid(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; AeronaveOid lLastOid = null; string lOrderCriteria = string.Empty; // Get population members. if (lIUContext != null) { if (lIUContext.LastOid != null) { lLastOid = new AeronaveOid(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; } }
/// <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, AeronaveOid lastOid, int blockSize, ref bool lastBlock) { return ExecuteQueryRelated(agent, new Dictionary<string, Oid>(), displaySet, orderCriteria, lastOid, blockSize, ref lastBlock); }