#2278 - Procedures cad_slnkPredraw, cad_slnkPostdraw, cad_slnkpostModify en cad_slnkpostErase zodanig aangepast dat ook het grafisch plaatsen van een terreinsector en een ruimte via de tabel cad_slnkstruct gebeurt.

svn path=/Database/trunk/; revision=6539
This commit is contained in:
Bert in het Veld
1999-03-01 13:55:08 +00:00
parent 76987f6c93
commit a767607dcd

View File

@@ -2,9 +2,13 @@
/* REVISIONS:
*
*
* --- 01.43 ---
* 01-03-1999 BIV #2278 - Functies cad_getVerdiepPlgrnd_tekening en cad_getVerdiepCntr_tekening toegevoegd
* t.b.v. Facilitor 3, het grafisch plaatsen van een ruimte.
* 26-02-1999 BIV #2278 - Procedures cad_slnkPredraw,cad_SLNKModify,cad_SLNKPostErase, cad_SLNKPostDraw aangepast
* t.b.v. Facilitor 3.
* --- 01.42 ---
* --- 01.41 ---
*
* 09-12-1998 BIV Functies cad_getDisciplinetekening, cad_getPlattegrondtekening, cad_getContourtekening toegevoegd.
* 09-12-1998 BIV Procedure cad_SLNKPreDraw toegevoegd.
* 03-12-1998 BIV Procedure cad_SLNKgetDrawing toegevoegd.
@@ -58,11 +62,14 @@ CREATE OR REPLACE PACKAGE cad AS
PROCEDURE cad_SLNKSTRUCTclearAll(Session_Id NUMBER);
PROCEDURE cad_SLNKgetDrawing(Session_Id NUMBER);
PROCEDURE cad_SLNKPreDraw(Session_Id NUMBER);
PROCEDURE cad_SLNKConvPreDraw(Session_Id NUMBER, LOC_X_COORD NUMBER, LOC_Y_COORD NUMBER);
/* Deze procedure is slechts eenmaal gebruikt t.b.v. grafische conversie BIS ...
* PROCEDURE cad_SLNKConvPreDraw(Session_Id NUMBER, LOC_X_COORD NUMBER, LOC_Y_COORD NUMBER);
*/
FUNCTION cad_getDisciplinetekening(Locatie_key IN NUMBER, Discipline_key IN NUMBER) RETURN VARCHAR2;
FUNCTION cad_getPlattegrondtekening(Locatie_key IN NUMBER)RETURN VARCHAR2;
FUNCTION cad_getContourtekening(Locatie_key IN NUMBER)RETURN VARCHAR2;
FUNCTION cad_getVerdiepPlgrnd_tekening(Locatiekey IN NUMBER, Verdiepingkey IN NUMBER) RETURN VARCHAR2;
FUNCTION cad_getVerdiepCntr_tekening(Locatiekey IN NUMBER, Verdiepingkey IN NUMBER) RETURN VARCHAR2;
/* garandeer dat de functies de database-state en package-state niet beinvloeden
* (anders kunnen ze niet zondermeer in een view worden gebruikt)
@@ -74,8 +81,9 @@ CREATE OR REPLACE PACKAGE cad AS
PRAGMA RESTRICT_REFERENCES (cad_f_ruimte_get_tekeningnaam, WNDS, WNPS);
PRAGMA RESTRICT_REFERENCES (cad_getDisciplinetekening, WNDS, WNPS);
PRAGMA RESTRICT_REFERENCES (cad_getPlattegrondtekening, WNDS, WNPS);
PRAGMA RESTRICT_REFERENCES (cad_getContourtekening, WNDS, WNPS);
PRAGMA RESTRICT_REFERENCES (cad_getContourtekening, WNDS, WNPS);
PRAGMA RESTRICT_REFERENCES (cad_getVerdiepPlgrnd_tekening, WNDS, WNPS);
PRAGMA RESTRICT_REFERENCES (cad_getVerdiepCntr_tekening, WNDS, WNPS);
END cad;
/
@@ -219,7 +227,7 @@ CREATE OR REPLACE PACKAGE BODY cad AS
BEGIN
BEGIN
SELECT alg_locatie_code INTO locatie_code
FROM alg_v_aanweziglocatie
FROM alg_locatie
WHERE alg_locatie_key = Locatie_key;
RETURN locatie_code;
EXCEPTION
@@ -248,7 +256,6 @@ CREATE OR REPLACE PACKAGE BODY cad AS
END;
END cad_getDisciplinetekening;
FUNCTION cad_getPlattegrondtekening(Locatie_key IN NUMBER)RETURN VARCHAR2 IS
locatie_code VARCHAR2(5);
tekening VARCHAR2(256);
@@ -258,7 +265,8 @@ CREATE OR REPLACE PACKAGE BODY cad AS
locatie_code := bepaal_locatiecode(Locatie_key);
SELECT cad_tekening_filenaam INTO tekening
FROM cad_v_plattegrond
WHERE alg_locatie_key = Locatie_key;
WHERE alg_locatie_key = Locatie_key
AND alg_verdieping_key IS NULL;
plattegrondtekening := locatie_code||'\'||tekening;
RETURN plattegrondtekening;
EXCEPTION
@@ -267,17 +275,35 @@ CREATE OR REPLACE PACKAGE BODY cad AS
END;
END cad_getPlattegrondtekening;
FUNCTION cad_getVerdiepPlgrnd_tekening(Locatiekey IN NUMBER, Verdiepingkey IN NUMBER) RETURN VARCHAR2 IS
locatie_code VARCHAR2(5);
tekening VARCHAR2(256);
Plattegrondtekening VARCHAR2(256);
BEGIN
BEGIN
locatie_code := bepaal_locatiecode(Locatiekey);
SELECT cad_tekening_filenaam INTO tekening
FROM cad_v_plattegrond
WHERE alg_verdieping_key = Verdiepingkey;
plattegrondtekening := locatie_code||'\'||tekening;
RETURN plattegrondtekening;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END;
END cad_getVerdiepPlgrnd_tekening;
FUNCTION cad_getContourtekening(Locatie_key IN NUMBER)RETURN VARCHAR2 IS
locatie_code VARCHAR2(5);
tekening VARCHAR2(256);
Contourtekening VARCHAR2(256);
BEGIN
locatie_code := bepaal_locatiecode(Locatie_key);
BEGIN
locatie_code := bepaal_locatiecode(Locatie_key);
SELECT cad_tekening_filenaam INTO tekening
FROM cad_v_contour
WHERE alg_locatie_key = Locatie_key;
WHERE alg_locatie_key = Locatie_key
AND alg_verdieping_key IS NULL;
Contourtekening := locatie_code||'\'||tekening;
RETURN Contourtekening;
EXCEPTION
@@ -285,7 +311,24 @@ CREATE OR REPLACE PACKAGE BODY cad AS
RETURN NULL;
END;
END cad_getContourtekening;
FUNCTION cad_getVerdiepCntr_tekening(Locatiekey IN NUMBER, Verdiepingkey IN NUMBER) RETURN VARCHAR2 IS
locatie_code VARCHAR2(5);
tekening VARCHAR2(256);
Contourtekening VARCHAR2(256);
BEGIN
locatie_code := bepaal_locatiecode(LocatieKey);
BEGIN
SELECT cad_tekening_filenaam INTO tekening
FROM cad_v_contour
WHERE alg_verdieping_key = Verdiepingkey;
Contourtekening := locatie_code||'\'||tekening;
RETURN Contourtekening;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END;
END cad_getVerdiepCntr_tekening;
PROCEDURE cad_SLNKSTRUCTdelete(Session_Id NUMBER, Entry VARCHAR2) IS
BEGIN
@@ -557,6 +600,49 @@ CREATE OR REPLACE PACKAGE BODY cad AS
END cad_SLNKgetDrawing;
FUNCTION cad_getLayerColor(Entry IN VARCHAR2) RETURN VARCHAR2 IS
LayerColor VARCHAR2(256);
BEGIN
BEGIN
SELECT cad_symbool_kleur INTO LayerColor
FROM cad_symbool
WHERE cad_symbool_entry = Entry;
RETURN LayerColor;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END;
END cad_getLayerColor;
FUNCTION cad_getLayerLinetype(Entry IN VARCHAR2) RETURN VARCHAR2 IS
LayerLinetype VARCHAR2(256);
BEGIN
BEGIN
SELECT cad_symbool_linetype INTO LayerLinetype
FROM cad_symbool
WHERE cad_symbool_entry = Entry;
RETURN LayerLinetype;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END;
END cad_getLayerLinetype;
FUNCTION cad_getLayerName(Entry IN VARCHAR2) RETURN VARCHAR2 IS
LayerName VARCHAR2(256);
BEGIN
BEGIN
SELECT cad_symbool_layer INTO LayerName
FROM cad_symbool
WHERE cad_symbool_entry = Entry;
RETURN LayerName;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END;
END cad_getLayerName;
#ifdef BIS
PROCEDURE cad_KILLtrajecten(Session_Id NUMBER, Diepte NUMBER, Datum DATE) IS
Eerste BOOLEAN;
@@ -752,7 +838,7 @@ CREATE OR REPLACE PACKAGE BODY cad AS
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABELCOL',SeqNr, 'BIS_BORING_NUMMER', 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABEL',SeqNr, boring_nummer, 1);
END cad_SLNKConvPreDraw;
#endif // BIS
PROCEDURE cad_SLNKPreDraw(Session_Id NUMBER) IS
LPNName VARCHAR2(128);
@@ -761,10 +847,12 @@ CREATE OR REPLACE PACKAGE BODY cad AS
Diepte NUMBER(8,2);
Veld_Key NUMBER(10);
LocatieKey NUMBER(10);
VerdiepingKey NUMBER(10);
DisciplineKey NUMBER(10);
Subloc_Code VARCHAR2(5);
Boring_nummer VARCHAR2(5);
Projectnr VARCHAR2(8);
RuimteNr VARCHAR2(10);
Ontgraafvak_Naam VARCHAR2(32);
SrcDwg VARCHAR2(128);
LoadDwg VARCHAR2(128);
@@ -776,6 +864,10 @@ CREATE OR REPLACE PACKAGE BODY cad AS
SeqNr NUMBER(10);
Datum DATE;
Eerste BOOLEAN;
LayerNaam VARCHAR2(256);
LayerColor VARCHAR2(256);
LayerLineType VARCHAR2(256);
BEGIN
LPNName := cad_SLNKSTRUCTreadVALSTR(Session_id, 'LPNALIASPREDRAW');
LPNKey := cad_SLNKSTRUCTreadVALINT(Session_id, 'LPNKEYPREDRAW');
@@ -783,7 +875,83 @@ CREATE OR REPLACE PACKAGE BODY cad AS
IF SeqNr IS NULL THEN
SeqNr := 1;
END IF;
IF LPNNAME = 'LPN_BIS_BORING' THEN
IF LPNNAME = 'LPN_ALG_RUIMTE' THEN
cad.cad_SLNKSTRUCTinsertVALSTR(Session_Id,'LPNALIASINSA', SeqNr, 'LPN_ALG_RUIMTE', 1);
cad.cad_SLNKSTRUCTinsertVALINT(Session_Id,'LPNKEYINSA', SeqNr, LPNKey, 1);
cad.cad_SLNKstructinsertVALINT(Session_Id,'DIMENSION', SeqNr, 2, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LPNCOLINSA', SeqNr, 'ALG_RUIMTE_KEY', 1);
LayerColor := cad_getLayercolor('ALG_RUIMTE');
LayerLineType := cad_getLayerlinetype('ALG_RUIMTE');
LayerNaam := cad_getLayername('ALG_RUIMTE');
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LAYERCOLOR', SeqNr, LayerColor, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LAYERLINETYPE', SeqNr, LayerLinetype, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LAYER', SeqNr, Layernaam, 1);
SELECT alg_locatie_key, alg_verdieping_key
INTO locatiekey, verdiepingkey
FROM alg_v_ruimte_gegevens
WHERE alg_ruimte_key = LPNKey;
SrcDwg := cad_getVerdiepCntr_tekening(Locatiekey, Verdiepingkey);
LoadDwg := cad_getVerdiepPlgrnd_tekening(Locatiekey, Verdiepingkey);
AttachDwg1 := SrcDwg;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'SRCDWG', SeqNr, SrcDwg, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LOADDWG', SeqNr, LoadDwg, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'ATTACHDWG', SeqNr, AttachDwg1, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABELCOL', SeqNr, 'ALG_RUIMTE_NR', 1);
SELECT alg_ruimte_nr INTO RuimteNr
FROM alg_ruimte
WHERE alg_ruimte_key = LPNKey;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABEL',SeqNr, RuimteNr, 1);
ELSIF LPNNAME = 'LPN_ALG_TERREINSECTOR' THEN
cad.cad_SLNKSTRUCTinsertVALSTR(Session_Id,'LPNALIASINSA', SeqNr, 'LPN_ALG_TERREINSECTOR', 1);
cad.cad_SLNKSTRUCTinsertVALINT(Session_Id,'LPNKEYINSA', SeqNr, LPNKey, 1);
cad.cad_SLNKstructinsertVALINT(Session_Id,'DIMENSION', SeqNr, 2, 1);
#ifdef BIS
LayerNaam := 'SUBLOCATIE';
#else
LayerColor := cad_getLayercolor('ALG_TERREINSECTOR');
LayerLineType := cad_getLayerlinetype('ALG_TERREINSECTOR');
LayerNaam := cad_getLayername('ALG_TERREINSECTOR');
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LAYERCOLOR', SeqNr, LayerColor, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LAYERLINETYPE', SeqNr, LayerLinetype, 1);
#endif //NONBIS
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LAYER', SeqNr, Layernaam, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LPNCOLINSA', SeqNr, 'ALG_TERREINSECTOR_KEY', 1);
SELECT alg_locatie_key INTO Locatiekey
FROM alg_terreinsector
WHERE alg_terreinsector_key = LPNKey;
SrcDwg := cad_getContourtekening(LocatieKey);
LoadDwg := cad_getPlattegrondtekening(LocatieKey);
AttachDwg1 := SrcDwg;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'SRCDWG', 1, SrcDwg, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LOADDWG', 1, LoadDwg, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'ATTACHDWG', 1, AttachDwg1, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABELCOL',SeqNr, 'ALG_TERREINSECTOR_CODE', 1);
SELECT alg_terreinsector_code INTO Subloc_code
FROM alg_v_aanwezigterreinsector
WHERE alg_terreinsector_key = LPNKey;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABEL',SeqNr, Subloc_code, 1);
#ifdef BIS
/* Zet alle boringen die binnen deze sublocatie vallen in de tabel cad_slnkstruct */
DECLARE
CURSOR Sectorboring IS
SELECT bis_boring_key
FROM bis_v_aanwezigboring
WHERE alg_terreinsector_key = LPNKey;
BEGIN
Eerste := TRUE;
FOR BoringRec IN Sectorboring LOOP
IF Eerste THEN
cad_SLNKSTRUCTinsertVALSTR(Session_Id, 'LPNALIASCONDAOUTER', 1,'LPN_BIS_BORING', 1);
cad_SLNKSTRUCTinsertVALINT(Session_Id, 'LPNKEYCONDAOUTER', 1, BoringRec.bis_boring_key, 1);
Eerste := FALSE;
ELSE
cad_SLNKSTRUCTinsertVALSTR(Session_Id, 'LPNALIASCONDAOUTER', 1,'LPN_BIS_BORING', 0);
cad_SLNKSTRUCTinsertVALINT(Session_Id, 'LPNKEYCONDAOUTER', 1, BoringRec.bis_boring_key, 0);
END IF;
END LOOP;
END;
ELSIF LPNNAME = 'LPN_BIS_BORING' THEN
cad.cad_SLNKSTRUCTinsertVALSTR(Session_Id,'LPNALIASINSA', SeqNr, 'LPN_BIS_BORING', 1);
cad.cad_SLNKSTRUCTinsertVALINT(Session_Id,'LPNKEYINSA', SeqNr, LPNKey, 1);
/* Bepaal of er sprake is van een veld(contour) of van een puntboring */
@@ -833,46 +1001,7 @@ CREATE OR REPLACE PACKAGE BODY cad AS
cad.cad_SLNKstructinsertVALINT(Session_Id,'INSPOINTCODE', SeqNr, 0, 1);
END IF;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABELCOL',SeqNr, 'BIS_BORING_NUMMER', 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABEL',SeqNr, boring_nummer, 1);
ELSIF LPNNAME = 'LPN_ALG_TERREINSECTOR' THEN
cad.cad_SLNKSTRUCTinsertVALSTR(Session_Id,'LPNALIASINSA', SeqNr, 'LPN_ALG_TERREINSECTOR', 1);
cad.cad_SLNKSTRUCTinsertVALINT(Session_Id,'LPNKEYINSA', SeqNr, LPNKey, 1);
cad.cad_SLNKstructinsertVALINT(Session_Id,'DIMENSION', SeqNr, 2, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LAYER', SeqNr, 'SUBLOCATIE', 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LPNCOLINSA', SeqNr, 'ALG_TERREINSECTOR_KEY', 1);
SELECT alg_locatie_key INTO Locatiekey
FROM alg_terreinsector
WHERE alg_terreinsector_key = LPNKey;
SrcDwg := cad_getContourtekening(LocatieKey);
LoadDwg := cad_getPlattegrondtekening(LocatieKey);
AttachDwg1 := SrcDwg;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'SRCDWG', 1, SrcDwg, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LOADDWG', 1, LoadDwg, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'ATTACHDWG', 1, AttachDwg1, 1);
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABELCOL',SeqNr, 'ALG_TERREINSECTOR_CODE', 1);
SELECT alg_terreinsector_code INTO Subloc_code
FROM alg_v_aanwezigterreinsector
WHERE alg_terreinsector_key = LPNKey;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABEL',SeqNr, Subloc_code, 1);
/* Zet alle boringen die binnen deze sublocatie vallen in de tabel cad_slnkstruct */
DECLARE
CURSOR Sectorboring IS
SELECT bis_boring_key
FROM bis_v_aanwezigboring
WHERE alg_terreinsector_key = LPNKey;
BEGIN
Eerste := TRUE;
FOR BoringRec IN Sectorboring LOOP
IF Eerste THEN
cad_SLNKSTRUCTinsertVALSTR(Session_Id, 'LPNALIASCONDAOUTER', 1,'LPN_BIS_BORING', 1);
cad_SLNKSTRUCTinsertVALINT(Session_Id, 'LPNKEYCONDAOUTER', 1, BoringRec.bis_boring_key, 1);
Eerste := FALSE;
ELSE
cad_SLNKSTRUCTinsertVALSTR(Session_Id, 'LPNALIASCONDAOUTER', 1,'LPN_BIS_BORING', 0);
cad_SLNKSTRUCTinsertVALINT(Session_Id, 'LPNKEYCONDAOUTER', 1, BoringRec.bis_boring_key, 0);
END IF;
END LOOP;
END;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LABEL',SeqNr, boring_nummer, 1);
ELSIF LPNNAME = 'LPN_BIS_PROJECT' THEN
cad.cad_SLNKSTRUCTinsertVALSTR(Session_Id,'LPNALIASINSA', SeqNr, 'LPN_BIS_PROJECT', 1);
cad.cad_SLNKSTRUCTinsertVALINT(Session_Id,'LPNKEYINSA', SeqNr, LPNKey, 1);
@@ -922,6 +1051,7 @@ CREATE OR REPLACE PACKAGE BODY cad AS
FROM bis_ontgravingsvak
WHERE bis_ontgravingsvak_key = LPNKey;
cad.cad_SLNKstructinsertVALSTR(Session_Id,'DATE', SeqNr, TO_CHAR(Datum), 1);
#endif //BIS
END IF;
cad_SLNKSTRUCTinsertVALSTR(Session_Id, 'SYNC', 1, 'AUTOCAD', 1);
END cad_SLNKPreDraw;
@@ -939,7 +1069,18 @@ CREATE OR REPLACE PACKAGE BODY cad AS
BEGIN
LPNName := cad_SLNKSTRUCTreadVALSTR(Session_id, 'LPNALIASINSO');
LPNKey := cad_SLNKSTRUCTreadVALINT(Session_id, 'LPNKEYINSO');
IF LPNName = 'LPN_BIS_BORING' THEN
IF LPNNAME = 'LPN_ALG_RUIMTE' THEN
Oppervlak := cad_SLNKSTRUCTreadVALREAL(Session_id, 'AREA');
UPDATE alg_ruimte
SET alg_ruimte_bruto_vloeropp = Oppervlak
WHERE alg_ruimte_key = LPNKey;
ELSIF LPNName = 'LPN_ALG_TERREINSECTOR' THEN
Oppervlak := cad_SLNKSTRUCTreadVALREAL(Session_id, 'AREA');
UPDATE alg_terreinsector
SET alg_terreinsector_oppervlak = Oppervlak
WHERE alg_terreinsector_key = LPNKey;
#ifdef BIS
ELSIF LPNName = 'LPN_BIS_BORING' THEN
UPDATE bis_boring
SET bis_boring_getekend = 'TRUE'
WHERE bis_boring_key = LPNKey;
@@ -966,26 +1107,21 @@ CREATE OR REPLACE PACKAGE BODY cad AS
WHEN NO_DATA_FOUND THEN
Datum := SYSDATE;
END;
UPDATE bis_ontgravingsvak
SET bis_ontgravingsvak_volume = Volume,
bis_ontgravingsvak_diepte = Diepte
WHERE bis_ontgravingsvak_key = LPNKey;
COMMIT;
/* "Onthoofden" van trajecten */
cad_KILLtrajecten(Session_Id, Diepte, Datum);
ELSIF LPNName = 'LPN_ALG_TERREINSECTOR' THEN
Oppervlak := cad_SLNKSTRUCTreadVALREAL(Session_id, 'AREA');
UPDATE alg_terreinsector
SET alg_terreinsector_oppervlak = Oppervlak
WHERE alg_terreinsector_key = LPNKey;
cad_KILLtrajecten(Session_Id, Diepte, Datum);
ELSIF LPNName = 'LPN_BIS_PROJECT' THEN
Oppervlak := cad_SLNKSTRUCTreadVALREAL(Session_id, 'AREA');
UPDATE bis_project
SET bis_project_oppervlakte = Oppervlak
WHERE bis_project_key = LPNKey;
#endif //BIS
END IF;
cad_SLNKSTRUCTinsertVALSTR(Session_Id, 'SYNC', 1, 'AUTOCAD', 1); /* ORACLE is klaar */
END cad_SLNKpostdraw;
@@ -1003,25 +1139,12 @@ CREATE OR REPLACE PACKAGE BODY cad AS
Datum := TO_DATE(CheckDatum, 'DD-MM-YYYY');
LPNName := cad_SLNKSTRUCTreadVALSTR(Session_id, 'LPNALIASDELO');
LPNKey := cad_SLNKSTRUCTreadVALINT(Session_id, 'LPNKEYDELO');
IF LPNName = 'LPN_BIS_BORING' THEN
IF CheckDatum IS NOT NULL THEN
UPDATE bis_boring
SET bis_boring_verwijderdatum = Datum
WHERE bis_boring_key = LPNKey;
ELSE
UPDATE bis_boring
SET bis_boring_getekend = 'FALSE'
WHERE bis_boring_key = LPNKey;
UPDATE bis_veld
SET bis_veld_oppervlakte = NULL
WHERE bis_veld_key IN
(SELECT bis_veld_key FROM bis_boring
WHERE bis_boring_key = LPNKey);
END IF;
IF LPNName = 'LPN_ALG_RUIMTE' THEN
DELETE FROM alg_ruimte
WHERE alg_ruimte_key = LPNKey;
COMMIT;
ELSIF LPNName = 'LPN_ALG_TERREINSECTOR' THEN
#ifdef BIS
BEGIN
DECLARE
CURSOR Sectorboring IS
@@ -1047,9 +1170,32 @@ CREATE OR REPLACE PACKAGE BODY cad AS
END LOOP;
END;
END;
UPDATE alg_terreinsector
SET alg_terreinsector_verwijder = Datum
WHERE alg_terreinsector_key = LPNKey;
UPDATE alg_terreinsector
SET alg_terreinsector_verwijder = Datum
WHERE alg_terreinsector_key = LPNKey;
COMMIT;
#else
DELETE FROM alg_terreinsector
WHERE alg_terreinsector_key = LPNKey;
COMMIT;
#endif //NONBIS
#ifdef BIS
ELSIF LPNName = 'LPN_BIS_BORING' THEN
IF CheckDatum IS NOT NULL THEN
UPDATE bis_boring
SET bis_boring_verwijderdatum = Datum
WHERE bis_boring_key = LPNKey;
ELSE
UPDATE bis_boring
SET bis_boring_getekend = 'FALSE'
WHERE bis_boring_key = LPNKey;
UPDATE bis_veld
SET bis_veld_oppervlakte = NULL
WHERE bis_veld_key IN
(SELECT bis_veld_key FROM bis_boring
WHERE bis_boring_key = LPNKey);
END IF;
COMMIT;
ELSIF LPNName = 'LPN_BIS_PROJECT' THEN
UPDATE bis_project
@@ -1061,6 +1207,7 @@ CREATE OR REPLACE PACKAGE BODY cad AS
SET bis_ontgravingsvak_verwijder = Datum
WHERE bis_ontgravingsvak_key = LPNKey;
COMMIT;
#endif //BIS
END IF;
cad_SLNKSTRUCTinsertVALSTR(Session_Id, 'SYNC', 1, 'AUTOCAD', 1);
END cad_SLNKpostErase;
@@ -1078,7 +1225,18 @@ CREATE OR REPLACE PACKAGE BODY cad AS
BEGIN
LPNName := cad_SLNKSTRUCTreadVALSTR(Session_id, 'LPNALIASMODO');
LPNKey := cad_SLNKSTRUCTreadVALINT(Session_id, 'LPNKEYMODO');
IF LPNName = 'LPN_BIS_BORING' THEN
IF LPNName = 'LPN_ALG_RUIMTE' THEN
Oppervlak := cad_SLNKSTRUCTreadVALREAL(Session_id, 'AREA');
UPDATE alg_ruimte
SET alg_ruimte_bruto_vloeropp = Oppervlak
WHERE alg_ruimte_key = LPNKey;
ELSIF LPNName = 'LPN_ALG_TERREINSECTOR' THEN
Oppervlak := cad_SLNKSTRUCTreadVALREAL(Session_id, 'AREA');
UPDATE alg_terreinsector
SET alg_terreinsector_oppervlak = Oppervlak
WHERE alg_terreinsector_key = LPNKey;
#ifdef BIS
ELSIF LPNName = 'LPN_BIS_BORING' THEN
/* als het een veld betreft dan oppervlakte aanpassen in tabel bis_veld */
SELECT bis_veld_key INTO VeldKey
FROM bis_boring
@@ -1089,12 +1247,6 @@ CREATE OR REPLACE PACKAGE BODY cad AS
SET bis_veld_oppervlakte = Oppervlak
WHERE bis_veld_key = Veldkey;
END IF;
ELSIF LPNName = 'LPN_ALG_TERREINSECTOR' THEN
Oppervlak := cad_SLNKSTRUCTreadVALREAL(Session_id, 'AREA');
UPDATE alg_terreinsector
SET alg_terreinsector_oppervlak = Oppervlak
WHERE alg_terreinsector_key = LPNKey;
COMMIT;
ELSIF LPNName = 'LPN_BIS_PROJECT' THEN
Oppervlak := cad_SLNKSTRUCTreadVALREAL(Session_id, 'AREA');
UPDATE bis_project
@@ -1111,11 +1263,10 @@ CREATE OR REPLACE PACKAGE BODY cad AS
/* "Onthoofden" van trajecten */
Datum := TO_DATE(cad_SLNKSTRUCTreadVALSTR(Session_id, 'DATE'), 'DD-MM-YYYY');
cad_KILLtrajecten(Session_Id, Diepte, Datum);
#endif //BIS
END IF;
cad_SLNKSTRUCTinsertVALSTR(Session_Id, 'SYNC', 1, 'AUTOCAD', 1);
END cad_SLNKpostModify;
#endif // BIS
END cad;
/