/// <summary>Default Constructor</summary> public PasajeroInstance(ONContext onContext) : base(onContext, "Pasajero", "Clas_1348178542592658_Alias") { Oid = new PasajeroOid(); NombreAttr = null; PasajeroAeronaveRoleTemp = null; StateObjAttrTemp = null; }
public override void Copy(object oid) { PasajeroOid lOid = oid as PasajeroOid; if (lOid != null) { Id_PasajeroAttr = new ONInt(lOid.Id_PasajeroAttr); } base.Copy(oid); }
public PasajeroOid(PasajeroOid oid) : base("Pasajero") { if (oid != null) { Id_PasajeroAttr = new ONInt(oid.Id_PasajeroAttr); } else { Id_PasajeroAttr = ONInt.Null; } }
internal void Delete_instanceServ(PasajeroOid p_thisPasajeroArg) { if (Instance != null) { ONFilterList onfilt = new ONFilterList(); onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid)); Instance.Find(onfilt); } // Execute service PasajeroAction lAction = new PasajeroAction(OnContext); lAction.Instance = Instance; lAction.Delete_instanceServ(p_thisPasajeroArg); }
/// <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, PasajeroOid 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, "Pasajero"); ONXmlAutonumeric.ON2XML(xmlWriter, oid.Id_PasajeroAttr, dtdVersion, xmlElement); xmlWriter.WriteEndElement(); // OID } }
public PasajeroAeronaveInstance Create_instanceServ(AeronaveOid p_agrAeronaveArg, PasajeroOid p_agrPasajeroArg, ONInt p_atrid_PasajeroAeronaveArg, ONString p_atrNombreAeronaveArg, ONString p_atrNombrePasajeroArg) { // Create new context using (ONServiceContext lOnContext = new ONServiceContext(OnContext)) { // Call Executive PasajeroAeronaveExecutive lExecutive = new PasajeroAeronaveExecutive(); lExecutive.OnContext = lOnContext; lExecutive.Instance = Instance; Instance = lExecutive.Create_instanceServ(p_agrAeronaveArg, p_agrPasajeroArg, p_atrid_PasajeroAeronaveArg, p_atrNombreAeronaveArg, p_atrNombrePasajeroArg); } return Instance; }
internal PasajeroAeronaveInstance Create_instanceServ(AeronaveOid p_agrAeronaveArg, PasajeroOid p_agrPasajeroArg, ONInt p_atrid_PasajeroAeronaveArg, ONString p_atrNombreAeronaveArg, ONString p_atrNombrePasajeroArg) { 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 = new PasajeroAeronaveInstance(OnContext); Instance = lAction.Create_instanceServ(p_agrAeronaveArg, p_agrPasajeroArg, p_atrid_PasajeroAeronaveArg, p_atrNombreAeronaveArg, p_atrNombrePasajeroArg); OnContext.OperationStack.Pop(); OnContext.OperationStack.Push(Instance); return Instance; }
public override bool Equals(object oid) { PasajeroOid lOid = null; if (oid is PasajeroOid) { lOid = oid as PasajeroOid; } else if (oid is PasajeroInstance) { lOid = (oid as PasajeroInstance).Oid; } if ((object)lOid == null) { return(false); } return(lOid.Id_PasajeroAttr.Equals(Id_PasajeroAttr)); }
public override void Copy(ONInstance instance) { PasajeroInstance linstance = instance as PasajeroInstance; Oid = new PasajeroOid(linstance.Oid); if ((object) linstance.NombreAttrTemp != null) NombreAttrTemp = new ONText(linstance.NombreAttrTemp); else NombreAttrTemp = null; PasajeroAeronaveRoleTemp = linstance.PasajeroAeronaveRoleTemp; StateObj = new ONString(linstance.StateObj); base.Copy(instance); }
/// <summary>Load the data retrieved from the Data Base to components of the application</summary> /// <param name="onContext">This parameter has the current context</param> /// <param name="oid">OID of the instance whose text attribute value is wanted to be loaded</param> public static ONText LoadTextNombre(ONContext onContext, PasajeroOid oid) { return PasajeroData.LoadTextNombre(onContext,oid); }
/// <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 PasajeroOid XML2ON(XmlReader xmlReader, double dtdVersion) { try { if (xmlReader.IsStartElement(ONXml.XMLTAG_NULL)) { xmlReader.Skip(); return PasajeroXml.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, "Pasajero", true) != 0) throw new ONXMLOIDWrongClassException(null, "Clas_1348178542592658_Alias", "Pasajero", lClass); PasajeroOid lOid = new PasajeroOid(); xmlReader.ReadStartElement(ONXml.XMLTAG_OID); try { lOid.Id_PasajeroAttr = ONXmlAutonumeric.XML2ON(xmlReader, dtdVersion, ONXml.XMLTAG_OIDFIELD); } catch(Exception e) { throw new ONXMLOIDFieldException(e,"Clas_1348178542592658_Alias", "Pasajero", "Clas_1348178542592658Atr_1_Alias", "id_Pasajero"); } try { xmlReader.ReadEndElement(); } catch { throw new ONXMLStructureException(null, ONXml.XMLTAG_OID); } return lOid; }
/// <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, PasajeroOid oid) { FixInstance(onSql, onPath, processedOnPath, oid, false); }
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); }
public void Delete_instanceServ(PasajeroOid p_thisPasajeroArg) { // Create new context using (ONServiceContext lOnContext = new ONServiceContext(OnContext)) { // Change to Transactional OnContext Instance.OnContext = lOnContext; // Call Executive PasajeroExecutive lExecutive = new PasajeroExecutive(); lExecutive.OnContext = lOnContext; lExecutive.Instance = Instance; lExecutive.Delete_instanceServ(p_thisPasajeroArg); // Change to Non-Transactional OnContext Instance.OnContext = OnContext; } }
public void PasajeroAeronaveRoleInsert(PasajeroOid localOid, PasajeroAeronaveOid relatedOid) { ONSqlUpdate lOnSql = new ONSqlUpdate(); lOnSql.AddUpdate(CtesBD.TBL_PASAJEROAERONAVE); lOnSql.AddSet(CtesBD.FLD_PASAJEROAERONAVE_FK_PASAJERO_1, localOid.Id_PasajeroAttr); lOnSql.AddWhere(CtesBD.FLD_PASAJEROAERONAVE_ID_PASAJEROAERONAVE, relatedOid.Id_PasajeroAeronaveAttr); Execute(lOnSql); }
public void PasajeroAeronaveRoleDelete(PasajeroOid oid) { ONSqlUpdate lOnSql = new ONSqlUpdate(); lOnSql.AddUpdate(CtesBD.TBL_PASAJEROAERONAVE); lOnSql.AddSet(CtesBD.FLD_PASAJEROAERONAVE_FK_PASAJERO_1, ONInt.Null); lOnSql.AddWhere(CtesBD.FLD_PASAJEROAERONAVE_FK_PASAJERO_1, oid.Id_PasajeroAttr); Execute(lOnSql); }
/// <summary>Load the data retrieved from the Data Base to components of the application</summary> /// <param name="onContext">This parameter has the current context</param> /// <param name="oid">OID of the instance whose text attribute value is wanted to be loaded</param> public static ONText LoadTextNombre(ONContext onContext, PasajeroOid oid) { ONSqlSelect lOnSql = new ONSqlSelect(); lOnSql.CreateAlias(CtesBD.TBL_PASAJERO, null, "Pasajero"); lOnSql.AddSelect(CtesBD.FLD_PASAJERO_NOMBRE); FixInstance(lOnSql, null, null, oid); // Create Data Component PasajeroData lData = new PasajeroData(onContext); // Execute query ArrayList lSqlParameters; ONText lReturn = new ONText((string) lData.ExecuteScalar(lOnSql.GenerateSQL(out lSqlParameters), lSqlParameters)); return lReturn; }
/// <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, PasajeroOid oid, bool isLinkedTo) { if ((onPath != null) && (string.Compare(onPath.Path, "agent", true) == 0)) { if (onSql.GetParameter("agent") == null) { string lAlias = AddPath(onSql, JoinType.InnerJoin, "Pasajero", onPath, processedOnPath, "Pasajero", false, isLinkedTo); onSql.AddWhere(lAlias + "." + CtesBD.FLD_PASAJERO_ID_PASAJERO + " = ?"); onSql.AddWhereParameter("agent", oid.Id_PasajeroAttr); } } else { string lAlias = AddPath(onSql, JoinType.InnerJoin, "Pasajero", onPath, processedOnPath, "", false, isLinkedTo); onSql.AddWhere(lAlias + "." + CtesBD.FLD_PASAJERO_ID_PASAJERO + " = ?"); onSql.AddWhereParameter("", oid.Id_PasajeroAttr); } }