Exemple #1
0
        public void RevisionPasajeroRoleDelete(RevisionOid localOid, RevisionPasajeroOid relatedOid)
        {
            ONSqlUpdate lOnSql = new ONSqlUpdate();

            lOnSql.AddUpdate(CtesBD.TBL_REVISIONPASAJERO);
            lOnSql.AddSet(CtesBD.FLD_REVISIONPASAJERO_FK_REVISION_1, ONInt.Null);
            lOnSql.AddWhere(CtesBD.FLD_REVISIONPASAJERO_FK_REVISION_1, localOid.Id_RevisarAeronaveAttr);
            lOnSql.AddWhere(CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO, relatedOid.Id_RevisionPasajeroAttr);
            Execute(lOnSql);
        }
        /// <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));
        }
        /// <summary>
        /// Extracts the OID from the XML message and converts it in structures of the application
        /// </summary>
        /// <param name="xmlReader">XML with the request message</param>
        /// <param name="dtdVersion">Version of DTD that follows the XML message</param>
        public static RevisionPasajeroOid XML2ON(XmlReader xmlReader, double dtdVersion)
        {
            try
            {
                if (xmlReader.IsStartElement(ONXml.XMLTAG_NULL))
                {
                    xmlReader.Skip();
                    return(RevisionPasajeroXml.Null);
                }

                if (!xmlReader.IsStartElement(ONXml.XMLTAG_OID))
                {
                    throw new ONXMLStructureException(null, ONXml.XMLTAG_OID);
                }
            }
            catch (Exception e)
            {
                throw new ONXMLStructureException(e, ONXml.XMLTAG_OID);
            }

            string lClass = xmlReader.GetAttribute("Class");

            if (string.Compare(lClass, "RevisionPasajero", true) != 0)
            {
                throw new ONXMLOIDWrongClassException(null, "Clas_1348178673664478_Alias", "RevisionPasajero", lClass);
            }

            RevisionPasajeroOid lOid = new RevisionPasajeroOid();

            xmlReader.ReadStartElement(ONXml.XMLTAG_OID);

            try
            {
                lOid.Id_RevisionPasajeroAttr = ONXmlAutonumeric.XML2ON(xmlReader, dtdVersion, ONXml.XMLTAG_OIDFIELD);
            }
            catch (Exception e)
            {
                throw new ONXMLOIDFieldException(e, "Clas_1348178673664478_Alias", "RevisionPasajero", "Clas_1348178673664478Atr_1_Alias", "id_RevisionPasajero");
            }

            try
            {
                xmlReader.ReadEndElement();
            }
            catch
            {
                throw new ONXMLStructureException(null, ONXml.XMLTAG_OID);
            }

            return(lOid);
        }
Exemple #4
0
        public ONCollection RevisionPasajeroRole(RevisionPasajeroOid oid)
        {
            ONSqlSelect lOnSql = new ONSqlSelect();

            //Create select
            RevisionPasajeroData.AddPath(lOnSql, "Revision", new ONPath("Revision"), null, "");
            RetrieveInstances(lOnSql, null, new ONPath("Revision"), OnContext);

            //Fix related instance
            RevisionPasajeroData.FixInstance(lOnSql, null, null, oid);

            //Execute
            return(ExecuteQuery(lOnSql));
        }
Exemple #5
0
        internal void Delete_instanceServ(RevisionPasajeroOid p_thisRevisionPasajeroArg)
        {
            if (Instance != null)
            {
                ONFilterList onfilt = new ONFilterList();
                onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
                Instance.Find(onfilt);
            }
            // Execute service
            RevisionPasajeroAction lAction = new RevisionPasajeroAction(OnContext);

            lAction.Instance = Instance;
            lAction.Delete_instanceServ(p_thisRevisionPasajeroArg);
        }
        /// <summary>
        /// Converts an OID into XML in order to put it in XML message response
        /// </summary>
        /// <param name="xmlWriter">XML with the response message</param>
        /// <param name="oid">OID that will be insert into XML message</param>
        /// <param name="dtdVersion">Version of DTD that follows the XML message</param>
        /// <param name="xmlElement">Element in the XML message in order to convert in the right form of the XML</param>
        public static void ON2XML(XmlWriter xmlWriter, RevisionPasajeroOid oid, double dtdVersion, string xmlElement)
        {
            if (oid == null)
            {
                xmlWriter.WriteElementString(ONXml.XMLTAG_NULL, null);
            }
            else
            {
                xmlWriter.WriteStartElement(ONXml.XMLTAG_OID);
                xmlWriter.WriteAttributeString(ONXml.XMLATT_CLASS, "RevisionPasajero");
                ONXmlAutonumeric.ON2XML(xmlWriter, oid.Id_RevisionPasajeroAttr, dtdVersion, xmlElement);

                xmlWriter.WriteEndElement();                 // OID
            }
        }
        /// <summary>
        /// Method that solves the execution of 'delete_instance' service.
        /// </summary>
        /// <param name="agent">Application agent.</param>
        /// <param name="p_thisRevisionPasajeroArg">Value of the inbound argument 'p_thisRevisionPasajero'.</param>
        /// <returns>Outbound argument values.</returns>
        public static Dictionary <string, object> ExecuteService(Oid agent, List <Oid> p_thisRevisionPasajeroArg)
        {
            RevisionPasajeroOid lp_thisRevisionPasajero = null;

            if ((p_thisRevisionPasajeroArg != null) && (p_thisRevisionPasajeroArg.Count > 0) && (p_thisRevisionPasajeroArg[0] != null))
            {
                lp_thisRevisionPasajero = (p_thisRevisionPasajeroArg[0] as RevisionPasajeroOid);
            }
            Dictionary <string, object>    lValues  = GetInputFieldValues(lp_thisRevisionPasajero);
            Dictionary <string, ModelType> lTypes   = GetInboundArgumentTypes();
            Dictionary <string, string>    lDomains = GetInboundArgumentDomains();

            Dictionary <string, object> lOutboundArguments = Logic.Adaptor.ExecuteService(agent, "RevisionPasajero", "delete_instance", lTypes, lValues, lDomains);

            return(UtilFunctions.ProcessOutboundArgsList(lOutboundArguments));
        }
        public void Delete_instanceServ(RevisionPasajeroOid p_thisRevisionPasajeroArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {
                // Change to Transactional OnContext
                Instance.OnContext = lOnContext;

                // Call Executive
                RevisionPasajeroExecutive lExecutive = new RevisionPasajeroExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance  = Instance;
                lExecutive.Delete_instanceServ(p_thisRevisionPasajeroArg);

                // Change to Non-Transactional OnContext
                Instance.OnContext = OnContext;
            }
        }
        /// <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);
        }
        public override void Copy(ONInstance instance)
        {
            RevisionPasajeroInstance linstance = instance as RevisionPasajeroInstance;

            Oid = new RevisionPasajeroOid(linstance.Oid);

            RevisionRoleTemp = linstance.RevisionRoleTemp;
            if (linstance.RevisionRoleOidTemp != null)
            {
                RevisionRoleOidTemp = new RevisionOid(linstance.RevisionRoleOidTemp);
            }
            PasajeroAeronaveRoleTemp = linstance.PasajeroAeronaveRoleTemp;
            if (linstance.PasajeroAeronaveRoleOidTemp != null)
            {
                PasajeroAeronaveRoleOidTemp = new PasajeroAeronaveOid(linstance.PasajeroAeronaveRoleOidTemp);
            }
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
Exemple #11
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));
 }
Exemple #12
0
        /// <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));
        }
Exemple #13
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);
        }
Exemple #14
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);
            }
        }
Exemple #15
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));
 }
        public void Edit_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1348178673664478Ser_3_Alias", RevisionPasajeroClassText.Edit_instanceServiceAlias, "Clas_1348178673664478_Alias", RevisionPasajeroClassText.ClassAlias);

            lSInfo.AddOIDArgument("p_thisRevisionPasajero", false, "RevisionPasajero", "Clas_1348178673664478Ser_3Arg_1_Alias", RevisionPasajeroClassText.Edit_instance_P_thisRevisionPasajeroArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178673664478_Alias", RevisionPasajeroClassText.ClassAlias, "Clas_1348178673664478Ser_3_Alias", RevisionPasajeroClassText.Edit_instanceServiceAlias);
            }

            RevisionPasajeroOid lP_thisRevisionPasajeroArg = (RevisionPasajeroOid)((ONArgumentInfo)lSInfo.mArgumentList["p_thisRevisionPasajero"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();

            lOnContext.OidAgent = agentOid;

            // Execute Service
            RevisionPasajeroInstance lInstance = null;

            try
            {
                ONFilterList             lFilterList   = new ONFilterList();
                RevisionPasajeroInstance lThisInstance = new RevisionPasajeroInstance(lOnContext);
                if (lP_thisRevisionPasajeroArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new RevisionPasajeroHorizontalVisibility());
                    lThisInstance = lP_thisRevisionPasajeroArg.GetInstance(lOnContext, lFilterList);
                    if (lThisInstance == null)
                    {
                        throw new ONInstanceNotExistException(null, "Clas_1348178673664478_Alias", RevisionPasajeroClassText.ClassAlias);
                    }
                }

                using (RevisionPasajeroServer lServer = new RevisionPasajeroServer(lOnContext, lThisInstance))
                {
                    lServer.Edit_instanceServ(lP_thisRevisionPasajeroArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                {
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
                }
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement();             // Arguments
        }