<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2011.1.2 (Build 701U)" ts="2011-12-06 08:29:16">
<Class name="DBProduktQS.AF.FehlerNotizAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61550,37597.120854</TimeCreated>

<Query name="ListeByReport">
<Type>%SQLQuery</Type>
<FormalSpec>ReportOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, Erfassungsdatum, NotizText, Erfasser->Name || ' ' || Erfasser->Vorname as Erfasser
	FROM DBProduktQS.FehlerNotiz WHERE FehlerReport = :ReportOid ORDER BY Erfassungsdatum desc]]></SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.FehlerReportAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61550,60283.125282</TimeCreated>

<Query name="ListeBySubPorgramm">
<Type>%SQLQuery</Type>
<FormalSpec>SpOid:%String,MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	Select ID, Erfassungsdatum, ProgVersion, Status, Erledigtdatum, GeprueftVisum,
	DBProduktQS_SD.BearbStatus_GetBezeichnungClass(Status, :MandantOid, :Lang) As StatusBezeichnung, 
	ProblemKurzBeschrieb, Kunde->Name || ', ' || Kunde->Ort as Kunde, LoesungBeschrieb,
	Betriebsystem->Bezeichnung as SystemBez, Prioritaet->Bezeichnung as PrioritaetBez, ProgVersion->Bezeichnung as ProgVersionBez
	from DBProduktQS.FehlerReport where SubProgramm = :SpOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.FunktionAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61549,57444.232287</TimeCreated>

<Query name="ListeBySP">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,SPOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, DBProduktQS.Funktion_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung
	FROM DBProduktQS.Funktion WHERE SPFunktionen = :SPOid ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.ApplikationAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61531,53952.934501</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.Applikation_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung, ModulID FROM DBProduktQS_SD.Applikation WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.Applikation_GetBezeichnungClass(%ID, :MandantOid, :Lang) As wert1, ModulID AS wert2 FROM DBProduktQS_SD.Applikation AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.Applikation_GetBezeichnungClass(%ID, :MandantOid, :Lang) as Bezeichnung, ModulID As Bezeichnung FROM DBProduktQS_SD.Applikation WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>

<Query name="GetEntryByNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, DBProduktQS_SD.Applikation_GetBezeichnungClass(%ID, :MandantOid, :Lang) as Bezeichnung, ModulID As Bezeichnung FROM DBProduktQS_SD.Applikation
	WHERE AktMandant = :MandantOid
	AND Nummer LIKE :Nummer
	ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.BearbStatusAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61531,54055.237841</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.BearbStatus_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.BearbStatus WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.BearbStatus_GetBezeichnungClass(%ID, :MandantOid, :Lang) As wert1, "" AS wert2 FROM DBProduktQS_SD.BearbStatus AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.BearbStatus_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.BearbStatus WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>

<Query name="GetNextStatus">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT TOP 1 ID, Nummer, DBProduktQS_SD.BearbStatus_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.BearbStatus WHERE AktMandant = :MandantOid AND Nummer > :Nummer ORDER BY Nummer asc]]></SqlQuery>
</Query>

<Query name="GetPrevStatus">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT TOP 1 ID, Nummer, DBProduktQS_SD.BearbStatus_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.BearbStatus WHERE AktMandant = :MandantOid AND Nummer < :Nummer ORDER BY Nummer desc]]></SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.BetriebsystemAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61551,32144.16748</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.Betriebsystem WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung As wert1, '' as wert2 FROM DBProduktQS_SD.Betriebsystem AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.Betriebsystem WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.ImportQuelleAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61552,31817.158543</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.ImportQuelle WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung As wert1, '' as wert2 FROM DBProduktQS_SD.ImportQuelle AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.ImportQuelle WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.ModulAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61542,32053.017044</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.Modul WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung As wert1, '' as wert2 FROM DBProduktQS_SD.Modul AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.Modul WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>

<Query name="GetEntryByNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Nummer:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.Modul
	WHERE AktMandant = :MandantOid
	AND Nummer LIKE :Nummer
	ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.PrioritaetenAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61632,33882.842489</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.Prioritaeten WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung As wert1, '' as wert2 FROM DBProduktQS_SD.Prioritaeten AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.Prioritaeten WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.ProgFunktionAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61531,54102.921008</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.ProgFunktion_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.ProgFunktion WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.ProgFunktion_GetBezeichnungClass(%ID, :MandantOid, :Lang) As wert1, "" AS wert2 FROM DBProduktQS_SD.ProgFunktion AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.ProgFunktion_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.ProgFunktion WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>

<Query name="GetEntryByNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, DBProduktQS_SD.ProgFunktion_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.ProgFunktion
	WHERE AktMandant = :MandantOid
	AND Nummer LIKE :Nummer
	ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.ProgTypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61531,54148.135556</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.ProgTyp_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.ProgTyp WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.ProgTyp_GetBezeichnungClass(%ID, :MandantOid, :Lang) As wert1, "" AS wert2 FROM DBProduktQS_SD.ProgTyp AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBProduktQS_SD.ProgTyp_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung FROM DBProduktQS_SD.ProgTyp WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SD.ProgVersionAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61551,30589.177584</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.ProgVersion WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung As wert1, '' as wert2 FROM DBProduktQS_SD.ProgVersion AS Stammdate WHERE AktMandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Bezeichnung FROM DBProduktQS_SD.ProgVersion WHERE AktMandant = :MandantOid AND Nummer = :Nummer ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SPDatenbankAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61552,30810.829912</TimeCreated>

<Query name="ListeByImportTyp">
<Type>%SQLQuery</Type>
<FormalSpec>DatenbankOid:%String,QuelleOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT c.FeldName as CName, c.FeldBezeichnung as CBezeichnung, c.FeldDatentyp as CDatentyp, c.FeldBemerkung as CBemerkung,
	   q.FeldName as QName, q.FeldBezeichnung as QBezeichnung, q.FeldDatentyp as QDatentyp, q.FeldBemerkung as CBemerkung
	   From DBProduktQS.CacheFeld as c Inner Join DBProduktQS.ImportFeld as q On (c.ID = q.CacheFeld) 
	   Where c.Datenbank = :DatenbankOid and q.ImportQuelle = :QuelleOid</SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.AF.SubProgrammAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33545</TimeChanged>
<TimeCreated>61534,35399.174005</TimeCreated>

<Query name="ListeBaum">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, Nummer, DBProduktQS.SubProgramm_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
Applikation->Nummer as AppliNummer, DBProduktQS_SD.Applikation_GetBezeichnungClass(Applikation->ID, :MandantOid, :Lang) as AppliBez, Applikation->ID as AppliID,
ProgTyp->Nummer as ProgTypNummer, DBProduktQS_SD.ProgTyp_GetBezeichnungClass(ProgTyp->ID, :MandantOid, :Lang) as ProgTypBez, ProgTyp->ID as ProgTypID,
Status->Nummer as StatusNummer, DBProduktQS_SD.BearbStatus_GetBezeichnungClass(Status->ID, :MandantOid, :Lang) as StatusBez,
(SELECT DataStream FROM DBProduktQS.DokumentStream As S WHERE S.SPBeschrieb->ID=P.ID AND S.Sprache=:Lang) As Beschrieb
FROM DBProduktQS.SubProgramm As P WHERE AktMandant = :MandantOid
ORDER BY Applikation->Nummer, Nummer, ProgTyp->Nummer]]></SqlQuery>
</Query>

<Query name="GetFirstSubProgrammId">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT TOP 1 ID FROM DBProduktQS.SubProgramm WHERE AktMandant = :MandantOid ORDER BY Applikation, ProgTyp, Nummer</SqlQuery>
</Query>

<Query name="GetSubProgrammByKey">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,ApplikationNr:%Integer,ProgTypNr:%Integer,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, Nummer, DBProduktQS.SubProgramm_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung
	FROM DBProduktQS.SubProgramm WHERE AktMandant = :MandantOid AND Applikation->Nummer = :ApplikationNr AND
	ProgTyp->Nummer = :ProgTypNr AND Nummer = :Nummer]]></SqlQuery>
</Query>

<Query name="GetSubProgrammeByTyp">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,ApplikationNrVon:%Integer,ApplikationNrBis:%Integer,ViewTyp:%Integer,NummerVon:%Integer,NummerBis:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, Nummer, DBProduktQS.SubProgramm_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
	Applikation->Nummer as AppliNummer, DBProduktQS_SD.Applikation_GetBezeichnungClass(Applikation->ID, :MandantOid, :Lang) as AppliBez, 
	ProgTyp->Nummer as ProgTypNummer, DBProduktQS_SD.ProgTyp_GetBezeichnungClass(ProgTyp->ID, :MandantOid, :Lang) as ProgTypBez,
	(SELECT DataStream FROM DBProduktQS.DokumentStream  WHERE SPBeschrieb->ID=q.ID AND Sprache=:Lang) As BeschriebRtf
	FROM DBProduktQS.SubProgramm  as q
	WHERE AktMandant = :MandantOid AND 
	Applikation->Nummer >= :ApplikationNrVon AND Applikation->Nummer <= :ApplikationNrBis AND
	ProgTyp->ViewTyp = :ViewTyp AND 
	Nummer >= :NummerVon AND Nummer <= :NummerBis
	ORDER BY Applikation->Nummer, Nummer, ProgTyp->Nummer]]></SqlQuery>
</Query>

<Query name="GetSubProgrammeByTypen">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,ApplikationNrVon:%Integer,ApplikationNrBis:%Integer,NummerVon:%Integer,NummerBis:%Integer,ViewTypen:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, Nummer, DBProduktQS.SubProgramm_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
	Applikation->Nummer as AppliNummer, DBProduktQS_SD.Applikation_GetBezeichnungClass(Applikation->ID, :MandantOid, :Lang) as AppliBez, 
	ProgTyp->Nummer as ProgTypNummer, DBProduktQS_SD.ProgTyp_GetBezeichnungClass(ProgTyp->ID, :MandantOid, :Lang) as ProgTypBez,
	(SELECT DataStream FROM DBProduktQS.DokumentStream  WHERE SPBeschrieb->ID=q.ID AND Sprache=:Lang) As BeschriebRtf
	FROM DBProduktQS.SubProgramm  as q
	WHERE AktMandant = :MandantOid AND 
	Applikation->Nummer >= :ApplikationNrVon AND Applikation->Nummer <= :ApplikationNrBis AND
	Nummer >= :NummerVon AND Nummer <= :NummerBis AND DBProduktQS.SubProgramm_IsAllowedTyp(:ViewTypen, q.ProgTyp) = 1
	ORDER BY Applikation->Nummer, Nummer, ProgTyp->Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBProduktQS.CacheFeld">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57228.460578</TimeChanged>
<TimeCreated>61551,50968.53042</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="FeldName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
</Property>

<Property name="FeldBezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="FeldDatentyp">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="FeldBemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="Datenbank">
<Type>DBProduktQS.SPDatenbank</Type>
<Cardinality>one</Cardinality>
<Inverse>Feld</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="ImportFeld">
<Type>DBProduktQS.ImportFeld</Type>
<Cardinality>many</Cardinality>
<Inverse>CacheFeld</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.CacheFeldD</DataLocation>
<DefaultData>CacheFeldDefaultData</DefaultData>
<IdLocation>^DBProduktQS.CacheFeldD</IdLocation>
<IndexLocation>^DBProduktQS.CacheFeldI</IndexLocation>
<StreamLocation>^DBProduktQS.CacheFeldS</StreamLocation>
<Data name="CacheFeldDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>FeldName</Value>
</Value>
<Value name="3">
<Value>FeldBezeichnung</Value>
</Value>
<Value name="4">
<Value>FeldDatentyp</Value>
</Value>
<Value name="5">
<Value>FeldBemerkung</Value>
</Value>
<Value name="6">
<Value>Datenbank</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBProduktQS.DokumentStream">
<Super>%Persistent</Super>
<TimeChanged>62416,57228.572365</TimeChanged>
<TimeCreated>61534,34549.423882</TimeCreated>

<Property name="Sprache">
<Type>%String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="MINLEN" value="2"/>
</Property>

<Index name="SpracheIndex">
<Type>bitmap</Type>
<Properties>Sprache</Properties>
</Index>

<Property name="DataStream">
<Type>%GlobalBinaryStream</Type>
</Property>

<Property name="SPMaske">
<Type>DBProduktQS.SPMaske</Type>
<Cardinality>one</Cardinality>
<Inverse>File</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="SPMaskeBild">
<Type>DBProduktQS.SPMaske</Type>
<Cardinality>one</Cardinality>
<Inverse>Bild</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="DokumentTyp">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="999"/>
</Property>

<Property name="DateiName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="DateiEndung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="10"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="InputFile">
<FormalSpec>PathFileName:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	If (PathFileName'="") {
		Set stream=##class(%FileBinaryStream).%New()
		Set stream.Filename=PathFileName
		Set Ret=..DataStream.CopyFromAndSave(stream)
		Set stream=""
		do ..%Save()
		Quit Ret=1 
	} Else {
		Quit 0
	}
]]></Implementation>
</Method>

<Property name="SPBeschrieb">
<Type>DBProduktQS.SubProgramm</Type>
<Cardinality>one</Cardinality>
<Inverse>Beschrieb</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="SPBeschriebFile">
<Type>DBProduktQS.SPBeschrieb</Type>
<Cardinality>one</Cardinality>
<Inverse>File</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="SPListeFile">
<Type>DBProduktQS.SPListe</Type>
<Cardinality>one</Cardinality>
<Inverse>File</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="SPListeBild">
<Type>DBProduktQS.SPListe</Type>
<Cardinality>one</Cardinality>
<Inverse>Bild</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="SPListePDF">
<Type>DBProduktQS.SPListe</Type>
<Cardinality>one</Cardinality>
<Inverse>PDF</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FunktionSDIcon">
<Type>DBProduktQS.SD.ProgFunktion</Type>
<Cardinality>one</Cardinality>
<Inverse>Icon</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FunktionSDBeschrieb">
<Type>DBProduktQS.SD.ProgFunktion</Type>
<Cardinality>one</Cardinality>
<Inverse>Beschrieb</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FunktionIcon">
<Type>DBProduktQS.Funktion</Type>
<Cardinality>one</Cardinality>
<Inverse>Icon</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FunktionBeschrieb">
<Type>DBProduktQS.Funktion</Type>
<Cardinality>one</Cardinality>
<Inverse>Beschrieb</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FehlerReportFile">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>one</Cardinality>
<Inverse>File</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.DokumentStreamD</DataLocation>
<DefaultData>DokumentStreamDefaultData</DefaultData>
<IdLocation>^DBProduktQS.DokumentStreamD</IdLocation>
<IndexLocation>^DBProduktQS.DokumentStreamI</IndexLocation>
<StreamLocation>^DBProduktQS.DokumentStreamS</StreamLocation>
<Data name="DokumentStreamDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>DataStream</Value>
</Value>
<Value name="3">
<Value>Sprache</Value>
</Value>
<Value name="4">
<Value>SPMaske</Value>
</Value>
<Value name="5">
<Value>SPMaskeBild</Value>
</Value>
<Value name="6">
<Value>DokumentTyp</Value>
</Value>
<Value name="7">
<Value>DateiName</Value>
</Value>
<Value name="8">
<Value>DateiEndung</Value>
</Value>
<Value name="9">
<Value>SPBeschrieb</Value>
</Value>
<Value name="10">
<Value>SPBeschriebFile</Value>
</Value>
<Value name="11">
<Value>SPListeFile</Value>
</Value>
<Value name="12">
<Value>SPListeBild</Value>
</Value>
<Value name="13">
<Value>SPListePDF</Value>
</Value>
<Value name="14">
<Value>FunktionSDIcon</Value>
</Value>
<Value name="15">
<Value>FunktionSDBeschrieb</Value>
</Value>
<Value name="16">
<Value>FunktionIcon</Value>
</Value>
<Value name="17">
<Value>FunktionBeschrieb</Value>
</Value>
<Value name="18">
<Value>FehlerReportFile</Value>
</Value>
</Data>
<Property name="DataStream"/>
<Property name="DateiEndung"/>
<Property name="DateiName"/>
<Property name="DokumentTyp"/>
<Property name="FehlerReportFile"/>
<Property name="FunktionBeschrieb"/>
<Property name="FunktionIcon"/>
<Property name="FunktionSDBeschrieb"/>
<Property name="FunktionSDIcon"/>
<Property name="SPBeschrieb"/>
<Property name="SPBeschriebFile"/>
<Property name="SPListeBild"/>
<Property name="SPListeFile"/>
<Property name="SPListePDF"/>
<Property name="SPMaske"/>
<Property name="SPMaskeBild"/>
<Property name="Sprache"/>
</Storage>
</Class>


<Class name="DBProduktQS.FehlerNotiz">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57228.703877</TimeChanged>
<TimeCreated>61550,35409.698106</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Erfassungsdatum">
<Type>%TimeStamp</Type>
</Property>

<Property name="NotizText">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Erfasser">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerNotizErfasser</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FehlerReport">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>one</Cardinality>
<Inverse>Notiz</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="FehlerNotizIndex">
<Properties>FehlerReport</Properties>
</Index>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.FehlerNotizD</DataLocation>
<DefaultData>FehlerNotizDefaultData</DefaultData>
<IdLocation>^DBProduktQS.FehlerNotizD</IdLocation>
<IndexLocation>^DBProduktQS.FehlerNotizI</IndexLocation>
<StreamLocation>^DBProduktQS.FehlerNotizS</StreamLocation>
<Data name="FehlerNotizDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Erfassungsdatum</Value>
</Value>
<Value name="3">
<Value>NotizText</Value>
</Value>
<Value name="4">
<Value>Erfasser</Value>
</Value>
<Value name="5">
<Value>FehlerReport</Value>
</Value>
</Data>
<Property name="Erfasser"/>
<Property name="Erfassungsdatum"/>
<Property name="FehlerReport"/>
<Property name="NotizText"/>
</Storage>
</Class>


<Class name="DBProduktQS.FehlerReport">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57228.830171</TimeChanged>
<TimeCreated>61550,34216.462973</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Erfassungsdatum">
<Type>%TimeStamp</Type>
</Property>

<Property name="Erledigtdatum">
<Type>%TimeStamp</Type>
</Property>

<Property name="Status">
<Type>DBProduktQS.SD.BearbStatus</Type>
<Cardinality>one</Cardinality>
<Inverse>Fehlerreport</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="StatusIndex">
<Properties>Status</Properties>
</Index>

<Property name="UpdateGemacht">
<Type>%Boolean</Type>
</Property>

<Property name="ProblemKurzBeschrieb">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ProblemBeschrieb">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="LoesungBeschrieb">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Kunde">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerReport</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Erfasser">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerReportErfasser</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Zustaendiger">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerReportZustaendiger</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Erlediger">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerReportErlediger</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="File">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>FehlerReportFile</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputStream">
<FormalSpec>ID:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE ID=:ID)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE ID=:ID)
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,ID:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ID
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE ID=:ID)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.FehlerReportFile = ##Class(DBProduktQS.FehlerReport).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set listeOid = $lg(oid,1)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE FehlerReportFile = :listeOid)
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE FehlerReportFile = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Property name="Notiz">
<Type>DBProduktQS.FehlerNotiz</Type>
<Cardinality>many</Cardinality>
<Inverse>FehlerReport</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="SubProgramm">
<Type>DBProduktQS.SubProgramm</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerReport</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="ProgVersion">
<Type>DBProduktQS.SD.ProgVersion</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerReport</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Betriebsystem">
<Type>DBProduktQS.SD.Betriebsystem</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerReport</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Prioritaet">
<Type>DBProduktQS.SD.Prioritaeten</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerReport</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="GeprueftDatum">
<Type>%TimeStamp</Type>
</Property>

<Property name="GeprueftVisum">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>one</Cardinality>
<Inverse>FehlerGeprueft</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="GeprueftVisumIndex">
<Properties>GeprueftVisum</Properties>
</Index>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.FehlerReportD</DataLocation>
<DefaultData>FehlerReportDefaultData</DefaultData>
<IdLocation>^DBProduktQS.FehlerReportD</IdLocation>
<IndexLocation>^DBProduktQS.FehlerReportI</IndexLocation>
<StreamLocation>^DBProduktQS.FehlerReportS</StreamLocation>
<Data name="FehlerReportDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Erfassungsdatum</Value>
</Value>
<Value name="3">
<Value>Erledigtdatum</Value>
</Value>
<Value name="4">
<Value>ProgVersion</Value>
</Value>
<Value name="5">
<Value>Betriebssystem</Value>
</Value>
<Value name="6">
<Value>Status</Value>
</Value>
<Value name="7">
<Value>UpdateGemacht</Value>
</Value>
<Value name="8">
<Value>ProblemBeschrieb</Value>
</Value>
<Value name="9">
<Value>LoesungBeschrieb</Value>
</Value>
<Value name="10">
<Value>Kunde</Value>
</Value>
<Value name="11">
<Value>Erfasser</Value>
</Value>
<Value name="12">
<Value>Zustaendiger</Value>
</Value>
<Value name="13">
<Value>Erlediger</Value>
</Value>
<Value name="14">
<Value>ProblemKurzBeschrieb</Value>
</Value>
<Value name="15">
<Value>SubProgramm</Value>
</Value>
<Value name="16">
<Value>Betriebsystem</Value>
</Value>
<Value name="17">
<Value>Prioritaete</Value>
</Value>
<Value name="18">
<Value>Prioritaet</Value>
</Value>
<Value name="19">
<Value>GeprueftDatum</Value>
</Value>
<Value name="20">
<Value>GeprueftVisum</Value>
</Value>
</Data>
<Property name="Betriebsystem"/>
<Property name="Erfasser"/>
<Property name="Erfassungsdatum"/>
<Property name="Erlediger"/>
<Property name="Erledigtdatum"/>
<Property name="Kunde"/>
<Property name="LoesungBeschrieb"/>
<Property name="Prioritaet"/>
<Property name="ProblemBeschrieb"/>
<Property name="ProblemKurzBeschrieb"/>
<Property name="ProgVersion"/>
<Property name="Status"/>
<Property name="SubProgramm"/>
<Property name="UpdateGemacht"/>
<Property name="Zustaendiger"/>
</Storage>
</Class>


<Class name="DBProduktQS.Funktion">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57228.986313</TimeChanged>
<TimeCreated>61549,53411.086187</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBProduktQS.Funktion).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS.Funktion)
	Quit +nr +1
]]></Implementation>
</Method>

<Property name="Icon">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>FunktionIcon</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputIcon">
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE FunktionIcon->ID=:myId AND Sprache='De')
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE FunktionIcon->ID=:myId AND 
				       Sprache='De')
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputIcon">
<FormalSpec>Stream:%Library.GlobalBinaryStream</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE FunktionIcon->ID=:myId AND Sprache='De')
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = "De"
			Set n.FunktionIcon = ##Class(DBProduktQS.Funktion).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE FunktionIcon->ID=:myId AND 
		           Sprache='De')
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set feldOid = $lg(oid,1)
	d ##class(DBProduktQS.Funktion).DeleteRelations(feldOid)		
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code>	set myId = {ID*O}
	d ##class(DBProduktQS.Funktion).DeleteRelations(myId)</Code>
<Event>DELETE</Event>
</Trigger>

<Method name="DeleteRelations">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE FunktionIcon = :oid)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE FunktionBeschrieb = :oid)
]]></Implementation>
</Method>

<Property name="Beschrieb">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>FunktionBeschrieb</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputBeschrieb">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE FunktionBeschrieb->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE FunktionBeschrieb->ID=:myId AND 
				       Sprache=:Sprache)
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputBeschrieb">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE FunktionBeschrieb->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.FunktionBeschrieb = ##Class(DBProduktQS.Funktion).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE FunktionBeschrieb->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Property name="SPFunktionen">
<Type>DBProduktQS.SPFunktionen</Type>
<Cardinality>one</Cardinality>
<Inverse>Funktionen</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="IsNumberExsisting">
<ClassMethod>1</ClassMethod>
<FormalSpec>Nummer:%Integer,SPOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
		&sql(SELECT ID InTo id 
		FROM DBProduktQS.Funktion
		WHERE SPFunktionen->ID=:SPOid AND Nummer = :Nummer)
	quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.FunktionD</DataLocation>
<DefaultData>FunktionDefaultData</DefaultData>
<IdLocation>^DBProduktQS.FunktionD</IdLocation>
<IndexLocation>^DBProduktQS.FunktionI</IndexLocation>
<StreamLocation>^DBProduktQS.FunktionS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="FunktionDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>SPFunktionen</Value>
</Value>
<Value name="4">
<Value>Sprache</Value>
</Value>
</Data>
<Property name="Nummer"/>
<Property name="SPFunktionen"/>
</Storage>
</Class>


<Class name="DBProduktQS.ImportFeld">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57229.11199</TimeChanged>
<TimeCreated>61551,51318.048352</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="FeldName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
</Property>

<Property name="FeldBezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="FeldDatentyp">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="FeldBemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="CacheFeld">
<Type>DBProduktQS.CacheFeld</Type>
<Cardinality>one</Cardinality>
<Inverse>ImportFeld</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="CacheFeldIndex">
<Properties>CacheFeld</Properties>
</Index>

<Property name="ImportQuelle">
<Type>DBProduktQS.SD.ImportQuelle</Type>
<Cardinality>one</Cardinality>
<Inverse>ImportFeld</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="ImportQuelleIndex">
<Properties>ImportQuelle</Properties>
</Index>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.ImportFeldD</DataLocation>
<DefaultData>ImportFeldDefaultData</DefaultData>
<IdLocation>^DBProduktQS.ImportFeldD</IdLocation>
<IndexLocation>^DBProduktQS.ImportFeldI</IndexLocation>
<StreamLocation>^DBProduktQS.ImportFeldS</StreamLocation>
<Data name="ImportFeldDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>FeldName</Value>
</Value>
<Value name="3">
<Value>FeldBezeichnung</Value>
</Value>
<Value name="4">
<Value>FeldDatentyp</Value>
</Value>
<Value name="5">
<Value>FeldBemerkung</Value>
</Value>
<Value name="6">
<Value>CacheFeld</Value>
</Value>
<Value name="7">
<Value>ImportQuelle</Value>
</Value>
</Data>
</Storage>
</Class>


<Project name="DBProduktQS">
  <Items>
    <ProjectItem name="DBProduktQS.AF.FehlerNotizAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.FehlerReportAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.FunktionAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.ApplikationAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.BearbStatusAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.BetriebsystemAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.ImportQuelleAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.ModulAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.PrioritaetenAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.ProgFunktionAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.ProgTypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SD.ProgVersionAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SPDatenbankAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.AF.SubProgrammAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.CacheFeld" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.DokumentStream" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.FehlerNotiz" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.FehlerReport" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.Funktion" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.ImportFeld" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.Applikation" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.BearbStatus" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.Betriebsystem" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.ImportQuelle" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.Modul" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.Prioritaeten" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.ProgFunktion" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.ProgTyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SD.ProgVersion" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SPBeschrieb" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SPDatenbank" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SPFunktionen" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SPListe" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SPMaske" type="CLS"></ProjectItem>
    <ProjectItem name="DBProduktQS.SubProgramm" type="CLS"></ProjectItem>
  </Items>
</Project>


<Class name="DBProduktQS.SD.Applikation">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57285.615642</TimeChanged>
<TimeCreated>61531,53142.257752</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="NummerIndex">
<Data>%%ID,Nummer</Data>
<Properties>AktMandant,Nummer</Properties>
<Unique>1</Unique>
</Index>

<Property name="SubProgramm">
<Type>DBProduktQS.SubProgramm</Type>
<Cardinality>many</Cardinality>
<Inverse>Applikation</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBProduktQS.SD.Applikation).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.Applikation)
	Quit +nr +1
]]></Implementation>
</Method>

<Method name="LastApplikation">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, appnr,""),-1)
	}
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveLastOnApplikationNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""),-1)
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, appnr,""),-1,list)
	}
	Quit list
]]></Implementation>
</Method>

<Method name="FirstApplikation">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""))
	set oid = ""
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, appnr,""))
	}
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveFirstOnApplikationNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""))
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, appnr,""),1,list)
	} else {
		set list = ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="NextApplikation">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ApplikationNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set AppNummer = " "_ApplikationNr
	set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""))
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex", MandOid,AppNummer))
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex", MandOid,tmp,""))
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""),-1)
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid,AppNummer),-1)
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid,tmp,""),-1)
					}
				} else {
					set oid = ##class(DBProduktQS.SD.Applikation).LastApplikation(MandOid)
				}
			}
		} else {
			set oid = ##class(DBProduktQS.SD.Applikation).LastApplikation(MandOid)
		}
	} else {
		set oid = ##class(DBProduktQS.SD.Applikation).LastApplikation(MandOid)
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveNextOnApplikationNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ApplikationNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set AppNummer = " "_ApplikationNr
	set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""))
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex", MandOid, ApplikationNr))
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex", MandOid,tmp,""),1,list)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""),-1)
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid,AppNummer),-1)
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid,tmp,""),-1,list)
					}
						
				} else {
					set list = ##class(DBProduktQS.SD.Applikation).MoveLastOnApplikationNr(MandOid)
					
				}
			}
		} else {
			set list = ##class(DBProduktQS.SD.Applikation).MoveLastOnApplikationNr(MandOid)
			
		}
	} else {
		set list = ##class(DBProduktQS.SD.Applikation).MoveLastOnApplikationNr(MandOid)
		
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="PrevApplikation">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ApplikationNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set AppNummer = " "_ApplikationNr
	set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex", MandOid,AppNummer),-1)
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex", MandOid,tmp,""),-1)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""))
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid,AppNummer))
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid,tmp,""))
					}
				} else {
					set oid = ##class(DBProduktQS.SD.Applikation).FirstApplikation(MandOid)
				}
			} 
				
		} else {
			set oid = ##class(DBProduktQS.SD.Applikation).FirstApplikation(MandOid)
		}
	} else {
		set oid = ##class(DBProduktQS.SD.Applikation).FirstApplikation(MandOid)
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="MovePrevOnApplikationNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ApplikationNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set AppNummer = " "_ApplikationNr
	set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex", MandOid,ApplikationNr),-1)
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex", MandOid,tmp,""),-1,list)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid, ""))
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid,AppNummer))
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ApplikationI("NummerIndex",MandOid,tmp,""),1,list)
					}
				} else {
					set list = ##class(DBProduktQS.SD.Applikation).MoveFirstOnApplikationNr(MandOid)
				}
			}
		} else {
			set list = ##class(DBProduktQS.SD.Applikation).MoveFirstOnApplikationNr(MandOid)
		}
		
	} else {
		set list = ##class(DBProduktQS.SD.Applikation).MoveFirstOnKontoNr(MandOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="GetAppByBez">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Lang:%String,Bezeichnung:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set bez = Bezeichnung_"%"
	set nId = ""
	&sql(SELECT TOP 1 ID INTO :nId 
	 	 FROM DBProduktQS_SD.Applikation
	 	 WHERE AktMandant = :MandantOid
	 	 AND DBProduktQS_SD.Applikation_GetBezeichnungClass(%ID, :MandantOid, :Lang) LIKE :bez)
	if (nId '= "") {
		Quit nId 
		 
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Property name="ModulID">
<Type>%Library.BigInt</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.ApplikationD</DataLocation>
<DefaultData>ApplikationDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.ApplikationD</IdLocation>
<IndexLocation>^DBProduktQS.SD.ApplikationI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.ApplikationS</StreamLocation>
<Data name="ApplikationDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
<Value name="4">
<Value>SubProgramm</Value>
</Value>
<Value name="5">
<Value>Modulnummer</Value>
</Value>
<Value name="6">
<Value>Modul</Value>
</Value>
<Value name="7">
<Value>ModulID</Value>
</Value>
</Data>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Property name="AktMandant"/>
<Property name="Modul"/>
<Property name="ModulID"/>
<Property name="Modulnummer"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBProduktQS.SD.BearbStatus">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57285.742629</TimeChanged>
<TimeCreated>61531,53499.756259</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Property name="SubProgramm">
<Type>DBProduktQS.SubProgramm</Type>
<Cardinality>many</Cardinality>
<Inverse>Status</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Fehlerreport">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>Status</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBProduktQS.SD.BearbStatus).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.BearbStatus)
	Quit +nr +1
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.BearbStatusD</DataLocation>
<DefaultData>BearbStatusDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.BearbStatusD</IdLocation>
<IndexLocation>^DBProduktQS.SD.BearbStatusI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.BearbStatusS</StreamLocation>
<Data name="BearbStatusDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
<Value name="4">
<Value>SubProgramm</Value>
</Value>
</Data>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Property name="AktMandant"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBProduktQS.SD.Betriebsystem">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57285.850531</TimeChanged>
<TimeCreated>61551,30648.803271</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="NummerIndex">
<Data>%%ID,Nummer</Data>
<Properties>AktMandant,Nummer</Properties>
</Index>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.Betriebsystem)
	Quit +nr +1
]]></Implementation>
</Method>

<Property name="FehlerReport">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>Betriebsystem</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.BetriebsystemD</DataLocation>
<DefaultData>BetriebsystemDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.BetriebsystemD</IdLocation>
<IndexLocation>^DBProduktQS.SD.BetriebsystemI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.BetriebsystemS</StreamLocation>
<Data name="BetriebsystemDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Bezeichnung</Value>
</Value>
<Value name="4">
<Value>AktMandant</Value>
</Value>
</Data>
<Property name="AktMandant"/>
<Property name="Bezeichnung"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBProduktQS.SD.ImportQuelle">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57285.955006</TimeChanged>
<TimeCreated>61551,51240.298261</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="NummerIndex">
<Data>%%ID,Nummer</Data>
<Properties>AktMandant,Nummer</Properties>
</Index>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.Betriebsystem)
	Quit +nr +1
]]></Implementation>
</Method>

<Property name="ImportFeld">
<Type>DBProduktQS.ImportFeld</Type>
<Cardinality>many</Cardinality>
<Inverse>ImportQuelle</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.ImportQuelleD</DataLocation>
<DefaultData>ImportQuelleDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.ImportQuelleD</IdLocation>
<IndexLocation>^DBProduktQS.SD.ImportQuelleI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.ImportQuelleS</StreamLocation>
<Data name="ImportQuelleDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Bezeichnung</Value>
</Value>
<Value name="4">
<Value>AktMandant</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBProduktQS.SD.Modul">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57286.082749</TimeChanged>
<TimeCreated>61542,30927.689147</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="NummerIndex">
<Data>%%ID,Nummer</Data>
<Properties>AktMandant,Nummer</Properties>
<Unique>1</Unique>
</Index>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.Modul)
	Quit +nr +1
]]></Implementation>
</Method>

<Method name="LastModul">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, appnr,""),-1)
	}
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveLastOnModulNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""),-1)
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, appnr,""),-1,list)
	}
	Quit list
]]></Implementation>
</Method>

<Method name="FirstModul">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""))
	set oid = ""
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, appnr,""))
	}
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveFirstOnModulNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""))
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, appnr,""),1,list)
	} else {
		set list = ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="NextModul">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ModulNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set AppNummer = " "_ModulNr
	set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""))
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ModulI("NummerIndex", MandOid,AppNummer))
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex", MandOid,tmp,""))
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""),-1)
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid,AppNummer),-1)
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid,tmp,""),-1)
					}
				} else {
					set oid = ##class(DBProduktQS.SD.Modul).LastModul(MandOid)
				}
			}
		} else {
			set oid = ##class(DBProduktQS.SD.Modul).LastModul(MandOid)
		}
	} else {
		set oid = ##class(DBProduktQS.SD.Modul).LastModul(MandOid)
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveNextOnModulNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ModulNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set AppNummer = " "_ModulNr
	set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""))
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ModulI("NummerIndex", MandOid, ModulNr))
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex", MandOid,tmp,""),1,list)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""),-1)
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid,AppNummer),-1)
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid,tmp,""),-1,list)
					}
						
				} else {
					set list = ##class(DBProduktQS.SD.Modul).MoveLastOnModulNr(MandOid)
					
				}
			}
		} else {
			set list = ##class(DBProduktQS.SD.Modul).MoveLastOnModulNr(MandOid)
			
		}
	} else {
		set list = ##class(DBProduktQS.SD.Modul).MoveLastOnModulNr(MandOid)
		
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="PrevModul">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ModulNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set AppNummer = " "_ModulNr
	set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ModulI("NummerIndex", MandOid,AppNummer),-1)
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex", MandOid,tmp,""),-1)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""))
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid,AppNummer))
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid,tmp,""))
					}
				} else {
					set oid = ##class(DBProduktQS.SD.Modul).FirstModul(MandOid)
				}
			} 
				
		} else {
			set oid = ##class(DBProduktQS.SD.Modul).FirstModul(MandOid)
		}
	} else {
		set oid = ##class(DBProduktQS.SD.Modul).FirstModul(MandOid)
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="MovePrevOnModulNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ModulNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set AppNummer = " "_ModulNr
	set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ModulI("NummerIndex", MandOid,ModulNr),-1)
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex", MandOid,tmp,""),-1,list)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid, ""))
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid,AppNummer))
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ModulI("NummerIndex",MandOid,tmp,""),1,list)
					}
				} else {
					set list = ##class(DBProduktQS.SD.Modul).MoveFirstOnModulNr(MandOid)
				}
			}
		} else {
			set list = ##class(DBProduktQS.SD.Modul).MoveFirstOnModulNr(MandOid)
		}
		
	} else {
		set list = ##class(DBProduktQS.SD.Modul).MoveFirstOnKontoNr(MandOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="GetModulByBez">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Lang:%String,Bezeichnung:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set bez = Bezeichnung_"%"
	set nId = ""
	&sql(SELECT TOP 1 ID INTO :nId 
	 	 FROM DBProduktQS_SD.Modul
	 	 WHERE AktMandant = :MandantOid
	 	 AND Bezeichnung LIKE :bez)
	if (nId '= "") {
		Quit nId 
		 
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.ModulD</DataLocation>
<DefaultData>ModulDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.ModulD</IdLocation>
<IndexLocation>^DBProduktQS.SD.ModulI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.ModulS</StreamLocation>
<Data name="ModulDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Bezeichnung</Value>
</Value>
<Value name="4">
<Value>AktMandant</Value>
</Value>
<Value name="5">
<Value>ModulID</Value>
</Value>
</Data>
<Property name="AktMandant"/>
<Property name="Bezeichnung"/>
<Property name="ModulID"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBProduktQS.SD.Prioritaeten">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57286.185417</TimeChanged>
<TimeCreated>61632,33468.772902</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="NummerIndex">
<Data>%%ID,Nummer</Data>
<Properties>AktMandant,Nummer</Properties>
</Index>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.Prioritaeten)
	Quit +nr +1
]]></Implementation>
</Method>

<Property name="FehlerReport">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>Prioritaet</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.PrioritaetenD</DataLocation>
<DefaultData>PrioritaetenDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.PrioritaetenD</IdLocation>
<IndexLocation>^DBProduktQS.SD.PrioritaetenI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.PrioritaetenS</StreamLocation>
<Data name="PrioritaetenDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Bezeichnung</Value>
</Value>
<Value name="4">
<Value>AktMandant</Value>
</Value>
</Data>
<Property name="AktMandant"/>
<Property name="Bezeichnung"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBProduktQS.SD.ProgFunktion">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57286.302664</TimeChanged>
<TimeCreated>61531,53350.176195</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="NummerIndex">
<Data>%%ID,Nummer</Data>
<Properties>AktMandant,Nummer</Properties>
<Unique>1</Unique>
</Index>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBProduktQS.SD.ProgFunktion).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.ProgFunktion)
	Quit +nr +1
]]></Implementation>
</Method>

<Method name="LastProgFunkt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, appnr,""),-1)
	}
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveLastOnProgFunktNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""),-1)
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, appnr,""),-1,list)
	}
	Quit list
]]></Implementation>
</Method>

<Method name="FirstProgFunkt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""))
	set oid = ""
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, appnr,""))
	}
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveFirstOnProgFunktNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""))
	if (appnr '= "") {
		set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, appnr,""),1,list)
	} else {
		set list = ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="NextProgFunkt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ProgFunktNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set ProgFunktNummer = " "_ProgFunktNr
	set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""))
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex", MandOid,ProgFunktNummer))
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex", MandOid,tmp,""))
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""),-1)
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid,ProgFunktNummer),-1)
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid,tmp,""),-1)
					}
				} else {
					set oid = ##class(DBProduktQS.SD.ProgFunktion).LastProgFunkt(MandOid)
				}
			}
		} else {
			set oid = ##class(DBProduktQS.SD.ProgFunktion).LastProgFunkt(MandOid)
		}
	} else {
		set oid = ##class(DBProduktQS.SD.ProgFunktion).LastProgFunkt(MandOid)
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="MoveNextOnProgFunktNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ProgFunktNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set ProgFunktNummer = " "_ProgFunktNr
	set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""))
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex", MandOid,ProgFunktNr))
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex", MandOid,tmp,""),1,list)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""),-1)
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid,ProgFunktNummer),-1)
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid,tmp,""),-1,list)
					}
						
				} else {
					set list = ##class(DBProduktQS.SD.ProgFunktion).MoveLastOnProgFunktNr(MandOid)
					
				}
			}
		} else {
			set list = ##class(DBProduktQS.SD.ProgFunktion).MoveLastOnProgFunktNr(MandOid)
			
		}
	} else {
		set list = ##class(DBProduktQS.SD.ProgFunktion).MoveLastOnProgFunktNr(MandOid)
		
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="PrevProgFunkt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ProgFunktNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set MandOid = " "_MandOid
	set ProgFunktNummer = " "_ProgFunktNr
	set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex", MandOid,ProgFunktNummer),-1)
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex", MandOid,tmp,""),-1)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""))
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid,ProgFunktNummer))
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid,tmp,""))
					}
				} else {
					set oid = ##class(DBProduktQS.SD.ProgFunktion).FirstProgFunkt(MandOid)
				}
			} 
				
		} else {
			set oid = ##class(DBProduktQS.SD.ProgFunktion).FirstProgFunkt(MandOid)
		}
	} else {
		set oid = ##class(DBProduktQS.SD.ProgFunktion).FirstProgFunkt(MandOid)
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="MovePrevOnProgFunktNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String,ProgFunktNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandOid = " "_MandOid
	set ProgFunktNummer = " "_ProgFunktNr
	set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""),-1)
	set oid = ""
	if appnr '= "" {
		set tmp = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex", MandOid,ProgFunktNr),-1)
		if (tmp '= "") {
			set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex", MandOid,tmp,""),-1,list)
			if oid = "" {
				set appnr = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid, ""))
				if (appnr '= "") {
					set tmp = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid,ProgFunktNummer))
					if (tmp '= "") {
						set oid = $Order(^DBProduktQS.SD.ProgFunktionI("NummerIndex",MandOid,tmp,""),1,list)
					}
				} else {
					set list = ##class(DBProduktQS.SD.ProgFunktion).MoveFirstOnProgFunktNr(MandOid)
				}
			}
		} else {
			set list = ##class(DBProduktQS.SD.ProgFunktion).MoveFirstOnProgFunktNr(MandOid)
		}
		
	} else {
		set list = ##class(DBProduktQS.SD.ProgFunktion).MoveFirstOnKontoNr(MandOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="GetProgFunktByBez">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Lang:%String,Bezeichnung:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set bez = Bezeichnung_"%"
	set nId = ""
	&sql(SELECT TOP 1 ID INTO :nId 
	 	 FROM DBProduktQS_SD.ProgFunktion
	 	 WHERE AktMandant = :MandantOid
	 	 AND DBProduktQS_SD.ProgFunktion_GetBezeichnungClass(%ID, :MandantOid, :Lang) LIKE :bez)
	if (nId '= "") {
		Quit nId 
		 
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Property name="Icon">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>FunktionSDIcon</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputIcon">
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE FunktionSDIcon->ID=:myId AND Sprache='De')
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE FunktionSDIcon->ID=:myId AND 
				       Sprache='De')
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputIcon">
<FormalSpec>Stream:%Library.GlobalBinaryStream</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE FunktionSDIcon->ID=:myId AND Sprache='De')
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = "De"
			Set n.FunktionSDIcon = ##Class(DBProduktQS.SD.ProgFunktion).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE FunktionSDIcon->ID=:myId AND 
		           Sprache='De')
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set feldOid = $lg(oid,1)
	d ##class(DBProduktQS.SD.ProgFunktion).DeleteRelations(feldOid)		
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code>	set myId = {ID*O}
	d ##class(DBProduktQS.SD.ProgFunktion).DeleteRelations(myId)</Code>
<Event>DELETE</Event>
</Trigger>

<Method name="DeleteRelations">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE FunktionSDIcon = :oid)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE FunktionSDBeschrieb = :oid)
]]></Implementation>
</Method>

<Property name="Beschrieb">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>FunktionSDBeschrieb</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputBeschrieb">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE FunktionSDBeschrieb->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE FunktionSDBeschrieb->ID=:myId AND 
				       Sprache=:Sprache)
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputBeschrieb">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE FunktionSDBeschrieb->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.FunktionSDBeschrieb = ##Class(DBProduktQS.SD.ProgFunktion).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE FunktionSDBeschrieb->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.ProgFunktionD</DataLocation>
<DefaultData>ProgFunktionDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.ProgFunktionD</IdLocation>
<IndexLocation>^DBProduktQS.SD.ProgFunktionI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.ProgFunktionS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="ProgFunktionDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
<Value name="4">
<Value>SubProgramm</Value>
</Value>
</Data>
<Property name="AktMandant"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBProduktQS.SD.ProgTyp">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57286.414248</TimeChanged>
<TimeCreated>61531,53426.106965</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ViewTyp">
<Type>%Library.Integer</Type>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Property name="SubProgramm">
<Type>DBProduktQS.SubProgramm</Type>
<Cardinality>many</Cardinality>
<Inverse>ProgTyp</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBProduktQS.SD.ProgTyp).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.ProgTyp)
	Quit +nr +1
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.ProgTypD</DataLocation>
<DefaultData>ProgTypDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.ProgTypD</IdLocation>
<IndexLocation>^DBProduktQS.SD.ProgTypI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.ProgTypS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="ProgTypDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
<Value name="4">
<Value>SubProgramm</Value>
</Value>
<Value name="5">
<Value>ViewTyp</Value>
</Value>
</Data>
<Property name="AktMandant"/>
<Property name="Nummer"/>
<Property name="ViewTyp"/>
</Storage>
</Class>


<Class name="DBProduktQS.SD.ProgVersion">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57286.519533</TimeChanged>
<TimeCreated>61551,30493.274665</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="NummerIndex">
<Data>%%ID,Nummer</Data>
<Properties>AktMandant,Nummer</Properties>
</Index>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS_SD.ProgVersion)
	Quit +nr +1
]]></Implementation>
</Method>

<Property name="FehlerReport">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>ProgVersion</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SD.ProgVersionD</DataLocation>
<DefaultData>ProgVersionDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SD.ProgVersionD</IdLocation>
<IndexLocation>^DBProduktQS.SD.ProgVersionI</IndexLocation>
<StreamLocation>^DBProduktQS.SD.ProgVersionS</StreamLocation>
<Data name="ProgVersionDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Bezeichnung</Value>
</Value>
<Value name="4">
<Value>AktMandant</Value>
</Value>
</Data>
<Property name="AktMandant"/>
<Property name="Bezeichnung"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBProduktQS.SPBeschrieb">
<Super>DBProduktQS.SubProgramm</Super>
<TimeChanged>61548,54077.288906</TimeChanged>
<TimeCreated>61548,48103.870669</TimeCreated>

<Property name="File">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>SPBeschriebFile</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputStream">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPBeschriebFile->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPBeschriebFile->ID=:myId AND 
				       Sprache=:Sprache)
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE SPBeschriebFile->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.SPBeschriebFile = ##Class(DBProduktQS.SPBeschrieb).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPBeschriebFile->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set beschriebOid = $lg(oid,1)
	d ##class(DBProduktQS.SubProgramm).DeleteRelations(beschriebOid)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPBeschriebFile = :beschriebOid)
	set beschrieb = ""	
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	d ##class(DBProduktQS.SubProgramm).DeleteRelations(myId)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPBeschriebFile = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Method name="GetStreamObject">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>DBProduktQS.DokumentStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(DBProduktQS.DokumentStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPBeschriebFile->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPBeschriebFile->ID=:myId AND 
				       Sprache=:Sprache)
			Set tmpStream=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		}
		
	Quit tmpStream
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBProduktQS.SPDatenbank">
<Super>DBProduktQS.SubProgramm</Super>
<TimeChanged>61551,61145</TimeChanged>
<TimeCreated>61551,50755.764986</TimeCreated>

<Property name="Feld">
<Type>DBProduktQS.CacheFeld</Type>
<Cardinality>many</Cardinality>
<Inverse>Datenbank</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBProduktQS.SPFunktionen">
<Super>DBProduktQS.SubProgramm</Super>
<TimeChanged>61550,47974</TimeChanged>
<TimeCreated>61549,53481.07333</TimeCreated>

<Property name="Funktionen">
<Type>DBProduktQS.Funktion</Type>
<Cardinality>many</Cardinality>
<Inverse>SPFunktionen</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBProduktQS.SPListe">
<Super>DBProduktQS.SubProgramm</Super>
<TimeChanged>61548,59942.824832</TimeChanged>
<TimeCreated>61548,56350.528746</TimeCreated>

<Property name="File">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>SPListeFile</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputStream">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListeFile->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPListeFile->ID=:myId AND 
				       Sprache=:Sprache)
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE SPListeFile->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.SPListeFile = ##Class(DBProduktQS.SPBeschrieb).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListeFile->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set listeOid = $lg(oid,1)
	d ##class(DBProduktQS.SubProgramm).DeleteRelations(listeOid)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPListeFile = :listeOid)
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	d ##class(DBProduktQS.SubProgramm).DeleteRelations(myId)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPListeFile = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Method name="GetStreamObject">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>DBProduktQS.DokumentStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(DBProduktQS.DokumentStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListeFile->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPListeFile->ID=:myId AND 
				       Sprache=:Sprache)
			Set tmpStream=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		}
		
	Quit tmpStream
]]></Implementation>
</Method>

<Property name="Bild">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>SPListeBild</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="PDF">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>SPListePDF</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputStreamBild">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListeBild->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPListeBild->ID=:myId AND 
				       Sprache=:Sprache) 
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStreamBild">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE SPListeBild->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.SPListeBild = ##Class(DBProduktQS.SPListe).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListeBild->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="GetStreamBildObject">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>DBProduktQS.DokumentStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(DBProduktQS.DokumentStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListePDF->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPListePDF->ID=:myId AND 
				       Sprache=:Sprache)
			Set tmpStream=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		} 
		
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="OutputStreamPDF">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListePDF->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPListePDF->ID=:myId AND 
				       Sprache=:Sprache) 
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStreamPDF">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE SPListePDF->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.SPListePDF = ##Class(DBProduktQS.SPListe).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListePDF->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="GetStreamPDFObject">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>DBProduktQS.DokumentStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(DBProduktQS.DokumentStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPListePDF->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPListePDF->ID=:myId AND 
				       Sprache=:Sprache)
			Set tmpStream=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		} 
		
	Quit tmpStream
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBProduktQS.SPMaske">
<Super>DBProduktQS.SubProgramm</Super>
<TimeChanged>61548,53507.872196</TimeChanged>
<TimeCreated>61538,35503.133331</TimeCreated>

<Property name="File">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>SPMaske</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Bild">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>SPMaskeBild</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputStream">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPMaske->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPMaske->ID=:myId AND 
				       Sprache=:Sprache)
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE SPMaske->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.SPMaske = ##Class(DBProduktQS.SPMaske).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPMaske->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="OutputStreamBild">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPMaskeBild->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPMaskeBild->ID=:myId AND 
				       Sprache=:Sprache) 
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStreamBild">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE SPMaskeBild->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.SPMaskeBild = ##Class(DBProduktQS.SPMaske).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPMaskeBild->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	w "DBProduktQS.SPMaske.%OnDelete",!
	set maskeOid = $lg(oid,1)
	d ##class(DBProduktQS.SubProgramm).DeleteRelations(maskeOid)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPMaske = :maskeOid)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPMaskeBild = :maskeOid)
	set maske = ""	
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	d ##class(DBProduktQS.SubProgramm).DeleteRelations(myId)
	w "ID: "_myId,!
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPMaske = :myId)
	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPMaskeBild = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Method name="GetStreamObject">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>DBProduktQS.DokumentStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(DBProduktQS.DokumentStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPMaske->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPMaske->ID=:myId AND 
				       Sprache=:Sprache)
			Set tmpStream=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		}
		
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="GetStreamBildObject">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>DBProduktQS.DokumentStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(DBProduktQS.DokumentStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPMaskeBild->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPMaskeBild->ID=:myId AND 
				       Sprache=:Sprache)
			Set tmpStream=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		} 
		
	Quit tmpStream
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>SPMaskeDefaultData</DefaultData>
<Data name="SPMaskeDefaultData">
<Structure>listnode</Structure>
<Subscript>"SPMaske"</Subscript>
<Value name="1">
<Value>Sprache</Value>
</Value>
<Value name="2">
<Value>DateiName</Value>
</Value>
<Value name="3">
<Value>DateiEndung</Value>
</Value>
<Value name="4">
<Value>File</Value>
</Value>
<Value name="5">
<Value>Bild</Value>
</Value>
<Value name="6">
<Value>BildDateiEndung</Value>
</Value>
<Value name="7">
<Value>DokumentTyp</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBProduktQS.SubProgramm">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57286.687138</TimeChanged>
<TimeCreated>61534,32588.109674</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AktMandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKAktMandant">
<Properties>AktMandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Property name="Applikation">
<Type>DBProduktQS.SD.Applikation</Type>
<Cardinality>one</Cardinality>
<Inverse>SubProgramm</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="ApplikationIndex">
<Properties>Applikation</Properties>
</Index>

<Property name="Status">
<Type>DBProduktQS.SD.BearbStatus</Type>
<Cardinality>one</Cardinality>
<Inverse>SubProgramm</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="StatusIndex">
<Properties>Status</Properties>
</Index>

<Property name="ProgTyp">
<Type>DBProduktQS.SD.ProgTyp</Type>
<Cardinality>one</Cardinality>
<Inverse>SubProgramm</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="ProgTypIndex">
<Properties>ProgTyp</Properties>
</Index>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBProduktQS.SubProgramm).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBProduktQS.SubProgramm)
	Quit +nr +1
]]></Implementation>
</Method>

<Property name="ClassName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="1024"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="TransLang">
<Type>%Boolean</Type>
<Collection>array</Collection>
</Property>

<Property name="HelpLang">
<Type>%Boolean</Type>
<Collection>array</Collection>
</Property>

<Property name="Technik">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="32000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="SetTechnik">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Technik, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetTechnik">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Technik, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetTechnikClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBProduktQS.SubProgramm).%OpenId(myID)
		set text = rs.GetTechnik(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="GetStatusTransLang">
<FormalSpec>Lang:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set retval = 0
	if (..TransLang '= "") {
		Set retval = ..TransLang.GetAt(Lang)
	}	
	Quit retval
]]></Implementation>
</Method>

<Method name="SetStatusTransLang">
<FormalSpec>Lang:%String,OK:%Boolean</FormalSpec>
<Implementation><![CDATA[	do ..TransLang.SetAt(OK, Lang)
]]></Implementation>
</Method>

<Method name="GetStatusHelpLang">
<FormalSpec>Lang:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set retval = 0
	if (..HelpLang '= "") {
		Set retval = ..HelpLang.GetAt(Lang)
	}	
	Quit retval
]]></Implementation>
</Method>

<Method name="SetStatusHelpLang">
<FormalSpec>Lang:%String,OK:%Boolean</FormalSpec>
<Implementation><![CDATA[	do ..HelpLang.SetAt(OK, Lang)
]]></Implementation>
</Method>

<Method name="GetStatusLang">
<FormalSpec>Lang:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set retval = 0
	if (..TransLang '= "") {
		Set retval = ..TransLang.GetAt(Lang)
	}	
	if ((..HelpLang '= "") & retval) {
		Set retval = ..HelpLang.GetAt(Lang)
	}
	Quit retval
]]></Implementation>
</Method>

<Property name="TabAdresse">
<Type>%String</Type>
<Parameter name="MAXLEN" value="1024"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Kunde">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>SubProgramm</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="LetzteAenderung">
<Type>%TimeStamp</Type>
</Property>

<Property name="LetzterBenutzer">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Beschrieb">
<Type>DBProduktQS.DokumentStream</Type>
<Cardinality>many</Cardinality>
<Inverse>SPBeschrieb</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputBeschrieb">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPBeschrieb->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPBeschrieb->ID=:myId AND 
				       Sprache=:Sprache)
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="GetBeschriebClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myId:%String,Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPBeschrieb->ID=:myId AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBProduktQS.DokumentStream  
				 WHERE SPBeschrieb->ID=:myId AND 
				       Sprache=:Sprache)
			Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputBeschrieb">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBProduktQS.DokumentStream
		     WHERE SPBeschrieb->ID=:myId AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBProduktQS.DokumentStream).%New()
			Set n.Sprache = Sprache
			Set n.SPBeschrieb = ##Class(DBProduktQS.SubProgramm).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBProduktQS.DokumentStream 
		     WHERE SPBeschrieb->ID=:myId AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBProduktQS.DokumentStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set feldOid = $lg(oid,1)
	d ##class(DBProduktQS.SubProgramm).DeleteRelations(feldOid)		
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code>	set myId = {ID*O}
	d ##class(DBProduktQS.SubProgramm).DeleteRelations(myId)</Code>
<Event>DELETE</Event>
</Trigger>

<Method name="DeleteRelations">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<Implementation><![CDATA[	&sql(DELETE FROM DBProduktQS.DokumentStream WHERE SPBeschrieb = :oid)
]]></Implementation>
</Method>

<Method name="GetFirstId">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT TOP 1 ID INTO :oid FROM DBProduktQS.SubProgramm WHERE AktMandant = :MandantOid ORDER BY Applikation, ProgTyp, Nummer	)
	quit oid
]]></Implementation>
</Method>

<Property name="FehlerReport">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>SubProgramm</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="IsAllowedTyp">
<ClassMethod>1</ClassMethod>
<FormalSpec>ViewTypen:%String,AktTyp:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set ViewTypenList = $LISTFROMSTRING(ViewTypen,";")
	if ($LISTFIND(ViewTypenList,AktTyp) > 0) {
		quit 1	
	} else {
		quit 0
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBProduktQS.SubProgrammD</DataLocation>
<DefaultData>SubProgrammDefaultData</DefaultData>
<IdLocation>^DBProduktQS.SubProgrammD</IdLocation>
<IndexLocation>^DBProduktQS.SubProgrammI</IndexLocation>
<StreamLocation>^DBProduktQS.SubProgrammS</StreamLocation>
<Data name="Beschreibung">
<Attribute>Beschreibung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Beschreibung"</Subscript>
</Data>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="HelpLang">
<Attribute>HelpLang</Attribute>
<Structure>subnode</Structure>
<Subscript>"HelpLang"</Subscript>
</Data>
<Data name="SubProgrammDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
<Value name="4">
<Value>Applikation</Value>
</Value>
<Value name="5">
<Value>ProgFunktion</Value>
</Value>
<Value name="6">
<Value>Status</Value>
</Value>
<Value name="7">
<Value>ProgTyp</Value>
</Value>
<Value name="8">
<Value>ClassName</Value>
</Value>
<Value name="9">
<Value>TabAdresse</Value>
</Value>
<Value name="10">
<Value>Kunde</Value>
</Value>
<Value name="11">
<Value>LetzteAenderung</Value>
</Value>
<Value name="12">
<Value>LetzterBenutzer</Value>
</Value>
</Data>
<Data name="Technik">
<Attribute>Technik</Attribute>
<Structure>subnode</Structure>
<Subscript>"Technik"</Subscript>
</Data>
<Data name="TransLang">
<Attribute>TransLang</Attribute>
<Structure>subnode</Structure>
<Subscript>"TransLang"</Subscript>
</Data>
<Property name="AktMandant"/>
<Property name="Applikation"/>
<Property name="ClassName"/>
<Property name="Kunde"/>
<Property name="LetzteAenderung"/>
<Property name="LetzterBenutzer"/>
<Property name="Nummer"/>
<Property name="ProgFunktion"/>
<Property name="ProgTyp"/>
<Property name="Status"/>
<Property name="TabAdresse"/>
</Storage>
</Class>
</Export>
