home *** CD-ROM | disk | FTP | other *** search
Text File | 2004-09-08 | 439.9 KB | 11,824 lines |
- *** WARNING *** DO NOT MODIFY THIS FILE IN ANY WAY! *** WARNING ***
-
- **__RI_HEADER!@ Do NOT REMOVE or MODIFY this line!!!! @!__RI_HEADER**
- procedure RIDELETE
- ** verze = 8.04a
- local llRetVal
- llRetVal=.t.
- IF (ISRLOCKED() and !deleted()) OR !RLOCK()
- llRetVal=.F.
- ELSE
- IF !deleted()
- DELETE
- IF CURSORGETPROP('BUFFERING') > 1
- =TABLEUPDATE()
- ENDIF
- llRetVal=pnerror=0
- ENDIF not already deleted
- ENDIF
- UNLOCK RECORD (RECNO())
- RETURN llRetVal
-
- procedure rierror
- parameters tnErrNo,tcMessage,tcCode,tcProgram
- local lnErrorRows,lnXX
- lnErrorRows=alen(gaErrors,1)
- if type('gaErrors[lnErrorRows,1]')<>"L"
- dimension gaErrors[lnErrorRows+1,alen(gaErrors,2)]
- lnErrorRows=lnErrorRows+1
- endif
- gaErrors[lnErrorRows,1]=tnErrNo
- gaErrors[lnErrorRows,2]=tcMessage
- gaErrors[lnErrorRows,3]=tcCode
- gaErrors[lnErrorRows,4]=""
- lnXX=1
- do while !empty(program(lnXX))
- gaErrors[lnErrorRows,4]=gaErrors[lnErrorRows,4]+","+;
- program(lnXX)
- lnXX=lnXX+1
- enddo
- gaErrors[lnErrorRows,5]=pcParentDBF
- gaErrors[lnErrorRows,6]=pnParentRec
- gaErrors[lnErrorRows,7]=pcParentID
- gaErrors[lnErrorRows,8]=pcParentExpr
- gaErrors[lnErrorRows,9]=pcChildDBF
- gaErrors[lnErrorRows,10]=pnChildRec
- gaErrors[lnErrorRows,11]=pcChildID
- gaErrors[lnErrorRows,12]=pcChildExpr
- return tnErrNo
-
- PROCEDURE riend
- PARAMETERS tlSuccess
- local lnXX,lnSpot,lcWorkArea
- IF tlSuccess
- END TRANSACTION
- ELSE
- SET DELETED OFF
- ROLLBACK
- SET DELETED ON
- ENDIF
- IF EMPTY(pcRIolderror)
- ON ERROR
- ELSE
- ON ERROR &pcRIolderror.
- ENDIF
- FOR lnXX=1 TO occurs("*",pcRIcursors)
- lnSpot=atc("*",pcRIcursors,lnXX)+1
- USE IN (VAL(substr(pcRIcursors,lnSpot,5)))
- ENDFOR
- IF pcOldCompat = "ON"
- SET COMPATIBLE ON
- ENDIF
- IF pcOldDele="OFF"
- SET DELETED OFF
- ENDIF
- IF pcOldExact="ON"
- SET EXACT ON
- ENDIF
- IF pcOldTalk="ON"
- SET TALK ON
- ENDIF
- do case
- case empty(pcOldDBC)
- set data to
- case pcOldDBC<>DBC()
- set data to (pcOldDBC)
- endcase
- RETURN .T.
-
-
- PROCEDURE rireuse
- * rireuse.prg
- PARAMETERS tcTableName,tcWkArea
- pcRIcursors = strtran(pcRIcursors,upper(tcTableName)+"?"+str(tcWkArea,5),;
- upper(tcTableName)+"*"+str(tcWkArea,5))
- RETURN .t.
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_hpou
- ** "Referential integrity update trigger for" cis_hpou
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR POUZITI=lcOldParentID
- pnChildRec=recno()
- pcChildID=POUZITI
- pcChildExpr="POUZITI"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("POUZITI",lcParentID,"CIS_HPOU")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmenu promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR POUZITI=lcOldParentID
- pnChildRec=recno()
- pcChildID=POUZITI
- pcChildExpr="POUZITI"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("POUZITI",lcParentID,"CIS_HPOU")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_hpou
- ********************************************************************************
- procedure __RI_UPDATE_POZADAV
- ** "Referential integrity update trigger for" pozadav
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("pozarekl")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"POZADAV")
- ENDSCAN get all of the pozarekl records
- =rireuse("pozarekl",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" pozadav
- ********************************************************************************
- procedure __RI_UPDATE_cis_hzna
- ** "Referential integrity update trigger for" cis_hzna
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ZNACKA=lcOldParentID
- pnChildRec=recno()
- pcChildID=ZNACKA
- pcChildExpr="ZNACKA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ZNACKA",lcParentID,"CIS_HZNA")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmenu promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ZNACKA=lcOldParentID
- pnChildRec=recno()
- pcChildID=ZNACKA
- pcChildExpr="ZNACKA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ZNACKA",lcParentID,"CIS_HZNA")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_hzna
- ********************************************************************************
- ********************************************************************************
- procedure __RI_UPDATE_sw_sablo
- ** "Referential integrity update trigger for" sw_sablo
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("sw_sabsw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR nazev=lcOldParentID
- pnChildRec=recno()
- pcChildID=NAZEV
- pcChildExpr="NAZEV"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV",lcParentID,"SW_SABLO")
- ENDSCAN get all of the SW_SABLO records
- =rireuse("SW_SABLO",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
-
-
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" SW_SABLO
- ********************************************************************************
- ********************************************************************************
- procedure __RI_UPDATE_cis_orga
- ** "Referential integrity update trigger for" cis_orga
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- LOCAL lcOldNazev, lcNazev
- *** zmena cisla
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID = OLDVAL("CISLO")
- lcOldNazev = OLDVAL("NAZEV")
- lcOldParentIDNazev = Cislo + OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID = CISLO
- lcNazev = NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("dokument")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the dokument records
- =rireuse("dokument",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pozadav")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the pozadav records
- =rireuse("pozadav",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("soft_pri")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the soft_pri records
- =rireuse("soft_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("cis_osob")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=ORG_CS
- pcChildExpr="ORG_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_CS",lcParentID,"CIS_ORGA")
- ENDSCAN get all of the cis_osob records
- =rireuse("cis_osob",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
-
- *** zmena nazvu
- SELECT (lcParentWkArea)
- pcParentID = lcParentId + lcOldNazev
- pcParentExpr = "NAZEV"
-
- IF !(lcNazev == lcOldNazev)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Org_Cs + Org_Nazev = lcParentID + lcOldNazev
- pnChildRec = recno()
- pcChildID = ORG_Nazev
- pcChildExpr = "ORG_Nazev"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_Nazev",lcNazev,"CIS_ORGA")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR ORG_CS + Org_Nazev = lcParentID + lcOldNazev
- pnChildRec=recno()
- pcChildID=ORG_Nazev
- pcChildExpr="ORG_Nazev"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ORG_Nazev",lcNazev,"CIS_ORGA")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
-
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_orga
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_oshw
- ** "Referential integrity update trigger for" cis_oshw
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR OS=lcOldParentID
- pnChildRec=recno()
- pcChildID=OS
- pcChildExpr="OS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OS",lcParentID,"CIS_OSHW")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR OS=lcOldParentID
- pnChildRec=recno()
- pcChildID=OS
- pcChildExpr="OS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OS",lcParentID,"CIS_OSHW")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_oshw
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_osob
- ** "Referential integrity update trigger for" cis_osob
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- LOCAL lcIdCisloParent && SOB 24.2.2004 hodnota pro v²b∞r v∞t pro p°epsßnφ zm∞n∞nΘ OSOBA
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("OSOBA")
- pcParentID=lcOldParentID
- pcParentExpr="OSOBA"
- lcParentID=OSOBA
- lcIdCisloParent = IDCISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDSPRAVCE=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=SPRAVCE
- pcChildExpr="SPRAVCE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SPRAVCE",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet (osoba)
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet (spravce)
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDSPRAVCE=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=SPRAVCE
- pcChildExpr="SPRAVCE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SPRAVCE",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("software")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("dokument")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the dokument records
- =rireuse("dokument",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("dokument")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDZAPUJCIL=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA_ZAP
- pcChildExpr="OSOBA_ZAP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA_ZAP",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the dokument records
- =rireuse("dokument",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDSPRAVCE=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=SPRAVCE
- pcChildExpr="SPRAVCE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SPRAVCE",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet (osoba)
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet (spravce)
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDSPRAVCE=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=SPRAVCE
- pcChildExpr="SPRAVCE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SPRAVCE",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pozadav")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDZADATEL=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=ZADATEL
- pcChildExpr="ZADATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("ZADATEL",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the pozadav records
- =rireuse("pozadav",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pozadav")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDRESITEL=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=RESITEL
- pcChildExpr="RESITEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("RESITEL",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the pozadav records
- =rireuse("pozadav",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
-
- lcChildWkArea=riopen("soft_pri")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the soft_pri records
- =rireuse("soft_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sit_hesl")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the sit_hesl records
- =rireuse("sit_hesl",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("apli_pri")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("apli_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_hw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("opr_hw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_sw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("opr_sw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_pr")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("opr_pr",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_pl")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("opr_pl",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_pv")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("opr_pv",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_ln")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR IDOSOBA=lcIdCisloParent
- pnChildRec=recno()
- pcChildID=OSOBA
- pcChildExpr="OSOBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OSOBA",lcParentID,"CIS_OSOB")
- ENDSCAN get all of the site records
- =rireuse("opr_ln",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_osob
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_ossw
- ** "Referential integrity update trigger for" cis_ossw
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("software")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SW_SYS=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_SYS
- pcChildExpr="SW_SYS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_SYS",lcParentID,"CIS_OSSW")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SW_SYS=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_SYS
- pcChildExpr="SW_SYS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_SYS",lcParentID,"CIS_OSSW")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_ossw
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_umis
- ** "Referential integrity update trigger for" cis_umis
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("dokument")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the dokument records
- =rireuse("dokument",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pozadav")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the pozadav records
- =rireuse("pozadav",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("soft_pri")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the soft_pri records
- =rireuse("soft_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("cis_osob")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR MISTO_CS=lcOldParentID
- pnChildRec=recno()
- pcChildID=MISTO_CS
- pcChildExpr="MISTO_CS"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("MISTO_CS",lcParentID,"CIS_UMIS")
- ENDSCAN get all of the cis_osob records
- =rireuse("cis_osob",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_umis
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_vyr
- ** "Referential integrity update trigger for" cis_vyr
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("cis_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VYROBCE=lcOldParentID
- pnChildRec=recno()
- pcChildID=VYROBCE
- pcChildExpr="VYROBCE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VYROBCE",lcParentID,"CIS_VYR")
- ENDSCAN get all of the cis_soft records
- =rireuse("cis_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_vyr
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_dokument
- ** "Referential integrity update trigger for" dokument
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_hw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"DOKUMENT")
- ENDSCAN get all of the dok_hw records
- =rireuse("dok_hw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_sw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"DOKUMENT")
- ENDSCAN get all of the dok_sw records
- =rireuse("dok_sw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_pr")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"DOKUMENT")
- ENDSCAN get all of the dok_pr records
- =rireuse("dok_pr",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- lcChildWkArea=riopen("dok_prl")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"DOKUMENT")
- ENDSCAN get all of the dok_prll records
- =rireuse("dok_pr",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- lcChildWkArea=riopen("dok_prv")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"DOKUMENT")
- ENDSCAN get all of the dok_prv records
- =rireuse("dok_prv",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_ln")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"DOKUMENT")
- ENDSCAN get all of the dok_ln records
- =rireuse("dok_ln",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" dokument
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_firmy
- ** "Referential integrity update trigger for" firmy
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny provest i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("software")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("licence")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the licence records
- =rireuse("licence",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("dokument")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the dokument records
- =rireuse("dokument",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pozadav")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL
- pcChildExpr="DODAVATEL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("DODAVATEL",lcParentID,"FIRMY")
- ENDSCAN get all of the pozadav records
- =rireuse("pozadav",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_hw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL+CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL+CISLO
- pcChildExpr="DODAVATEL+CISLO"
- llRetVal=riupdate("DODAVATEL",substr(lcParentID,1,30),"firmy")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the opr_hw records
- =rireuse("opr_hw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_sw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL+CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL+CISLO
- pcChildExpr="DODAVATEL+CISLO"
- llRetVal=riupdate("DODAVATEL",substr(lcParentID,1,30),"firmy")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the opr_sw records
- =rireuse("opr_sw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_pr")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL+CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL+CISLO
- pcChildExpr="DODAVATEL+CISLO"
- llRetVal=riupdate("DODAVATEL",substr(lcParentID,1,30),"firmy")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the opr_pr records
- =rireuse("opr_pr",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_pl")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL+CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL+CISLO
- pcChildExpr="DODAVATEL+CISLO"
- llRetVal=riupdate("DODAVATEL",substr(lcParentID,1,30),"firmy")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the opr_pl records
- =rireuse("opr_pl",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_pv")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL+CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL+CISLO
- pcChildExpr="DODAVATEL+CISLO"
- llRetVal=riupdate("DODAVATEL",substr(lcParentID,1,30),"firmy")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the opr_pv records
- =rireuse("opr_pv",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_ln")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR DODAVATEL+CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=DODAVATEL+CISLO
- pcChildExpr="DODAVATEL+CISLO"
- llRetVal=riupdate("DODAVATEL",substr(lcParentID,1,30),"firmy")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the opr_ln records
- =rireuse("opr_ln",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" firmy
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_prisluse
- ** "Referential integrity update trigger for" prisluse
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_pr")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VAZBA=lcOldParentID
- pnChildRec=recno()
- pcChildID=VAZBA
- pcChildExpr="VAZBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VAZBA",lcParentID,"PRISLUSE")
- ENDSCAN get all of the dok_pr records
- =rireuse("dok_pr",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("opr_pr")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"PRISLUSE")
- ENDSCAN get all of the opr_pr records
- =rireuse("opr_pr",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- lcChildWkArea=riopen("DOKUSCAN") && zmena v DOKUSCAN
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID AND DRUH == "P "
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"PRISLUSE")
- ENDSCAN get all of the dokuscan records
- =rireuse("DOKUSCAN",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" prisluse
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_site
- ** "Referential integrity update trigger for" site
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_ln")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VAZBA=lcOldParentID
- pnChildRec=recno()
- pcChildID=VAZBA
- pcChildExpr="VAZBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VAZBA",lcParentID,"SITE")
- ENDSCAN get all of the dok_ln records
- =rireuse("dok_ln",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_ln")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"SITE")
- ENDSCAN get all of the opr_ln records
- =rireuse("opr_ln",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SITE = lcOldParentID
- pnChildRec=recno()
- pcChildID=SITE+CISLO
- pcChildExpr="SITE+CISLO"
- llRetVal=riupdate("SITE",lcParentID,"site")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny provest i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SITE = lcOldParentID
- pnChildRec=recno()
- pcChildID=SITE+CISLO
- pcChildExpr="SITE+CISLO"
- llRetVal=riupdate("SITE",lcParentID,"site")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SITE = lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- llRetVal=riupdate("SITE",lcParentID,"site")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SITE = lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- llRetVal=riupdate("SITE",lcParentID,"site")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SITE = lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- llRetVal=riupdate("SITE",lcParentID,"site")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SITE = lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- llRetVal=riupdate("SITE",lcParentID,"site")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sit_hesl")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SIT=lcOldParentID
- pnChildRec=recno()
- pcChildID=SIT+OSOBA
- pcChildExpr="SIT+OSOBA"
- llRetVal=riupdate("SIT",lcParentID,"site")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the sit_hesl records
- =rireuse("sit_hesl",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("DOKUSCAN") && zmena v DOKUSCAN
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID AND DRUH = "L "
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"SITE")
- ENDSCAN get all of the dokuscan records
- =rireuse("DOKUSCAN",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" site
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_software
- ** "Referential integrity update trigger for" software
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_sw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VAZBA=lcOldParentID
- pnChildRec=recno()
- pcChildID=VAZBA
- pcChildExpr="VAZBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VAZBA",lcParentID,"SOFTWARE")
- ENDSCAN get all of the dok_sw records
- =rireuse("dok_sw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("opr_sw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"SOFTWARE")
- ENDSCAN get all of the opr_sw records
- =rireuse("opr_sw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("soft_pri")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR SOFTWARE+CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=SOFTWARE+CISLO
- pcChildExpr="SOFTWARE+CISLO"
- llRetVal=riupdate("SOFTWARE",substr(lcParentID,1,8),"software")
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- ENDSCAN get all of the soft_pri records
- =rireuse("soft_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- *** zmena cislo v LICENCE
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("licence")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"SOFTWARE")
- ENDSCAN get all of the licence records
- =rireuse("licence",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- *** zmena cislo v UPGRADE
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("upgrade") && Cislo v UPGRADE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"SOFTWARE")
- ENDSCAN get all of the upgrade records
- =rireuse("upgrade",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("upg_kusy") && Cislo v UPG_KUSY
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"SOFTWARE")
- ENDSCAN get all of the upg_kusy records
-
- SCAN FOR CISLO=lcOldParentID && PuvCislo v UPG_KUSY
- pnChildRec=recno()
- pcChildID=PUVCISLO
- pcChildExpr="PUVCISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("PUVCISLO",lcParentID,"SOFTWARE")
- ENDSCAN get all of the upg_kusy records
-
- =rireuse("upg_kusy",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("DOKUSCAN") && zmena v DOKUSCAN
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID AND DRUH = "S "
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"SOFTWARE")
- ENDSCAN get all of the dokuscan records
- =rireuse("DOKUSCAN",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- *** zm∞ny v souborech SW-SCANu
- IF TYPE("lSwScan") <> "U"
- *** zmena cislo v SW_LICSW
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("SW_LICSW")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CisloLic=lcOldParentID
- pnChildRec=recno()
- pcChildID=CisloLic
- pcChildExpr="CISLOLIC"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLOLIC",lcParentID,"SOFTWARE")
- ENDSCAN get all of the SW_LICSW records
- =rireuse("SW_LICSW",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- *** zmena cislo v SW_SOUB
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("sw_soub")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CisloLic=lcOldParentID
- pnChildRec=recno()
- pcChildID=CisloLic
- pcChildExpr="CISLOLIC"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLOLIC",lcParentID,"SOFTWARE")
- ENDSCAN get all of the sw_soub records
- =rireuse("sw_soub",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- *** zmena cislo v SW_SABSW
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("sw_sabsw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR software=lcOldParentID
- pnChildRec=recno()
- pcChildID=software
- pcChildExpr="software"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("software",lcParentID,"SOFTWARE")
- ENDSCAN get all of the sw_sabsw records
- =rireuse("sw_sabsw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- ENDIF
- *** konec vÜech zm∞n
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" software
- ********************************************************************************
-
- ********************************************************************************
- PROCEDURE RIUPDATE
- lparameters tcFieldName,tcNewValue, tcPar
-
- local llRetVal, lnStart, lnPocet, lnKonec, xx, lcJmenoPole, lnPozice, lnDelka
- llRetVal=.t.
- IF ISRLOCKED() OR !RLOCK()
- llRetVal=.F.
- ELSE
- IF !(EVALUATE(tcFieldName)==tcNewValue)
- lnPocet = OCCURS("+",tcFieldName)+1
- IF lnPocet = 1
- REPLACE (tcFieldName) WITH tcNewValue
- ELSE
- lnStart = 1
- lnPOzice = 1
- FOR xx = 1 TO lnPocet
- lnKonec = AT("+",tcFieldName,xx)
- lnKonec = IIF(lnKonec=0,LEN(tcFieldName)+1,lnKonec)
- lcJmenoPole = SUBSTR(tcFieldName, lnStart, lnKonec-lnStart)
- lnDelka = LEN(EVAL(lcJmenoPole))
- REPLACE (lcJmenoPole) WITH SUBSTR(tcNewValue, lnPozice, lnDelka)
- lnStart = lnStart + lnKonec
- lnPozice = lnPozice + lnDelka
- ENDFOR
- ENDIF
- IF CURSORGETPROP('BUFFERING') > 1
- =TABLEUPDATE()
- ENDIF
- llRetVal=pnerror=0
- ENDIF values don't already match
- ENDIF it's locked already, or I was able to lock it
- UNLOCK RECORD (RECNO())
- return llRetVal
- **********************************************************************************************
-
- **********************************************************************************************
- PROCEDURE riopen
- PARAMETERS tcTable,tcOrder
- local lcCurWkArea,lcNewWkArea,lnInUseSpot, lcPomPath
- lnInUseSpot=atc(tcTable+"*",pcRIcursors)
-
- lcPomPath = SYS(5) + SYS(2003)
- IF lnInUseSpot=0
- IF TYPE("cUniv") == "U"
- cUniv = ""
- ENDIF
- DO CASE
- CASE cUniv = "KSPRAVCE"
- IF INLIST(tcTable,"SK_HW", "SK_PR", "SK_SW", "SK_FIRMY", "SK_OPRAV", "SK_ORGA",;
- "CIS_PROJ", "OBJEDNAV", "PR_PRI", "SK_SETUP", "SW_PRI", "VZOR_HW", "VZOR_PR",;
- "VZOR_SPR", "VZOR_SW", "SK_OPRHW", "SK_OPRPR")
- lcPomPath = PathSklad
- ENDIF
- OTHERWISE
- lcPomPath = Path
- ENDCASE
- lcCurWkArea=select()
- SELECT 0
- lcNewWkArea=select()
- IF NOT EMPTY(tcOrder)
- USE '&lcPomPath\&tcTable' AGAIN ORDER (tcOrder) ;
- ALIAS ("__ri"+LTRIM(STR(SELECT()))) share
- ELSE
- USE '&lcPomPath\&tcTable' AGAIN ALIAS ("__ri"+LTRIM(STR(SELECT()))) share
- ENDIF
- if pnerror=0
- pcRIcursors=pcRIcursors+upper(tcTable)+"?"+STR(SELECT(),5)
- else
- lcNewWkArea=0
- endif something bad happened while attempting to open the file
- ELSE
- lcNewWkArea=val(substr(pcRIcursors,lnInUseSpot+len(tcTable)+1,5))
- pcRIcursors = strtran(pcRIcursors,upper(tcTable)+"*"+str(lcNewWkArea,5),;
- upper(tcTable)+"?"+str(lcNewWkArea,5))
- IF NOT EMPTY(tcOrder)
- SET ORDER TO (tcOrder) IN (lcNewWkArea)
- ENDIF sent an order
- if pnerror<>0
- lcNewWkArea=0
- endif something bad happened while setting order
- ENDIF
- RETURN (lcNewWkArea)
- **********************************************************************************************
-
- **********************************************************************************************
- procedure __RI_UPDATE_cis_ptyp
- ** "Referential integrity update trigger for" cis_ptyp
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- LOCAL lcNazev, lcOldNazev
-
- *** zmena cisla typu
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID = OLDVAL("CISLO")
- lcOldNazev = OLDVAL("NAZEV")
- pcParentID = lcOldParentID
- pcParentExpr = "CISLO"
- lcParentID = CISLO
- lcNazev = NAZEV
-
- LOCAL lcAlias1, lcAlias2
- DO CASE
- CASE INLIST(LEFT(lcOldParentId,1), "K", "O")
- lcAlias1 = "prisluse"
- lcAlias2 = "lik_pris"
- CASE INLIST(LEFT(lcOldParentId, 1), "S", "L")
- lcAlias1 = "pris_lan"
- lcAlias2 = "lik_plan"
- CASE INLIST(LEFT(lcOldParentId, 1), "D", "V")
- lcAlias1 = "pris_vol"
- lcAlias2 = "lik_pvol"
- ENDCASE
-
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen(lcAlias1)
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP
- pcChildExpr="TYP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP",lcParentID,"CIS_PTYP")
- ENDSCAN get all of the prisluse records
- =rireuse(lcAlias1,lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny provest i do zlikvidovanych vet
- lcChildWkArea=riopen(lcAlias2)
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP
- pcChildExpr="TYP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP",lcParentID,"CIS_PTYP")
- ENDSCAN get all of the lik_pris records
- =rireuse(lcAlias2,lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("cis_pob1")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP
- pcChildExpr="TYP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP",lcParentID,"CIS_PTYP")
- ENDSCAN get all of the cis_pob1 records
- =rireuse("cis_pob1",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("cis_pob2")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP
- pcChildExpr="TYP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP",lcParentID,"CIS_PTYP")
- ENDSCAN get all of the cis_pob2 records
- =rireuse("cis_pob2",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("cis_pnaz")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP
- pcChildExpr="TYP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP",lcParentID,"CIS_PTYP")
- ENDSCAN get all of the cis_pnaz records
- =rireuse("cis_pnaz",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
-
- *** zmena nazvu
- SELECT (lcParentWkArea)
- pcParentID = lcParentId + lcOldNazev
- pcParentExpr = "NAZEV"
-
- IF !(lcNazev == lcOldNazev)
- lcChildWkArea=riopen(lcAlias1)
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Typ + TypNaz = lcParentID + lcOldNazev
- pnChildRec = recno()
- pcChildID = TypNaz
- pcChildExpr = "Typ_Naz"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TypNaz",lcNazev,"CIS_PTYP")
- ENDSCAN get all of the hardware records
- =rireuse(lcAlias1,lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen(lcAlias2)
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Typ + TypNaz = lcParentID + lcOldNazev
- pnChildRec=recno()
- pcChildID=TypNaz
- pcChildExpr="TypNaz"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TypNaz",lcNazev,"CIS_PTYP")
- ENDSCAN get all of the lik_hard records
- =rireuse(lcAlias2,lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
-
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_ptyp
- ********************************************************************************
-
- PROCEDURE __RI_UPDATE_CIS_OBLA
-
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- **------ ZMENA NAZVU oblast a podoblasti
- lcOldParentID=OLDVAL("NAZEV")+OLDVAL("PODOBLAST")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV+PODOBLAST"
- lcParentID=NAZEV+PODOBLAST
- IF !(lcParentID==lcOldParentID) && pokud se zm∞nφ nazev oblasti nebo podoblast
- lcChildWkArea=riopen("cis_soft") && 1) zm∞nit v CIS_SOFT
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR OBLAST+PODOBLAST=lcOldParentID
- pnChildRec=recno()
- pcChildID=OBLAST+PODOBLAST
- pcChildExpr="OBLAST+PODOBLAST"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OBLAST+PODOBLAST",lcParentID,"OBLAST+PODOBLAST")
- ENDSCAN get all of the soft_pri records
- =rireuse("cis_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- **********************************************************************************************
-
- PROCEDURE __RI_UPDATE_CIS_SOFT
-
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- **------ ZMENA NAZVU A VERZE software
- lcOldParentID = OLDVAL("NAZEV")+OLDVAL("VERZE")
- OldNazev = ALLTRIM(OLDVAL("NAZEV"))+" "+OLDVAL("VERZE")
- pcParentID = lcOldParentID
- pcParentExpr = "NAZEV+VERZE"
- lcParentID = NAZEV+VERZE
- cNewNazev = ALLTRIM(NAZEV)+" "+VERZE
- IF !(lcParentID==lcOldParentID) && pokud se zm∞nφ nazev oblasti nebo podoblast
- lcChildWkArea=riopen("software") && 1) zm∞nit v SOFTWARE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
-
- SCAN FOR NAZEV+VERZE=lcOldParentID
- pnChildRec=recno()
- pcChildID=NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the software records
-
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE=lcOldParentID
- pnChildRec=recno()
- pcChildID=NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("soft_pri") &&
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sof_Nazev+Verze = lcOldParentId
- pnChildRec = recno()
- pcChildID = Sof_Nazev+Verze
- pcChildExpr="Sof_Nazev+Verze"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("Sof_Nazev+Verze",lcParentID,"Sof_Nazev+Verze")
- ENDSCAN get all of the software records
- =rireuse("soft_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("dok_sw") && 1) zm∞nit nazev v dok_sw
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VAZBANAZEV = OldNazev
- pnChildRec = recno()
- pcChildID = VAZBANAZEV
- pcChildExpr="VAZBANAZEV"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VAZBANAZEV",cNewNazev,"VAZBANAZEV")
- ENDSCAN get all of the software records
- =rireuse("dok_sw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- IF TYPE("lSwScan") <> "U"
- IF lSwScan
- *** SW_LIST
- lcChildWkArea=riopen("sw_list") && 1) zm∞nit v SW_LIST
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_list records
- =rireuse("sw_list",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** SW_NALEZ
- lcChildWkArea=riopen("sw_nalez") && 1) zm∞nit v SW_NALEZ
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_nalez records
- =rireuse("sw_nalez",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- *** SW_BEZLI
- lcChildWkArea=riopen("sw_bezli") && 1) zm∞nit v SW_BEZLI
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_bezli records
- =rireuse("sw_bezli",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- *** SW_LICSW
- lcChildWkArea=riopen("SW_LICSW") && 1) zm∞nit v SW_LICSW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the SW_LICSW records
- =rireuse("SW_LICSW",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- *** SW_SOUB
- lcChildWkArea=riopen("sw_soub") && 1) zm∞nit v SW_SOUB
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_soub records
- =rireuse("sw_soub",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- *** SW_PORSW
- lcChildWkArea=riopen("sw_porsw") && 1) zm∞nit v SW_PORSW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_porsw records
- =rireuse("sw_porsw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- *** SW_CISSW
- lcChildWkArea=riopen("SW_CISSW") && 1) zm∞nit v SW_CISSW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_cissw records
- =rireuse("SW_CISSW",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- *** SW_NEVED
- lcChildWkArea=riopen("sw_neved") && 1) zm∞nit v SW_NEVED
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_neved records
- =rireuse("sw_neved",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- *** SW_NSOUB
- lcChildWkArea=riopen("sw_nsoub") && 1) zm∞nit v SW_NSOUB
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_nsoub records
- =rireuse("sw_nsoub",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- *** SW_BALIK
- lcChildWkArea=riopen("sw_balik") && 1) zm∞nit v SW_BALIK
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_balik records
- =rireuse("sw_balik",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- IF cMult = "A"
- lcChildWkArea=riopen("sw_docas") && 1) zm∞nit v SW_DOCAS
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_list records
- =rireuse("sw_docas",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_docsw") && 1) zm∞nit v SW_DOCSW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR NAZEV+VERZE = lcOldParentId
- pnChildRec = recno()
- pcChildID = NAZEV+VERZE
- pcChildExpr="NAZEV+VERZE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("NAZEV+VERZE",lcParentID,"NAZEV+VERZE")
- ENDSCAN get all of the sw_docsw records
- =rireuse("sw_docsw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
-
- ENDIF
- ENDIF
- ENDIF
- ENDIF
-
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- **********************************************************************************************
-
- **********************************************************************************************
- PROCEDURE __RI_UPDATE_CIS_PNAZ
-
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- **------ ZMENA NAZVU prislusenstvi
- lcOldParentID=OLDVAL("TYP")+OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="TYP+NAZEV"
- lcParentID=TYP+NAZEV
- IF !(lcParentID==lcOldParentID) && pokud se zm∞nφ nazev oblasti nebo podoblast
- lcChildWkArea=riopen("prisluse") && 1) zm∞nit v PRISLUSE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+NAZEV=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+NAZEV
- pcChildExpr="TYP+NAZEV"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+NAZEV",lcParentID,"TYP+NAZEV")
- ENDSCAN get all of the software records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+NAZEV=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+NAZEV
- pcChildExpr="TYP+NAZEV"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+NAZEV",lcParentID,"TYP+NAZEV")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+NAZEV=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+NAZEV
- pcChildExpr="TYP+NAZEV"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+NAZEV",lcParentID,"TYP+NAZEV")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+NAZEV=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+NAZEV
- pcChildExpr="TYP+NAZEV"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+NAZEV",lcParentID,"TYP+NAZEV")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+NAZEV=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+NAZEV
- pcChildExpr="TYP+NAZEV"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+NAZEV",lcParentID,"TYP+NAZEV")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i di zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+NAZEV=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+NAZEV
- pcChildExpr="TYP+NAZEV"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+NAZEV",lcParentID,"TYP+NAZEV")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
-
- **------ zmena nazvu procesoru a provedeni se musi zobrazit v HW
- SELECT (lcStartArea)
- IF INLIST(TYP,"K002","K013")
- cTyp = TYP
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- IF cTyp = "K002"
- SCAN FOR TYP =lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP
- pcChildExpr="TYP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP",lcParentID,"TYP")
- ENDSCAN get all of the software records
- ELSE
- SCAN FOR PROVEDENI =lcOldParentID
- pnChildRec=recno()
- pcChildID=PROVEDENI
- pcChildExpr="PROVEDENI"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("PROVEDENI",lcParentID,"TYP")
- ENDSCAN get all of the software records
- ENDIF
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny je treba promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- IF cTyp = "K002"
- SCAN FOR TYP =lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP
- pcChildExpr="TYP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP",lcParentID,"TYP")
- ENDSCAN get all of the lik_hard records
- ELSE
- SCAN FOR PROVEDENI =lcOldParentID
- pnChildRec=recno()
- pcChildID=PROVEDENI
- pcChildExpr="PROVEDENI"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("PROVEDENI",lcParentID,"TYP")
- ENDSCAN get all of the lik_hard records
- ENDIF
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- ENDIF
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- **********************************************************************************************
-
- **********************************************************************************************
- PROCEDURE __RI_UPDATE_CIS_POB1
-
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- **------ ZMENA OBLASTI1 v prislusenstvi
- lcOldParentID=OLDVAL("TYP")+OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="TYP+NAZEV"
- lcParentID=TYP+NAZEV
- IF !(lcParentID==lcOldParentID) && pokud se zm∞nφ nazev oblasti nebo podoblast
- lcChildWkArea=riopen("prisluse") && 1) zm∞nit v PRISLUSE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST1
- pcChildExpr="TYP+OBLAST1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST1",lcParentID,"TYP+OBLAST1")
- ENDSCAN get all of the software records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST1
- pcChildExpr="TYP+OBLAST1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST1",lcParentID,"TYP+OBLAST1")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST1
- pcChildExpr="TYP+OBLAST1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST1",lcParentID,"TYP+OBLAST1")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST1
- pcChildExpr="TYP+OBLAST1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST1",lcParentID,"TYP+OBLAST1")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST1
- pcChildExpr="TYP+OBLAST1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST1",lcParentID,"TYP+OBLAST1")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST1
- pcChildExpr="TYP+OBLAST1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST1",lcParentID,"TYP+OBLAST1")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- **********************************************************************************************
-
- **********************************************************************************************
- PROCEDURE __RI_UPDATE_CIS_POB2
-
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- **------ ZMENA OBLASTI2 v prislusenstvi
- lcOldParentID=OLDVAL("TYP")+OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="TYP+NAZEV"
- lcParentID=TYP+NAZEV
- IF !(lcParentID==lcOldParentID) && pokud se zm∞nφ nazev oblasti nebo podoblast
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST2
- pcChildExpr="TYP+OBLAST2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST2",lcParentID,"TYP+OBLAST2")
- ENDSCAN get all of the software records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST2
- pcChildExpr="TYP+OBLAST2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST2",lcParentID,"TYP+OBLAST2")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST2
- pcChildExpr="TYP+OBLAST2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST2",lcParentID,"TYP+OBLAST2")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST2
- pcChildExpr="TYP+OBLAST2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST2",lcParentID,"TYP+OBLAST2")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST2
- pcChildExpr="TYP+OBLAST2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST2",lcParentID,"TYP+OBLAST2")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny primitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP+OBLAST2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP+OBLAST2
- pcChildExpr="TYP+OBLAST2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP+OBLAST2",lcParentID,"TYP+OBLAST2")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
-
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- **********************************************************************************************
-
- **********************************************************************************************
- PROCEDURE __RI_UPDATE_hardware
-
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID) && zmena v PRISLUSE
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR PRIRAD=lcOldParentID
- pnChildRec=recno()
- pcChildID=PRIRAD
- pcChildExpr="PRIRAD"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("PRIRAD",lcParentID,"HARDWARE")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR PRIRAD=lcOldParentID
- pnChildRec=recno()
- pcChildID=PRIRAD
- pcChildExpr="PRIRAD"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("PRIRAD",lcParentID,"HARDWARE")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("OPR_HW") && zmena v OPRAVY
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID && AND TYP="H" SOB
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"HARDWARE")
- ENDSCAN get all of the opr_hw records
- =rireuse("OPR_HW",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("soft_pri") && zmena v soft_pri
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the soft_pri records
- =rireuse("soft_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("dok_hw") && zm∞nit v DOK_HW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VAZBA=lcOldParentID
- pnChildRec=recno()
- pcChildID=VAZBA
- pcChildExpr="VAZBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VAZBA",lcParentID,"VAZBA")
- ENDSCAN get all of the dok_hw records
- =rireuse("dok_hw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("software") && zm∞nit v SOFTWARE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR OEM=lcOldParentID AND LEFT(Lic_Zariz,2) = "HW"
- pnChildRec=recno()
- pcChildID=OEM
- pcChildExpr="OEM"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OEM",lcParentID,"OEM")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeyn provest do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR OEM=lcOldParentID AND LEFT(Lic_Zariz,2) = "HW"
- pnChildRec=recno()
- pcChildID=OEM
- pcChildExpr="OEM"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("OEM",lcParentID,"OEM")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pozadav") && zm∞nit v POZADAV
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VAZBA=lcOldParentID
- pnChildRec=recno()
- pcChildID=VAZBA
- pcChildExpr="VAZBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VAZBA",lcParentID,"VAZBA")
- ENDSCAN get all of the pozadav records
- =rireuse("pozadav",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("hh_loghd") && zm∞nit v hh_loghd
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the hh_loghd records
- =rireuse("hh_loghd",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("DOKUSCAN") && zmena v DOKUSCAN
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID AND DRUH = "H "
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"HARDWARE")
- ENDSCAN get all of the dokuscan records
- =rireuse("DOKUSCAN",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("HH_ZMENY") && zm∞nit v HH_ZMENY
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the hh_zmeny records
- =rireuse("hh_zmeny",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("HH_NEURC") && zm∞nit v HH_NEURC
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the hh_neurc records
- =rireuse("hh_neurc",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("HH_SLOTY") && zm∞nit v HH_SLOTY
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the hh_sloty records
- =rireuse("hh_sloty",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("HH_KONEK") && zm∞nit v HH_KONEK
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the hh_konek records
- =rireuse("hh_konek",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- IF TYPE("lSwScan") <> "U"
- IF lSwScan
- lcChildWkArea=riopen("sw_nalez") && zm∞nit v SW_NALEZ
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the sw_nalez records
- =rireuse("sw_nalez",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("SW_BEZLI") && zm∞nit v SW_BEZLI
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the SW_BEZLI records
- =rireuse("SW_BEZLI",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("SW_LICSW") && zm∞nit v SW_LICSW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the SW_LICSW records
- =rireuse("SW_LICSW",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("SW_PORSW") && zm∞nit v SW_PORSW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the SW_PORSW records
- =rireuse("SW_PORSW",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("SW_CISSW") && zm∞nit v SW_CISSW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the SW_CISSW records
- =rireuse("SW_CISSW",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("SW_PORSO") && zm∞nit v SW_PORSO
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the SW_PORSO records
- =rireuse("SW_PORSO",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("SW_CISSO") && zm∞nit v SW_CISSO
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the SW_CISSO records
- =rireuse("SW_CISSO",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
-
- lcChildWkArea=riopen("sw_neurc") && zm∞nit v SW_NEURC
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the sw_neurc records
- =rireuse("sw_neurc",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_reg") && zm∞nit v SW_REG
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the sw_reg records
- =rireuse("sw_reg",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_soub") && zm∞nit v SW_SOUB
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the sw_soub records
- =rireuse("sw_soub",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_zrus") && zm∞nit v SW_ZRUS
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the sw_zrus records
- =rireuse("sw_zrus",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_arch") && zm∞nit v SW_ARCH
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the sw_arch records
- =rireuse("sw_arch",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- IF cMult = "A"
- lcChildWkArea=riopen("sw_dsoub") && zm∞nit v sw_dsoub
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the sw_dsoub records
- =rireuse("sw_dsoub",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_docsw") && zm∞nit v sw_docsw
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"CISLO")
- ENDSCAN get all of the sw_docsw records
- =rireuse("sw_docsw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF
- ENDIF
- ENDIF
-
- **** prejmenovßnφ nascanovan²ch soubor∙
- IF TYPE("i_PathHW") <> "U"
- cPom = ALLTRIM(lcOldParentId) + ".*"
- cSouOld = SYS(2000,"&i_PathHW\&cPom")
- IF !EMPTY(cSouOld)
- DO WHILE !EMPTY(cSouOld)
- cSouNew = ALLTRIM(lcParentId) + RIGHT(cSouOld,4)
- RENAME '&i_PathHW\&cSouOld' TO '&i_PathHW\&cSouNew'
- cSouOld = SYS(2000,"&i_PathHW\&cPom",1)
- ENDDO
- ENDIF
- ENDIF
- ENDIF
-
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- **********************************************************************************************
-
- **********************************************************************************************
- procedure __RI_UPDATE_cis_serv
- ** "Referential integrity update trigger for" cis_serv
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("TYP_SERVC")
- pcParentID=lcOldParentID
- pcParentExpr="TYP_SERVC"
- lcParentID=TYP_SERVC
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout i do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_hard records
- = rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do likvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("hardware")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny je treba promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("software")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny je treba promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("software")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny je treba promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("software")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("software")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny je treba zapsat do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny je treba promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV1=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV1
- pcChildExpr="TYP_SERV1"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV1",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV2=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV2
- pcChildExpr="TYP_SERV2"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV2",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV3=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV3
- pcChildExpr="TYP_SERV3"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV3",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_site")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERV4=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP_SERV4
- pcChildExpr="TYP_SERV4"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERV4",lcParentID,"CIS_SERV")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_hw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERVC=lcOldParentID AND STAV = 5
- pnChildRec=recno()
- pcChildID=TYP_SERVC
- pcChildExpr="TYP_SERVC"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERVC",lcParentID,"CIS_SERV")
- ENDSCAN get all of the opr_hw records
- =rireuse("opr_hw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_sw")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERVC=lcOldParentID AND STAV = 5
- pnChildRec=recno()
- pcChildID=TYP_SERVC
- pcChildExpr="TYP_SERVC"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERVC",lcParentID,"CIS_SERV")
- ENDSCAN get all of the opr_sw records
- =rireuse("opr_sw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_pr")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERVC=lcOldParentID AND STAV = 5
- pnChildRec=recno()
- pcChildID=TYP_SERVC
- pcChildExpr="TYP_SERVC"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERVC",lcParentID,"CIS_SERV")
- ENDSCAN get all of the opr_pr records
- =rireuse("opr_pr",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("opr_ln")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR TYP_SERVC=lcOldParentID AND STAV = 5
- pnChildRec=recno()
- pcChildID=TYP_SERVC
- pcChildExpr="TYP_SERVC"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP_SERVC",lcParentID,"CIS_SERV")
- ENDSCAN get all of the opr_ln records
- =rireuse("opr_ln",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_serv
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_voln
- ** "Referential integrity update trigger for" cis_voln
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("hardware") && HARDWARE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the hardware records
- =rireuse("hardware",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_hard") && HARDWARE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the lik_hard records
- =rireuse("lik_hard",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("software") && SOFTWARE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_soft") && SOFTWARE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("prisluse") && PRISLUSE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the prisluse records
- =rireuse("prisluse",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pris") && PRISLUSE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the lik_pris records
- =rireuse("lik_pris",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_lan") && PRIS_LAN
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the pris_lan records
- =rireuse("pris_lan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_plan") && PRIS_LAN
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the lik_plan records
- =rireuse("lik_plan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("pris_vol") && PRIS_VOL
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the pris_vol records
- =rireuse("pris_vol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_pvol") && PRIS_VOL
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the lik_pvol records
- =rireuse("lik_pvol",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("site") && SITE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the site records
- =rireuse("site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikvidovanych vet
- lcChildWkArea=riopen("lik_site") && SITE
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISVOLNY=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISVOLNY
- pcChildExpr="CISVOLNY"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISVOLNY",lcParentID,"CIS_VOLN")
- ENDSCAN get all of the lik_site records
- =rireuse("lik_site",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_hpou
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_apli
- ** "Referential integrity update trigger for" cis_apli
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("apli_pri")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR APLIKACE=lcOldParentID
- pnChildRec=recno()
- pcChildID=APLIKACE
- pcChildExpr="APLIKACE"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("APLIKACE",lcParentID,"CIS_APLI")
- ENDSCAN get all of the software records
- =rireuse("apli_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_apli
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_pris_lan
- ** "Referential integrity update trigger for" pris_lan
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_prl")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VAZBA=lcOldParentID
- pnChildRec=recno()
- pcChildID=VAZBA
- pcChildExpr="VAZBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VAZBA",lcParentID,"PRIS_LAN")
- ENDSCAN get all of the dok_prl records
- =rireuse("dok_prl",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("opr_pl")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"PRIS_LAN")
- ENDSCAN get all of the opr_pl records
- =rireuse("opr_pl",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("DOKUSCAN") && zmena v DOKUSCAN
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID AND DRUH = "PL"
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"PRIS_LAN")
- ENDSCAN get all of the dokuscan records
- =rireuse("DOKUSCAN",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" pris_lan
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_pris_vol
- ** "Referential integrity update trigger for" pris_vol
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dok_prv")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR VAZBA=lcOldParentID
- pnChildRec=recno()
- pcChildID=VAZBA
- pcChildExpr="VAZBA"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("VAZBA",lcParentID,"PRIS_VOL")
- ENDSCAN get all of the dok_prv records
- =rireuse("dok_prv",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("CISLO")
- pcParentID=lcOldParentID
- pcParentExpr="CISLO"
- lcParentID=CISLO
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("opr_pv")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"PRIS_VOL")
- ENDSCAN get all of the opr_pv records
- =rireuse("opr_pv",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("DOKUSCAN") && zmena v DOKUSCAN
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR CISLO=lcOldParentID AND DRUH = "PV"
- pnChildRec=recno()
- pcChildID=CISLO
- pcChildExpr="CISLO"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("CISLO",lcParentID,"PRIS_VOL")
- ENDSCAN get all of the dokuscan records
- =rireuse("DOKUSCAN",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" prisluse
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_doku
- ** "Referential integrity update trigger for" cis_doku
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("NAZEV")
- pcParentID=lcOldParentID
- pcParentExpr="NAZEV"
- lcParentID=NAZEV
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("dokuscan")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Typ=lcOldParentID
- pnChildRec=recno()
- pcChildID=TYP
- pcChildExpr="TYP"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("TYP",lcParentID,"CIS_DOKU")
- ENDSCAN get all of the dokuscan records
- =rireuse("dokuscan",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
- ENDIF this parent id changed
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_doku
- ********************************************************************************
-
- ********************************************************************************
- procedure __RI_UPDATE_cis_loka
- ** "Referential integrity update trigger for" cis_loka
- LOCAL llRetVal
- llRetVal = .t.
- PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
- PRIVATE pcParentExpr,pcChildExpr
- STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
- STORE 0 TO pnParentRec,pnChildRec
- IF _triggerlevel=1
- BEGIN TRANSACTION
- PRIVATE pcRIcursors,pcRIwkareas,pcRIolderror,pnerror,;
- pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
- pcOldTalk=SET("TALK")
- SET TALK OFF
- pcOldDele=SET("DELETED")
- pcOldExact=SET("EXACT")
- pcOldCompat=SET("COMPATIBLE")
- SET COMPATIBLE OFF
- SET DELETED ON
- SET EXACT OFF
- pcRIcursors=""
- pcRIwkareas=""
- pcRIolderror=ON("error")
- pnerror=0
- ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
- IF TYPE('gaErrors(1)')<>"U"
- release gaErrors
- ENDIF
- PUBLIC gaErrors(1,12)
- pcOldDBC=DBC()
- SET DATA TO ("SPRAVCE")
- ENDIF first trigger
- LOCAL lcParentID && parent's value to be sought in child
- LOCAL lcOldParentID && previous parent id value
- LOCAL lcChildWkArea && child work area handle returned by riopen
- LOCAL lcChildID && child's value to be sought in parent
- LOCAL lcOldChildID && old child id value
- LOCAL lcParentWkArea && parentwork area handle returned by riopen
- LOCAL lcStartArea
- lcStartArea=select()
- llRetVal=.t.
- lcParentWkArea=select()
- SELECT (lcParentWkArea)
- pcParentDBF=dbf()
- pnParentRec=recno()
- lcOldParentID=OLDVAL("KOD")
- pcParentID=lcOldParentID
- pcParentExpr="KOD"
- lcParentID=KOD
- IF !(lcParentID==lcOldParentID)
- lcChildWkArea=riopen("software")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the software records
- =rireuse("software",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- *** zmeny promitnout do zlikkvidovanych vet
- lcChildWkArea=riopen("lik_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the lik_soft records
- =rireuse("lik_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("soft_pri")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the software records
- =rireuse("soft_pri",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("cis_soft")
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the software records
- =rireuse("cis_soft",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
-
- *************************************************
- IF TYPE("lSwScan") <> "U"
- lcChildWkArea=riopen("sw_nalez") && sw_nalez
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the sw_nalez records
- =rireuse("sw_nalez",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_bezli") && sw_bezli
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the sw_bezli records
- =rireuse("sw_bezli",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("SW_LICSW") && SW_LICSW
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the SW_LICSW records
- =rireuse("SW_LICSW",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_porsw") && sw_porsw
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the sw_porsw records
- =rireuse("sw_porsw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_cissw") && sw_cissw
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the sw_cissw records
- =rireuse("sw_cissw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
-
- lcChildWkArea=riopen("sw_neved") && sw_neved
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the sw_neved records
- =rireuse("sw_neved",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- IF cMult = "A"
- lcChildWkArea=riopen("sw_docas") && sw_docas
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the sw_docas records
- =rireuse("sw_docas",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- lcChildWkArea=riopen("sw_docsw") && sw_docsw
- IF lcChildWkArea<=0
- IF _triggerlevel=1
- DO riend WITH .F.
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN .F.
- ENDIF not able to open the child work area
- pcChildDBF=dbf(lcChildWkArea)
- SELECT (lcChildWkArea)
- SCAN FOR Sw_Lokal=lcOldParentID
- pnChildRec=recno()
- pcChildID=SW_LOKAL
- pcChildExpr="SW_LOKAL"
- IF NOT llRetVal
- EXIT
- ENDIF && not llretval
- llRetVal=riupdate("SW_LOKAL",lcParentID,"CIS_LOKA")
- ENDSCAN get all of the sw_docsw records
- =rireuse("sw_docsw",lcChildWkArea)
- IF NOT llRetVal
- IF _triggerlevel=1
- DO riend WITH llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ENDIF
-
- ENDIF
- ENDIF
- *************************************************
-
- ENDIF this parent id changed
-
- IF _triggerlevel=1
- do riend with llRetVal
- ENDIF at the end of the highest trigger level
- SELECT (lcStartArea)
- RETURN llRetVal
- ** "End of Referential integrity Update trigger for" cis_loka
- ********************************************************************************
-
- **__RI_FOOTER!@ Do NOT REMOVE or MODIFY this line!!!! @!__RI_FOOTER**
- ■≥ x[ x[ 4r# % ß Y ╢$ ú 7 U ½ «≈ ■ T≈ ⁿa²■ %ⁿCΩ┬≡ C'
- ± CS
- ²∙9 ■ T≈ ⁿ-²■ ∙æ ■ %ⁿC'
- ²∙ì ■ ■ %ⁿC√