public PasajeroAeronaveOid(PasajeroAeronaveOid oid)
     : base("PasajeroAeronave")
 {
     if (oid != null)
     {
         Id_PasajeroAeronaveAttr = new ONInt(oid.Id_PasajeroAeronaveAttr);
     }
     else
     {
         Id_PasajeroAeronaveAttr = ONInt.Null;
     }
 }
 internal void Delete_instanceServ(PasajeroAeronaveOid p_thisPasajeroAeronaveArg)
 {
     if (Instance != null)
     {
         ONFilterList onfilt = new ONFilterList();
         onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
         Instance.Find(onfilt);
     }
     // Execute service
     PasajeroAeronaveAction lAction = new PasajeroAeronaveAction(OnContext);
     lAction.Instance = Instance;
     lAction.Delete_instanceServ(p_thisPasajeroAeronaveArg);
 }
 /// <summary>Default Constructor</summary>
 public PasajeroAeronaveInstance(ONContext onContext)
     : base(onContext, "PasajeroAeronave", "Clas_1348178542592177_Alias")
 {
     Oid = new PasajeroAeronaveOid();
     NombreAeronaveAttr = ONString.Null;
     NombrePasajeroAttr = ONString.Null;
     RevisionPasajeroRoleTemp = null;
     AeronaveRoleTemp = null;
     AeronaveRoleOidTemp = null;
     PasajeroRoleTemp = null;
     PasajeroRoleOidTemp = null;
     StateObjAttrTemp = 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, PasajeroAeronaveOid 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, "PasajeroAeronave");
                ONXmlAutonumeric.ON2XML(xmlWriter, oid.Id_PasajeroAeronaveAttr, dtdVersion, xmlElement);

                xmlWriter.WriteEndElement(); // OID
            }
        }
        public RevisionPasajeroInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, RevisionOid p_agrRevisionArg, ONInt p_atrid_RevisionPasajeroArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                RevisionPasajeroExecutive lExecutive = new RevisionPasajeroExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_agrPasajeroAeronaveArg, p_agrRevisionArg, p_atrid_RevisionPasajeroArg);

            }

            return Instance;
        }
Пример #6
0
        public AeronaveInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, ONInt p_atrid_AeronaveArg, ONText p_atrNombreArg, ONInt p_atrMaximoPasajerosArg, ONText p_atrOrigenArg, ONText p_atrDestinoArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                AeronaveExecutive lExecutive = new AeronaveExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_agrPasajeroAeronaveArg, p_atrid_AeronaveArg, p_atrNombreArg, p_atrMaximoPasajerosArg, p_atrOrigenArg, p_atrDestinoArg);

            }

            return Instance;
        }
        internal RevisionPasajeroInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, RevisionOid p_agrRevisionArg, ONInt p_atrid_RevisionPasajeroArg)
        {
            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 = new RevisionPasajeroInstance(OnContext);
            Instance = lAction.Create_instanceServ(p_agrPasajeroAeronaveArg, p_agrRevisionArg, p_atrid_RevisionPasajeroArg);

            OnContext.OperationStack.Pop();
            OnContext.OperationStack.Push(Instance);

            return Instance;
        }
Пример #8
0
        internal AeronaveInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, ONInt p_atrid_AeronaveArg, ONText p_atrNombreArg, ONInt p_atrMaximoPasajerosArg, ONText p_atrOrigenArg, ONText p_atrDestinoArg)
        {
            if (Instance != null)
            {
                ONFilterList onfilt = new ONFilterList();
                onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
                Instance.Find(onfilt);
            }
            // Execute service
            AeronaveAction lAction = new AeronaveAction(OnContext);
            lAction.Instance = new AeronaveInstance(OnContext);
            Instance = lAction.Create_instanceServ(p_agrPasajeroAeronaveArg, p_atrid_AeronaveArg, p_atrNombreArg, p_atrMaximoPasajerosArg, p_atrOrigenArg, p_atrDestinoArg);

            OnContext.OperationStack.Pop();
            OnContext.OperationStack.Push(Instance);

            return Instance;
        }
Пример #9
0
        public override bool Equals(object oid)
        {
            PasajeroAeronaveOid lOid = null;

            if (oid is PasajeroAeronaveOid)
            {
                lOid = oid as PasajeroAeronaveOid;
            }
            else if (oid is PasajeroAeronaveInstance)
            {
                lOid = (oid as PasajeroAeronaveInstance).Oid;
            }

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

            return(lOid.Id_PasajeroAeronaveAttr.Equals(Id_PasajeroAeronaveAttr));
        }
Пример #10
0
 public void PasajeroAeronaveRoleInsert(AeronaveOid localOid, PasajeroAeronaveOid relatedOid)
 {
     ONSqlUpdate lOnSql = new ONSqlUpdate();
     lOnSql.AddUpdate(CtesBD.TBL_PASAJEROAERONAVE);
     lOnSql.AddSet(CtesBD.FLD_PASAJEROAERONAVE_FK_AERONAVE_1, localOid.Id_AeronaveAttr);
     lOnSql.AddWhere(CtesBD.FLD_PASAJEROAERONAVE_ID_PASAJEROAERONAVE, relatedOid.Id_PasajeroAeronaveAttr);
     Execute(lOnSql);
 }
Пример #11
0
        public ONCollection PasajeroAeronaveRole(PasajeroAeronaveOid oid)
        {
            ONSqlSelect lOnSql = new ONSqlSelect();

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

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

            //Execute
            return ExecuteQuery(lOnSql);
        }
        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 Delete_instanceServ(PasajeroAeronaveOid p_thisPasajeroAeronaveArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {
                // Change to Transactional OnContext
                Instance.OnContext = lOnContext;

                // Call Executive
                PasajeroAeronaveExecutive lExecutive = new PasajeroAeronaveExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                lExecutive.Delete_instanceServ(p_thisPasajeroAeronaveArg);

                // Change to Non-Transactional OnContext
                Instance.OnContext = OnContext;
            }
        }
Пример #14
0
        /// <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 PasajeroAeronaveOid XML2ON(XmlReader xmlReader, double dtdVersion)
        {
            try
            {
                if (xmlReader.IsStartElement(ONXml.XMLTAG_NULL))
                {
                    xmlReader.Skip();
                    return PasajeroAeronaveXml.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, "PasajeroAeronave", true) != 0)
                throw new ONXMLOIDWrongClassException(null, "Clas_1348178542592177_Alias", "PasajeroAeronave", lClass);

            PasajeroAeronaveOid lOid = new PasajeroAeronaveOid();
            xmlReader.ReadStartElement(ONXml.XMLTAG_OID);

            try
            {
                lOid.Id_PasajeroAeronaveAttr = ONXmlAutonumeric.XML2ON(xmlReader, dtdVersion, ONXml.XMLTAG_OIDFIELD);
            }
            catch(Exception e)
            {
                throw new ONXMLOIDFieldException(e,"Clas_1348178542592177_Alias", "PasajeroAeronave", "Clas_1348178542592177Atr_1_Alias", "id_PasajeroAeronave");
            }

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

            return lOid;
        }
 public void PasajeroAeronaveRoleInsert(RevisionPasajeroOid localOid, PasajeroAeronaveOid relatedOid)
 {
     ONSqlUpdate lOnSql = new ONSqlUpdate();
     lOnSql.AddUpdate(CtesBD.TBL_REVISIONPASAJERO);
     lOnSql.AddSet(CtesBD.FLD_REVISIONPASAJERO_FK_PASAJEROAERO_1, relatedOid.Id_PasajeroAeronaveAttr);
     lOnSql.AddWhere(CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO, localOid.Id_RevisionPasajeroAttr);
     Execute(lOnSql);
 }
        public override void Copy(ONInstance instance)
        {
            PasajeroAeronaveInstance linstance = instance as PasajeroAeronaveInstance;

            Oid = new PasajeroAeronaveOid(linstance.Oid);

            NombreAeronaveAttr = new ONString(linstance.NombreAeronaveAttr);
            NombrePasajeroAttr = new ONString(linstance.NombrePasajeroAttr);
            RevisionPasajeroRoleTemp = linstance.RevisionPasajeroRoleTemp;
            AeronaveRoleTemp = linstance.AeronaveRoleTemp;
            if (linstance.AeronaveRoleOidTemp != null)
                AeronaveRoleOidTemp = new AeronaveOid(linstance.AeronaveRoleOidTemp);
            PasajeroRoleTemp = linstance.PasajeroRoleTemp;
            if (linstance.PasajeroRoleOidTemp != null)
                PasajeroRoleOidTemp = new PasajeroOid(linstance.PasajeroRoleOidTemp);
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }