Esempio n. 1
0
        public override void Copy(object oid)
        {
            RevisionPasajeroOid lOid = oid as RevisionPasajeroOid;

            if (lOid != null)
            {
                Id_RevisionPasajeroAttr = new ONInt(lOid.Id_RevisionPasajeroAttr);
            }
            base.Copy(oid);
        }
 /// <summary>Default Constructor</summary>
 public RevisionPasajeroInstance(ONContext onContext)
     : base(onContext, "RevisionPasajero", "Clas_1348178673664478_Alias")
 {
     Oid = new RevisionPasajeroOid();
     RevisionRoleTemp = null;
     RevisionRoleOidTemp = null;
     PasajeroAeronaveRoleTemp = null;
     PasajeroAeronaveRoleOidTemp = null;
     StateObjAttrTemp = null;
 }
Esempio n. 3
0
 public RevisionPasajeroOid(RevisionPasajeroOid oid) : base("RevisionPasajero")
 {
     if (oid != null)
     {
         Id_RevisionPasajeroAttr = new ONInt(oid.Id_RevisionPasajeroAttr);
     }
     else
     {
         Id_RevisionPasajeroAttr = ONInt.Null;
     }
 }
 public RevisionPasajeroOid(RevisionPasajeroOid oid)
     : base("RevisionPasajero")
 {
     if (oid != null)
     {
         Id_RevisionPasajeroAttr = new ONInt(oid.Id_RevisionPasajeroAttr);
     }
     else
     {
         Id_RevisionPasajeroAttr = ONInt.Null;
     }
 }
        /// <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
            }
        }
 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);
 }
Esempio n. 7
0
        public override bool Equals(object oid)
        {
            RevisionPasajeroOid lOid = null;

            if (oid is RevisionPasajeroOid)
            {
                lOid = oid as RevisionPasajeroOid;
            }
            else if (oid is RevisionPasajeroInstance)
            {
                lOid = (oid as RevisionPasajeroInstance).Oid;
            }

            if ((object)lOid == null)
            {
                return(false);
            }

            return(lOid.Id_RevisionPasajeroAttr.Equals(Id_RevisionPasajeroAttr));
        }
        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>
        /// 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;
        }
        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);
        }
 public void RevisionRoleInsert(RevisionPasajeroOid localOid, RevisionOid relatedOid)
 {
     ONSqlUpdate lOnSql = new ONSqlUpdate();
     lOnSql.AddUpdate(CtesBD.TBL_REVISIONPASAJERO);
     lOnSql.AddSet(CtesBD.FLD_REVISIONPASAJERO_FK_REVISION_1, relatedOid.Id_RevisarAeronaveAttr);
     lOnSql.AddWhere(CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO, localOid.Id_RevisionPasajeroAttr);
     Execute(lOnSql);
 }
        public void RevisionRoleDelete(RevisionPasajeroOid oid)
        {
            ONSqlUpdate lOnSql = new ONSqlUpdate();
            lOnSql.AddUpdate(CtesBD.TBL_REVISIONPASAJERO);
            lOnSql.AddSet(CtesBD.FLD_REVISIONPASAJERO_FK_REVISION_1, ONInt.Null);
            lOnSql.AddWhere(CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO, oid.Id_RevisionPasajeroAttr);

            Execute(lOnSql);
        }
 public void PasajeroAeronaveRoleDelete(RevisionPasajeroOid localOid, PasajeroAeronaveOid relatedOid)
 {
     ONSqlUpdate lOnSql = new ONSqlUpdate();
     lOnSql.AddUpdate(CtesBD.TBL_REVISIONPASAJERO);
     lOnSql.AddSet(CtesBD.FLD_REVISIONPASAJERO_FK_PASAJEROAERO_1, ONInt.Null);
     lOnSql.AddWhere(CtesBD.FLD_REVISIONPASAJERO_FK_PASAJEROAERO_1, relatedOid.Id_PasajeroAeronaveAttr);
     lOnSql.AddWhere(CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO, localOid.Id_RevisionPasajeroAttr);
     Execute(lOnSql);
 }
 /// <summary>This method adds to the SQL statement the part that fixes the instance</summary>
 /// <param name="onSql">This parameter has the current SQL statement</param>
 /// <param name="onPath">Path to add to SQL statement</param>
 /// <param name="processedOnPath">Path pocessed until the call of this method</param>
 /// <param name="oid">OID to fix the instance in the SQL statement</param>
 /// <param name="isLinkedTo">The alias belongs to a role in a linked To element</param>
 public static void FixInstance(ONSqlSelect onSql, ONPath onPath, ONPath processedOnPath, RevisionPasajeroOid oid, bool isLinkedTo)
 {
     if ((onPath != null) && (string.Compare(onPath.Path, "agent", true) == 0))
     {
         if (onSql.GetParameter("agent") == null)
         {
             string lAlias = AddPath(onSql, JoinType.InnerJoin, "RevisionPasajero", onPath, processedOnPath, "RevisionPasajero", false, isLinkedTo);
             onSql.AddWhere(lAlias + "." + CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO + " = ?");
             onSql.AddWhereParameter("agent", oid.Id_RevisionPasajeroAttr);
         }
     }
     else
     {
         string lAlias = AddPath(onSql, JoinType.InnerJoin, "RevisionPasajero", onPath, processedOnPath, "", false, isLinkedTo);
         onSql.AddWhere(lAlias + "." + CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO + " = ?");
         onSql.AddWhereParameter("", oid.Id_RevisionPasajeroAttr);
     }
 }
 /// <summary>This method adds to the SQL statement the part that fixes the instance</summary>
 /// <param name="onSql">This parameter has the current SQL statement</param>
 /// <param name="onPath">Path to add to SQL statement</param>
 /// <param name="processedOnPath">Path pocessed until the call of this method</param>
 /// <param name="oid">OID to fix the instance in the SQL statement</param>
 public static void FixInstance(ONSqlSelect onSql, ONPath onPath, ONPath processedOnPath, RevisionPasajeroOid oid)
 {
     FixInstance(onSql, onPath, processedOnPath, oid, false);
 }
Esempio n. 16
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);
        }