/// <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) { PasajeroAeronaveOid lOid = null; if (context.ExchangeInformation != null && context.ExchangeInformation.SelectedOids.Count > 0) { lOid = new PasajeroAeronaveOid(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 PasajeroAeronaveOid lLastOid = null; if (context.LastOids.Count > 0) { lLastOid = new PasajeroAeronaveOid(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> /// Execute a query related with a PasajeroAeronave /// </summary> /// <param name="agent">Application agent</param> /// <param name="relatedOid">PasajeroAeronave 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 ExecuteQueryRelatedPasajeroAeronave(Oid agent, PasajeroAeronaveOid relatedOid, string displaySet, string orderCriteria, RevisionPasajeroOid lastOid, int blockSize, ref bool lastBlock) { Dictionary<string, Oid> lLinkItems = new Dictionary<string, Oid>(StringComparer.CurrentCultureIgnoreCase); lLinkItems.Add("PasajeroAeronave", relatedOid); return ExecuteQueryRelated(agent, lLinkItems, displaySet, orderCriteria, lastOid, blockSize, ref lastBlock); }
/// <summary> /// Gets a list with the arguments values. /// </summary> /// <param name="p_agrPasajeroAeronaveArg">Value of the inbound argument 'p_agrPasajeroAeronave'.</param> /// <param name="p_atrid_AeronaveArg">Value of the inbound argument 'p_atrid_Aeronave'.</param> /// <param name="p_atrNombreArg">Value of the inbound argument 'p_atrNombre'.</param> /// <param name="p_atrMaximoPasajerosArg">Value of the inbound argument 'p_atrMaximoPasajeros'.</param> /// <param name="p_atrOrigenArg">Value of the inbound argument 'p_atrOrigen'.</param> /// <param name="p_atrDestinoArg">Value of the inbound argument 'p_atrDestino'.</param> /// <returns>List of inbound arguments values.</returns> private static Dictionary<string, object> GetInputFieldValues(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, int? p_atrid_AeronaveArg, string p_atrNombreArg, int? p_atrMaximoPasajerosArg, string p_atrOrigenArg, string p_atrDestinoArg) { // Fill values dictionary. Dictionary<string, object> lValues = new Dictionary<string, object>(); lValues.Add("p_agrPasajeroAeronave", p_agrPasajeroAeronaveArg); lValues.Add("p_atrid_Aeronave", p_atrid_AeronaveArg); lValues.Add("p_atrNombre", p_atrNombreArg); lValues.Add("p_atrMaximoPasajeros", p_atrMaximoPasajerosArg); lValues.Add("p_atrOrigen", p_atrOrigenArg); lValues.Add("p_atrDestino", p_atrDestinoArg); return lValues; }
/// <summary> /// Execute a query to retrieve an instance. /// </summary> /// <param name="agent">Application agent.</param> /// <param name="oid">Specific 'PasajeroAeronaveOid' 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, PasajeroAeronaveOid oid, string displaySet) { return Logic.Adaptor.ExecuteQueryInstance(agent, "PasajeroAeronave", 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, PasajeroAeronaveOid lastOid, int blockSize, ref bool lastBlock) { DataTable lDataTable = Logic.Adaptor.ExecuteQueryRelated(agent, "PasajeroAeronave", 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; } PasajeroAeronaveOid lOidInstance = new PasajeroAeronaveOid(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; PasajeroAeronaveOid lLastOid = null; string lOrderCriteria = string.Empty; // Get population members. if (lIUContext != null) { if (lIUContext.LastOid != null) { lLastOid = new PasajeroAeronaveOid(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, PasajeroAeronaveOid 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_thisPasajeroAeronaveArg">Value of the inbound argument 'p_thisPasajeroAeronave'.</param> /// <returns>List of inbound arguments values.</returns> private static Dictionary<string, object> GetInputFieldValues(PasajeroAeronaveOid p_thisPasajeroAeronaveArg) { // Fill values dictionary. Dictionary<string, object> lValues = new Dictionary<string, object>(); lValues.Add("p_thisPasajeroAeronave", p_thisPasajeroAeronaveArg); return lValues; }
/// <summary> /// Gets a list with the arguments values. /// </summary> /// <param name="p_agrPasajeroAeronaveArg">Value of the inbound argument 'p_agrPasajeroAeronave'.</param> /// <param name="p_agrRevisionArg">Value of the inbound argument 'p_agrRevision'.</param> /// <param name="p_atrid_RevisionPasajeroArg">Value of the inbound argument 'p_atrid_RevisionPasajero'.</param> /// <returns>List of inbound arguments values.</returns> private static Dictionary<string, object> GetInputFieldValues(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, RevisionOid p_agrRevisionArg, int? p_atrid_RevisionPasajeroArg) { // Fill values dictionary. Dictionary<string, object> lValues = new Dictionary<string, object>(); lValues.Add("p_agrPasajeroAeronave", p_agrPasajeroAeronaveArg); lValues.Add("p_agrRevision", p_agrRevisionArg); lValues.Add("p_atrid_RevisionPasajero", p_atrid_RevisionPasajeroArg); return lValues; }