public override void Copy(object oid) { AeronaveOid lOid = oid as AeronaveOid; if (lOid != null) { Id_AeronaveAttr = new ONInt(lOid.Id_AeronaveAttr); } base.Copy(oid); }
public AeronaveOid(AeronaveOid oid) : base("Aeronave") { if (oid != null) { Id_AeronaveAttr = new ONInt(oid.Id_AeronaveAttr); } else { Id_AeronaveAttr = ONInt.Null; } }
/// <summary>Default Constructor</summary> public AeronaveInstance(ONContext onContext) : base(onContext, "Aeronave", "Clas_1348178411520734_Alias") { Oid = new AeronaveOid(); NombreAttr = null; MaximoPasajerosAttr = ONInt.Null; OrigenAttr = null; DestinoAttr = null; PasajeroAeronaveRoleTemp = null; StateObjAttrTemp = null; }
internal void Delete_instanceServ(AeronaveOid p_thisAeronaveArg) { 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 = Instance; lAction.Delete_instanceServ(p_thisAeronaveArg); }
/// <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, AeronaveOid 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, "Aeronave"); ONXmlAutonumeric.ON2XML(xmlWriter, oid.Id_AeronaveAttr, 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) { AeronaveOid lOid = null; if (oid is AeronaveOid) { lOid = oid as AeronaveOid; } else if (oid is AeronaveInstance) { lOid = (oid as AeronaveInstance).Oid; } if ((object)lOid == null) { return(false); } return(lOid.Id_AeronaveAttr.Equals(Id_AeronaveAttr)); }
/// <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, AeronaveOid oid) { FixInstance(onSql, onPath, processedOnPath, oid, false); }
/// <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, AeronaveOid oid) { return AeronaveData.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 AeronaveOid XML2ON(XmlReader xmlReader, double dtdVersion) { try { if (xmlReader.IsStartElement(ONXml.XMLTAG_NULL)) { xmlReader.Skip(); return AeronaveXml.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, "Aeronave", true) != 0) throw new ONXMLOIDWrongClassException(null, "Clas_1348178411520734_Alias", "Aeronave", lClass); AeronaveOid lOid = new AeronaveOid(); xmlReader.ReadStartElement(ONXml.XMLTAG_OID); try { lOid.Id_AeronaveAttr = ONXmlAutonumeric.XML2ON(xmlReader, dtdVersion, ONXml.XMLTAG_OIDFIELD); } catch(Exception e) { throw new ONXMLOIDFieldException(e,"Clas_1348178411520734_Alias", "Aeronave", "Clas_1348178411520734Atr_1_Alias", "id_Aeronave"); } try { xmlReader.ReadEndElement(); } catch { throw new ONXMLStructureException(null, ONXml.XMLTAG_OID); } return lOid; }
/// <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 LoadTextDestino(ONContext onContext, AeronaveOid oid) { return AeronaveData.LoadTextDestino(onContext,oid); }
public void PasajeroAeronaveRoleDelete(AeronaveOid oid) { ONSqlUpdate lOnSql = new ONSqlUpdate(); lOnSql.AddUpdate(CtesBD.TBL_PASAJEROAERONAVE); lOnSql.AddSet(CtesBD.FLD_PASAJEROAERONAVE_FK_AERONAVE_1, ONInt.Null); lOnSql.AddWhere(CtesBD.FLD_PASAJEROAERONAVE_FK_AERONAVE_1, oid.Id_AeronaveAttr); 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, AeronaveOid oid, bool isLinkedTo) { if ((onPath != null) && (string.Compare(onPath.Path, "agent", true) == 0)) { if (onSql.GetParameter("agent") == null) { string lAlias = AddPath(onSql, JoinType.InnerJoin, "Aeronave", onPath, processedOnPath, "Aeronave", false, isLinkedTo); onSql.AddWhere(lAlias + "." + CtesBD.FLD_AERONAVE_ID_AERONAVE + " = ?"); onSql.AddWhereParameter("agent", oid.Id_AeronaveAttr); } } else { string lAlias = AddPath(onSql, JoinType.InnerJoin, "Aeronave", onPath, processedOnPath, "", false, isLinkedTo); onSql.AddWhere(lAlias + "." + CtesBD.FLD_AERONAVE_ID_AERONAVE + " = ?"); onSql.AddWhereParameter("", oid.Id_AeronaveAttr); } }
/// <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 LoadTextOrigen(ONContext onContext, AeronaveOid oid) { return AeronaveData.LoadTextOrigen(onContext,oid); }
public override void Copy(ONInstance instance) { AeronaveInstance linstance = instance as AeronaveInstance; Oid = new AeronaveOid(linstance.Oid); if ((object) linstance.NombreAttrTemp != null) NombreAttrTemp = new ONText(linstance.NombreAttrTemp); else NombreAttrTemp = null; MaximoPasajerosAttr = new ONInt(linstance.MaximoPasajerosAttr); if ((object) linstance.OrigenAttrTemp != null) OrigenAttrTemp = new ONText(linstance.OrigenAttrTemp); else OrigenAttrTemp = null; if ((object) linstance.DestinoAttrTemp != null) DestinoAttrTemp = new ONText(linstance.DestinoAttrTemp); else DestinoAttrTemp = 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 LoadTextOrigen(ONContext onContext, AeronaveOid oid) { ONSqlSelect lOnSql = new ONSqlSelect(); lOnSql.CreateAlias(CtesBD.TBL_AERONAVE, null, "Aeronave"); lOnSql.AddSelect(CtesBD.FLD_AERONAVE_ORIGEN); FixInstance(lOnSql, null, null, oid); // Create Data Component AeronaveData lData = new AeronaveData(onContext); // Execute query ArrayList lSqlParameters; ONText lReturn = new ONText((string) lData.ExecuteScalar(lOnSql.GenerateSQL(out lSqlParameters), lSqlParameters)); return lReturn; }
public void Delete_instanceServ(AeronaveOid p_thisAeronaveArg) { // Create new context using (ONServiceContext lOnContext = new ONServiceContext(OnContext)) { // Change to Transactional OnContext Instance.OnContext = lOnContext; // Call Executive AeronaveExecutive lExecutive = new AeronaveExecutive(); lExecutive.OnContext = lOnContext; lExecutive.Instance = Instance; lExecutive.Delete_instanceServ(p_thisAeronaveArg); // Change to Non-Transactional OnContext Instance.OnContext = OnContext; } }
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); }
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); }