Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //regular version
- FOR ALL TAULELL_ANUNCIS
- IF TAULELL_ANUNCIS.CodiEmpleat_Autor = params.userID THEN
- FOR EACH id OF params.idAnunciList
- IF TAULELL_ANUNCIS.TaulellAnuncis_ID = id THEN
- TAULELL_ANUNCIS.isDeleted = true
- HModify(TAULELL_ANUNCIS)
- obj is MTAULELL_ANUNCIS = TAULELL_ANUNCIS
- arrayAnuncis.Add(obj)
- ELSE
- RETURN ReturnHFError(500)
- END
- END
- END
- END
- sToReturn is ANSI string
- Serialize(arrayAnuncis, sToReturn, psdJSON)
- RETURN sToReturn
- //hashmap version
- FOR ALL TAULELL_ANUNCIS
- IF TAULELL_ANUNCIS.CodiEmpleat_Autor = params.userID THEN
- HashIDs is associative array of boolean
- FOR EACH id OF params.idAnunciList
- HashIDs[id] = True
- END
- IF HashIDs[TAULELL_ANUNCIS.TaulellAnuncis_ID].Exist THEN
- //TAULELL_ANUNCIS.isDeleted = true uncomment when db field is created
- HModify(TAULELL_ANUNCIS)
- obj is MTAULELL_ANUNCIS = TAULELL_ANUNCIS
- arrayAnuncis.Add(obj)
- ELSE
- CONTINUE
- END
- END
- END
- //MONDAY AFTERNOON TRY
- idTable is associative array of boolean
- modifiedRecords is array of MTAULELL_ANUNCIS
- FOR EACH id OF params.idAnunciList
- idTable[id] = True
- END
- i is int = 1
- WHILE i <= HCount(TAULELL_ANUNCIS)
- // Check if Anunci_ID is in the idTable
- HReadSeek(TAULELL_ANUNCIS, Anunci_ID, i, hIdentical)
- IF idTable[TAULELL_ANUNCIS.Anunci_ID] = True THEN
- TAULELL_ANUNCIS.isDeleted = True
- HModify(TAULELL_ANUNCIS)
- modifiedRecords.Add(TAULELL_ANUNCIS)
- idTable[TAULELL_ANUNCIS.Anunci_ID] = False
- END
- i++
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement