【正文】
conquestion+mb_yesno)=IDNo then Exit。 for i:= to do := i。 CopyFile(PChar(),PChar(DataFile),true)。 Messagebox(handle,39。數(shù)據(jù)庫還原成功!39。,39。還原數(shù)據(jù)39。,mb_iconinformation+mb_ok)。 except浙江工業(yè)大學(xué)??飘厴I(yè)設(shè)計論文34 Messagebox(handle,39。警告:數(shù)據(jù)庫還原失敗!39。,39。讀取錯誤39。,mb_iconwarning+mb_ok)。 end。end。procedure (Sender: TObject)。beginclose。end。end.Login_Form: TLogin_Form。implementationuses Main。{$R *.dfm}procedure (Sender: TObject)。var ADOQuery1: TADOQuery。 sqlstr:string。beginADOQuery1:= (self)。 :=39。Provider=。Data Source=39。+extractfilepath()+39。\date\。Persist Security Info=False39。(39。select * from use_t39。)。with adoquery1 do begin close。 。 sqlstr:=39。select * from use_t where 1=139。 if ((39。39。)and (39。39。)) then begin sqlstr:=sqlstr+39。and use_name=39。39。39。++39。39。39。39。 sqlstr:=sqlstr+39。and use_psw=39。39。39。++39。39。39。39。 (sqlstr)。 prepared。 open。 if recordcount0 then begin UseName:=[1].asstring。 UseType:=[3].asinteger。 sndplaysound(pchar(GetCurrentDir+39。\sound\39。),snd_async)。浙江工業(yè)大學(xué)??飘厴I(yè)設(shè)計論文35 freeandnil(adoquery1)。 。 end else begin showmessage(39。密碼或用戶名不正確 39。)。 i:=i+1。 if i=3 then begin showmessage(39。你是非法用戶,請不要盜用別人的軟件39。)。 。 end。 end。 end else begin if =39。39。 then showmessage(39。用戶名不能為空 39。)。 if =39。39。then showmessage(39。密碼不能為空 39。)。 end。 end。end。procedure (Sender: TObject)。begin。end。procedure (Sender: TObject)。varadoquery2:tadoquery。begini:=0。ADOQuery2:= (self)。 :=39。Provider=。Data Source=39。+extractfilepath()+39。\date\。Persist Security Info=False39。(39。select * from use_t39。)。 with adoquery2 do begin if not active then open。 first。浙江工業(yè)大學(xué)??飘厴I(yè)設(shè)計論文36 while not Eof do begin ([1].asstring)。 next。 end。 end。 := 0。 freeandnil(adoquery2)。end。end.PType_Form: TPType_Form。implementationuses datamodule。{$R *.dfm}procedure (Sender: TObject)。begin:=false。end。procedure (Sender: TObject)。begin :=false。 :=false。 :=true。 。end。procedure (Sender: TObject)。begin:=true。:=false。:=false。end。procedure (Sender: TObject)。begin try 。 except浙江工業(yè)大學(xué)??飘厴I(yè)設(shè)計論文37 on exception do begin showmessage(39。保存不成功 39。)。 。 end。 end。 :=false。 :=true。 :=true。 :=true。end。procedure (Sender: TObject)。varret:integer。k:integer。begin ret:=messagebox(0,39。警告:將刪除該類型和他所對應(yīng)的所有商品??39。,39。不可恢復(fù)的刪除確定39。,52)。 if ret=idyes then begin k:=strtoint()。 with do begin mandtext:=39。delete from produce_t where p_type=:i39。 [39。i39。]:=k。 execute。 end。 。 end。end。procedure (Sender: TObject)。beginif not then :=true。end。procedure (Sender: TObject)。begin 。end。procedure (Sender: TObject)。begin浙江工業(yè)大學(xué)??飘厴I(yè)設(shè)計論文38。end。end.Put_Form: TPut_Form。implementationuses datamodule。{$R *.dfm}procedure (Sender: TObject)。begin:=true。:=true。end。procedure (Sender: TObject)。begin if ((=39。39。) or (=39。39。) or (=39。39。) or (=39。39。) or (=39。39。)) then showmessage(39。信息或數(shù)據(jù)不完整,添加失敗 !!39。) else begin try with adoquery1 do begin insert。 [1].asinteger:=strtoint()。 [2].asstring:=。 [3].AsVariant:=strtofloat()。 [4].asstring:=。 [5].asinteger:=strtoint()。 [6].asinteger:=strtoint()。 [7].AsDateTime:=date。 [8].asinteger:=0。 post。 end。 :=false。 except on exception do begin showmessage(39。商品已存在或者是數(shù)據(jù)類型不合適,請修改后再提交39。)。 。 end。 end。 end。浙江工業(yè)大學(xué)??飘厴I(yè)設(shè)計論文39end。procedure (Sender: TObject)。begin with adotable1 do begin tablename:=39。produce_type_t39。 if not active then active:=true。 first。 。 。 end。 while not do begin ([0].asstring)。 ([1].asstring)。 。 end。 :=0。 :=0。end。procedure (Sender: TObject)。varsqls:string。begin :=。 if not then :=true。 begin with adoquery1 do begin close。 。 sqls:=39。select * from produce_t where p_type=:i39。 (sqls)。 [39。i39。]:=strtoint()。 open。 end。 end。end。procedure (Sender: TObject)。varsqls:string。浙江工業(yè)大學(xué)??飘厴I(yè)設(shè)計論文40begin:=。 if not then :=true。 begin with adoquery1 do begin close。 。 sqls:=39。select * from produce_t where p_type=:i39。 (sqls)。 [39。i39。]:=strtoint()。 open。 end。 end。end。procedure (Sender: TObject)。beginif then 。if then 。close。end。procedure (Sender: TObject)。begin:=false。end。procedure (Sender: TObject)。begin:=true。end。procedure (Sender: TObject)。beginif then:=false。end。procedure (Sender: TObject)。浙江工業(yè)大學(xué)??飘厴I(yè)設(shè)計論文41begin。end。procedure (Sender: TObject)。begin。end。procedure (Sender: TObject)。varsqls:string。Parami:tparameter。begin if (=39。39。) and (=39。39。) then showmessage(39。請輸入要查詢的關(guān)鍵字 39。) else begin with adoquery1 do begin close。 。 sqls:=39。select * from produce_t where 1=139。 if 39。39。 then sqls:=sqls+39。and p_name=39。39。39。++39。39。39。39。 if 39。39。 then begin sqls:=sqls+39。and p_id=:id39。 。 Parami:=。 //創(chuàng)建參數(shù) 1 :=39。id39。 :=strtoint()。 end。 (sqls)。 Prepared。 open。 if recordcount=0 then showmessage(39。對不起,該商品不在 39。)。 end。 end。en