【正文】
。 :=39。39。 。end。添加用戶窗口如下所示:該界面之確定按鈕代碼如下:procedure (Sender: TObject)。begin if then begin messagebox(,39。請重新確認新密碼!39。,39。提示39。,mb_iconerror)。 :=39。39。 。 end else begin 。 [1].Value:=。 。 messagebox(,39。您的密碼修改成功!39。,39。信息39。,mb_iconasterisk)。 close。 end。end。(2)修改口令窗口如下所示:設(shè)備管理模塊的設(shè)計(1)設(shè)備資料入庫“確定”按鈕的程序如下:procedure (Sender: TObject)。beginif =39。39。 then begin showmessage(39。該記錄不能為空39。)。 exit。 。 。 end。if length(trim())6 then begin showmessage(39。請輸入6位設(shè)備編號39。)。//判斷設(shè)備編號是否為6位 。 。 exit。 end。with adoquery1 do begin close。 。 (39。select * from 設(shè)備表 where 編號=:id39。)。 (39。id39。).Value:=。 。 if recordcount0 then begin 。 (39。數(shù)量39。).Value :=strtoint()+strtoint((39。數(shù)量39。).asstring)。 (39??偨痤~39。).Value:=strtoint((39。單價39。).asstring)*strtoint((39。數(shù)量39。).asstring)。 (39。編號39。).Value:= 。 (39。設(shè)備名稱39。).Value:= 。 (39。單價39。).Value:=。 post。 end else begin 。 (39。編號39。).Value:= 。 (39。設(shè)備名稱39。).value:= 。 (39。數(shù)量39。).Value:= 。 (39。單價39。).Value:= 。 (39??偨痤~39。).Value:=strtoint()*strtoint() 。 post。 end。with adoquery2 do 。 。 (39。select * from 入庫記錄表39。)。 。 。 。 [0].Value :=。 [1].Value :=。 [2].Value :=。 [3].Value :=strtoint()*strtoint()。 [4].Value :=date。 [5].Value := 。 [6].Value := 。 。end。 。 。 。 。 。 。 。end。該程序為判斷該產(chǎn)品是否在設(shè)備庫中有庫存,如果有庫存,則會使原有的庫存產(chǎn)生改變。(2)設(shè)備資料管理該程序模塊的用法如下:先在左邊選中某個數(shù)據(jù),如果想修改,則點擊修改按鈕,則左邊選中數(shù)據(jù)在右邊顯示出詳細信息。用戶修改之后,點擊保存即可。另外此界面中還實現(xiàn)了查詢、打印功能。具體該程序的代碼如下所示:procedure (Sender: TObject)。//修改按鈕的程序代碼begin :=[0].AsString 。 :=[1].AsString 。 := [2].AsString 。 := [3].AsString 。 := [4].AsString 。end。procedure (Sender: TObject)。//當修改過價格或數(shù)量之后,總金額會智能改變。begin :=inttostr(strtoint( )*strtoint( ))。end。procedure (Sender: TObject)。begin :=inttostr(strtoint( )*strtoint( ))。end。procedure (Sender: TObject)。//保存按鈕的程序代碼如下beginwith adoquery1 do begin 。 end。with adoquery1 do begin close。 with sql do begin clear。 add(39。insert into 設(shè)備表 values(:p0,:p1,:P2,:p3,:p4)39。)。 end。 parameters[0].value:=。 parameters[1].value:=。 parameters[2].value:=。 parameters[3].value:=。 parameters[4].value:=。 execsql。 end。 with adoquery1 do begin close。 with SQL do begin clear。 add(39。select * from 設(shè)備表39。)。 end。 execsql。 open。 end。end。procedure (Sender: TObject)。//刪除記錄beginif (39。確定要刪除這條記錄嗎39。,39。提示39。,mb_okcancel+mb_iconinformation)=id_ok thenwith adoquery1 do if isempty=false then delete。 end。procedure (Sender: TObject)。beginif =39。編號39。 then begin with adoquery1 do begin close。 。 (39。select * from 設(shè)備表 where 編號=:id39。)。 (39。id39。).Value :=。 open。 if recordcount=0 then begin (39。沒有檢索到該設(shè)備信息39。,39。提示39。,mb_ok+mb_iconinformation)。 end。 end。 end。 if =39。設(shè)備名稱39。 then begin with adoquery1 do begin close。 。 (39。select * from 設(shè)備表 where 編號=:d39。)。 (39。d39。).Value :=。 open。 if recordcount=0 then begin (39。沒有檢索到該設(shè)備信息39。,39。提示39。,mb_ok+mb_iconinformation)。 end。 end。 end。 end。procedure (Sender: TObject)。//打印窗口的代碼如下 。end。procedure (Sender: TObject)。begin。 。(39。select * from 設(shè)備表39。)。end。procedure (Sender: TObject)。//刷新begin 。end。打印窗口如下所示:(3)入庫記錄查詢功能為可查詢歷來設(shè)備入庫的具體記錄。界面如下所示:可按照入庫時間來查詢。程序代碼如下所示:procedure (Sender: TObject)。begininherited。with adoquery1 dobegin close。 。 (39。select * from 入庫記錄表 where 入庫日期=:id 39。)。 .parambyname(39。id39。).value:=datetostr( )。 。 。 end。end。(4)設(shè)備資料出庫功能為對設(shè)備庫中的設(shè)備出庫操作。界面如下所示:該模塊具有智能化,會根據(jù)你輸入的設(shè)備編號,自動得出設(shè)備名稱。程序代碼具體如下:procedure (Sender: TObject)。beginif =39。39。 then begin showmessage(39。該記錄不能為空39。)。 exit。 。 。 end。if length(trim())6 then begin showmessage(39。請輸入6位設(shè)備編號39。)。 。 。 exit。 end。 with adoquery1 do begin close。 。 (39。select * from 設(shè)備表 where 編號=:id39。)。 (39。id39。).Value:=。 。 if recordcount0 then begin 。 (39。數(shù)量39。).Value :=strtoint((39。數(shù)量39。).asstring)strtoint()。 (39。總金額39。).Value:=strtoint((39。單價39。).asstring)*strtoint((39。數(shù)量39。).asstring)。 (39。編號39。).Value:= 。 (39。設(shè)備名稱39。).Value:= 。 (39。單價39。).Value:=。 post。 end。with adoquery2 do 。 。 (39。select * from 出庫記錄表39。)。 。 。 。 [0].Value :=。 [1].Value :=。 [2].Value :=。 [3].Value :=strtoint()*strtoint()。 [4].Value :=date。 [5].Value := 。 [6].Value := 。 。end。 。 。 。 。 。 。 。end。procedure (Sender: TObject)。beginclose。end。procedure (Sender: TObject)。begin with adoquery1 do begin 。 。 (39。select * from 設(shè)備表 where 編號=:id39。)。 (39。id39。).Value:=。 。 if recordcount0 then begin :=(39。設(shè)備名稱39。).AsString 。 :=(39。單價39。).AsString 。 end else begin showmessage(39。無此設(shè)備編號,請查實再來!退出請按右上角的X按鈕!39。)。 。 exit。 end。 end。end。(5)出庫記錄查詢該項功能可以查詢歷來出庫記錄。具體界面及設(shè)計如下所示:對確定按鈕的編程如下:procedure (Sender: TObject)。begininherited。with adoquery1 dobegin close。 。 (39。select * from 出庫記錄表 where 入庫日期=:id 39。)。 .parambyname(39。id39。).value:=datetostr( )。 。 。 end。end。(6)設(shè)備情況瀏覽該模塊為顯示當前庫中所有設(shè)備資料,以及所有入庫記錄及出庫記錄。界面如下所示:(7)關(guān)于模塊關(guān)于窗口如下所示:五、系統(tǒng)要求硬件環(huán)境要求為運行本例,計算機應滿足如下條件:(1)CPU:Intel Pentium 166MHZ或更高主頻的處理器,或任何運行于Microsoft Windows NT Workstation的Alpha處理器。(2)操作系統(tǒng):Microsoft Windows98/me/xp/2000或Microsoft Windows NT Service/Workstation 或更高版本。(3)顯示器:Micorsoft Windows 支持的VGA或分辨率更高的顯示器。(4)內(nèi)存:64MB以上。軟件環(huán)境要求本系統(tǒng)適用于Microsoft Windows 98/2000/XP下開發(fā)的,所采用的開發(fā)工具是Delphi 。所使用的數(shù)據(jù)庫是Access 2000。六、致謝