home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
tema
/
SW602
/
Winbase
/
EShop_demo
/
WWW_CENIK.PGM
< prev
next >
Wrap
Text File
|
2000-03-16
|
3KB
|
101 lines
{$$3220792584 . }//Program www-obj
table
sys_par, obj_header, S_deal_sk, Obchodni_partneri;
{$I I_wbinet}
var
W_jmeno,w_heslo:string[20];
dcena:string[10];
procedure chybacgi(pomstr:string[200]);
/*********************************************************************/
begin
log_write(pomstr);
/* if rp then SetSTWError(pomstr)
else*/ SetUserError(pomstr);
Halt;
end;
procedure dealcena(jmeno,heslo:string[80]);
/*********************************************************************/
var
podminka:string[200];
curs:cursor;
pocet, dsk:integer;
jrec:trecnum;
u:untyped;
begin //0
podminka:="((intr_user="+""""+jmeno+""""+") AND (intr_pswd="+""""+heslo+""""+"))";
if not Open_sql_parts(curs, "id, deal_sk", "obchodni_partneri", podminka, "") then
begin //1
Rec_cnt(curs,pocet);
if pocet>0 then
begin //2
dsk:=curs[0].deal_sk;
if ((dsk>0) AND (dsk<10)) then dcena:="cena"+int2str(dsk) else dcena:="min_cena";
u:=dsk;
jrec := Look_up(S_deal_sk,"deal_id",u);
if jrec=-1 then chybacgi(" chyba p°i b∞hu procedury dealcena - nenalezena dealerskß skupina");
end //2
else dcena:="min_cena";
close_cursor(curs);
end //1
else dcena:="min_cena";
if jmeno="" then w_jmeno:="NOVY" else w_jmeno:=jmeno;
if heslo="" then w_heslo:="NOVY" else w_heslo:=heslo;
end; //0
procedure W_smaz_obj(id_obj:integer);
/*********************************************************************/
var
cislo_tab : tobjnum;
irec:trecnum;
u:untyped;
zakaznik,limit,pocet:integer;
podminka: string[120];
curs:cursor;
begin
limit:=0;
podminka:="id_dobj="+int2str(id_obj);
u := id_obj;
irec := Look_up(obj_header,"id_dobj",u);
if irec=-1 then chybacgi(" chyba p°i b∞hu procedury W_smaz_obj - nenalezena objednßvka");
if irec<>-1 then
begin
zakaznik:=obj_header[irec].id_org;
if not Open_sql_parts(curs, "*", "obj_polozky", podminka, "") then
begin
Delete_all_records(curs);
Close_cursor(curs);
// if not Find_object("obj_polozky", CATEG_TABLE, cislo_tab) then Free_deleted(cislo_tab);
end;
Delete(obj_header,irec);
// if not Find_object("obj_header", CATEG_TABLE, cislo_tab) then Free_deleted(cislo_tab);
if zakaznik<>-1 then
begin
podminka:="id_org="+int2str(zakaznik);
if not Open_sql_parts(curs, "*", "obj_header", podminka, "") then
begin
Rec_cnt(curs,pocet);
Close_cursor(curs);
if pocet<1 then
begin
u := zakaznik;
irec := Look_up(obchodni_partneri,"id",u);
Delete(obchodni_partneri,irec);
end;
end;
end;
end;
end;
begin
end.