【正文】
。 (39。insert into 出庫表 (bh,ckrq,khmc,chck,ysdz,ysfs,hwmc,dhh,pp,jldw, ckdj,cksl,ckze,czy,bz) values(:a,:b,:c,:d,:e,:f,:g,:h,:o:i,:j,:k,:l,:m,:n)39。)。 (39。a39。).Value:=trim()。 (39。b39。).Value:=datetostr()。 (39。c39。).Value:=trim()。 (39。d39。).Value:=trim()。 (39。e39。).Value:=trim()。 (39。f39。).Value:=trim()。 (39。g39。).Value:=trim()。 (39。h39。).Value:=trim()。 (39。039。).Value:=trim()。 (39。i39。).Value:=trim()。 (39。j39。).Value:=strtofloat()。 (39。k39。).Value:=strtoint()。 (39。l39。).Value:=strtofloat()。 (39。m39。).Value:=trim()。 (39。n39。).Value:=trim()。 。 end。 end。 end。 end。 出庫查詢頁面的查詢按鈕的 click 事件: begin with adoquery1 do begin close。 。 if =true then begin (39。select * from 出庫表 where ckrq=:b39。)。 (39。b39。).Value:=datetostr()。 end else if =true then begin (39。select * from 出庫表 where hwmc=39。39。39。++39。39。39。39。)。 end else if =true then begin (39。select * from 出庫表 where dhh=39。39。39。++39。39。39。39。)。 end else begin (39。select * from 出庫表 where chck=39。39。39。++39。39。39。39。)。 end。 open。 end。 end。 附錄 退貨管理模塊程序清單 添加退貨單窗體保存按鈕的 click 事件: var num,s:integer。 begin with adoquery1 do begin close。 。 (39。insert into 退貨表 (bh,thrq,khmc,cpmc,pp,dhh,dw,dj,sl,zj,czr,bz) values(:a,:b,:c,:d,:l,:e,:f,:g,:h,:i,:j,:k)39。)。 (39。a39。).Value:=trim()。 (39。b39。).Value:=datetostr()。 (39。c39。).Value:=trim()。 (39。d39。).Value:=trim()。 (39。l39。).Value:=trim()。 (39。e39。).Value:=trim()。 (39。f39。).Value:=trim()。 (39。g39。).Value:=strtofloat()。 (39。h39。).Value:=strtoint()。 (39。i39。).Value:=strtofloat()。 (39。j39。).Value:=trim()。 (39。k39。).Value:=trim()。 。 end。 with adoquery1 do begin close。 。 (39。select * from 庫存表 where dhh=:e39。)。 (39。e39。).Value:=trim()。 open。 if recordcount0 then begin num:=(39。xykc39。).AsInteger。 s:=num+strtoint()。 close。 。 (39。update 庫存表 set sl=:s where dhh=:a39。)。 (39。s39。).Value:=s。 (39。a39。).Value:=trim()。 execsql。 end else begin with adoquery1 do begin close。 。 (39。insert into 庫存表 (dhh,cpmc,pp,xykc) values(:a,:b,:c,:d)39。)。 (39。a39。).Value:=trim()。 (39。b39。).Value:=trim()。 (39。c39。).Value:=trim()。 (39。d39。).Value:=strtoint()。 execsql。 end。 showmessage(39。入庫成功! 39。)。 end。 end。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 end。 退庫查詢頁面查詢按鈕的 click 事件: begin with adoquery1 do begin close。 。 if =true then begin (39。select * from 退貨表 where thrq=:c39。)。 (39。c39。).Value:=datetostr()。 end else if =true then begin (39。select * from 退貨表 where cpmc=39。39。39。++39。39。39。39。)。 end else begin (39。select * from 退貨表 where dhh=39。39。39。++39。39。39。39。)。 end。 open。 end。 end。 附錄 庫存管理模塊程序清單 庫存查詢頁面查詢按鈕的 click 事件: begin with adoquery1 do begin close。 。 if =true then begin (39。select * from 庫存表 where dhh=39。39。39。++39。39。39。39。)。 end else if =true then begin (39。select * from 庫存表 where cpmc=39。39。39。++39。39。39。39。)。 end else begin (39。select * from 庫存表 where pp=39。39。39。++39。39。39。39。)。 end。 open。 end。 end。 庫存報警頁面 查詢按鈕的 click 事件: var a,b:integer。 begin with adoquery1 do begin close。 。 (39。select * from 庫存表 39。)。 open。 a:=(39。xykc39。).AsInteger。 b:=(39。zxkc39。).AsInteger。 if ab then begin :=(39。xykc39。).AsString。 showmessage(39。該商品庫存不足,請及時補(bǔ)貨! 39。)。 end else begin :=(39。xykc39。).AsString。 showmessage(39。該商品庫存適中! 39。)。 end。 end。 end。 附錄 報表生成模塊程序清單 (1)入庫信息報表 begin 。 :=39。入庫報表 .rav39。 。 。 end。 (2)出庫信息報表 begin 。 :=39。出庫報表 .rav39。 。 。 end。 (3)退庫信息報表 begin 。 :=39。退庫報表 .rav39。 。 。 end。 (4)庫存信息報表 begin 。 :=39。庫存報表 .rav39。 。 。 end。 附錄 系統(tǒng)維護(hù)模塊程序清單 (1)數(shù)據(jù)備份: var m:integer。 begin //進(jìn)行數(shù)據(jù)備份操作 path:=extractfiledir()。 path:=path+39。\39。 name:=39。databack\39。+formatdatetime(39。yyyymmddhhmmss39。,now)+39。.bak39。 p:=path+name。 :=39。正在備份數(shù)據(jù) ...39。 begin with adoquery1 do begin try :=crHourGlass。 close。 。 (39。 BACKUP DATABASE CKGL TO DISK =39。+39。39。39。39。+P+39。39。39。39。)。 execsql。 for m:=0 to 10000 do :=m。 := crDefault。 (39。 數(shù)據(jù)庫備份成功完成 39。,39。 數(shù)據(jù)庫備份39。,0+mb_iconinformation)。 :=0。 except := crDefault。 (39。數(shù)據(jù)庫備份失??!請檢查備份路徑或網(wǎng)絡(luò)狀態(tài)39。,39。數(shù)據(jù)庫備份 39。,0+mb_iconinformation)。 exit。 end。 end。 end。 :=39。備份數(shù)據(jù) 39。 end。 (2)數(shù)據(jù)恢復(fù) var path:string。 N:integer。 begin 。 :=False。 :=39?;謴?fù)數(shù)據(jù) 39。 messagebox(,39。請在恢復(fù)前將所有與該數(shù)據(jù)庫連接的程序關(guān)閉,以免恢復(fù)失敗 39。,39。提示信息 39。,mb_iconinformation)。 :=39。(備份文件 )|*.bak39。 :=extractfiledir()+39。\databack\39。 if then path:=。 if path39。39。 then if messagebox(,39。確定要恢復(fù)數(shù)據(jù)庫嗎?這樣會覆 蓋現(xiàn)在的數(shù)據(jù)。 39。,39。提示信息 39。,mb_yesno+mb_iconquestion)=idyes then begin :=39。正在恢復(fù)數(shù)據(jù) ...39。 with adoquery1 do begin TRY try close。 。 (39。use master restore database ckglxt from disk=39。+39。39。39。39。+ Trim(path)+39。39。39。39。)。 ExecSQL()。 for N:=0 to 100 do :=N。 messagebox(,39。數(shù)據(jù)恢復(fù)成功 39。,39。提示信息 39。,mb_iconinformation)。 :=0。 except messagebox(,39。數(shù)據(jù)恢復(fù)失敗 39。,39。提示信息 39。,mb_iconinformation)。 end。 Finally with adoquery2 do begin Close。 。 (39。USE clglxt39。)。 ExecSQL。 end。 end。 end。 end