/// <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>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); } }