【正文】
的大力支持和幫助,在此表示衷心的感謝! 服裝管理系統(tǒng)論文 46 參考文獻(xiàn) [1] 啟 明工作室 .Delphi+SQL Server 數(shù)據(jù)庫(kù)應(yīng)用系統(tǒng)開(kāi)發(fā)與實(shí)例 [M].北京: 人民郵電出版社 ,2022 [2] 明日科技、宋坤、鄒天思 .Delphi 數(shù)據(jù)庫(kù)系統(tǒng)開(kāi)發(fā)完全手冊(cè) [M].北京: 人民郵電出版社 , 2022; [3] 求是科技 .Delphi 信息管理系統(tǒng)開(kāi)發(fā)實(shí)例導(dǎo)航 [M].北京: 人民郵電出版社 , 2022 [4] 求是科技、周新會(huì)、周金根 .Delphi 數(shù)據(jù)庫(kù)通用模塊及典型系統(tǒng)開(kāi)發(fā)實(shí)例導(dǎo)航 [M].北京: 人民郵電出版社 , 2022 [5] 王珊、薩師煊 .數(shù)據(jù)庫(kù)系統(tǒng)概論(第四版) [M].北京: 高等教育出版社 , 2022 [6] 鄭阿奇 .SQL Server 實(shí)用教程(第二版) [M].北京: 電子工業(yè)出版社 , 2022 [7] 沈才梁 . Delphi 程序設(shè)計(jì)教程(修訂本) [M].北京:清華大學(xué)出版社, 2022 服裝管理系統(tǒng)論文 47 附錄 1. 登陸界面確定按鈕的代碼 with do//以用戶名和密碼為條件從用戶帳號(hào)表中查詢數(shù)據(jù), //有返回值則輸入正確,否則輸入錯(cuò)誤。 begin close。 。 (39。select * from Yhzhb where(yhm=:a)and(mm=:b)39。)。 (39。a39。).Value:=trim()。 (39。b39。).Value:=trim()。 open。 end。 if 0 then begin czymc:=(39。yhm39。).AsString。 [3].Text:=czymc。 :=(39。jb39。).AsString。 :=czymc。 。 。 。 。 end else begin if i3 then begin (39。用戶名或密碼不正確,請(qǐng)重新輸入! 39。,39。提示 39。,0+64)。 。 。 。 inc(i)。 end else begin (39。對(duì)不起,您無(wú)權(quán)使用本系統(tǒng)! 39。,39。提示 39。,0+64)。 。 end。 end。 2. Dbgrid中信息到文本框的轉(zhuǎn)換,以部門(mén)信息維護(hù)為例 procedure (Column: TColumn)。 begin 服裝管理系統(tǒng)論文 48 :=[0].AsString。 :=[1].AsString。 :=[3].AsString。 end。 3.員工信息添加界面的保存按鈕代碼 procedure (Sender: TObject)。 var picture1:tpicture。 bmbh,sex:string。 begin if trim()=39。39。 then //驗(yàn)證員工編號(hào)是否輸入。未輸入則進(jìn)行提示,若已經(jīng)輸入則驗(yàn)證是否重復(fù)。 begin (39。請(qǐng)輸入員工編號(hào)! 39。,39。提示 39。,64)。 end else begin with do begin close。 。 (39。select * from ygjbxxb where ygbh=:a39。)。 (39。a39。).Value:=trim()。 open。 end。 if 0 then begin (39。該員工編號(hào)已存在! 39。,39。提示 39。,64)。 end else begin if trim()=39。39。 then //驗(yàn)證員工姓名是否已輸入。 begin (39。請(qǐng)輸入員工姓名! 39。,39。提示 39。,64)。 end else begin if trim()=39。39。 then //驗(yàn)證員工所在部門(mén)是否已選擇。若已選擇提取出部門(mén)編號(hào)。 begin (39。請(qǐng)選擇所在部門(mén)! 39。,39。提示 39。,64)。 end else begin with do begin close。 服裝管理系統(tǒng)論文 49 。 (39。select * from bmxxb where bmmc=:a39。)。 (39。a39。).Value:=trim()。 open。 end。 if 0 then begin bmbh:=(39。bmbh39。).AsString。 end。 if then //讀取性別信息。 begin sex:=39。男 39。 end。 if then begin sex:=39。女 39。 end。 if 39。39。 then//驗(yàn)證照片是否已選擇。照片保存方法不同。 //若照片已選擇,保存方法為:先把必要項(xiàng)和照片保存,再利用 update修改以插入其他數(shù)據(jù)。 //若照片未選擇,保存方法為 insert。 begin picture1:=。 (extractfilename())。//獲取照片內(nèi)容。 with do//通過(guò)查詢的方法打開(kāi)數(shù)據(jù)集,便于插入操作。 begin close。 。 (39。select * from ygjbxxb39。)。 open。 insert。 fieldbyname(39。ygbh39。).AsString:=。 fieldbyname(39。ygxm39。).AsString:=。 fieldbyname(39。xb39。).AsString:=sex。 fieldbyname(39。bmbh39。).AsString:=bmbh。 fieldbyname(39。zp39。).Assign(picture1)。 post。//提交。 end。 //以下就是用 update的方法插入其他項(xiàng)。 with do begin close。 。 (39。update ygjbxxb set csrq=:b,tel=:c,zz=:d,bz=:e where ygbh=:a39。)。 (39。a39。).Value:=trim()。 服裝管理系統(tǒng)論文 50 (39。b39。).Value:=formatdatetime(39。yyyymmdd39。,)。 (39。c39。).Value:=trim()。 (39。d39。).Value:=trim()。 (39。e39。).Value:=trim()。 execsql。 end。 begin (39。添加成功! 39。,39。提示 39。,64)。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 end。 end else//未選擇照片時(shí)。 begin with do begin close。 。 (39。insert ygjbxxb (ygbh,ygxm,xb,bmbh,csrq,tel,zz,bz) values(:a,:b,:c,:d,:e,:f,:g,:h)39。)。 (39。a39。).Value:=trim()。 (39。b39。).Value:=trim()。 (39。c39。).Value:=sex。 (39。d39。).Value:=bmbh。 (39。e39。).Value:=。 (39。f39。).Value:=trim()。 (39。g39。).Value:=trim()。 (39。h39。).Value:=trim()。 execsql。 end。 begin (39。添加成功 ! 39。,39。提示 39。,64)。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 :=39。39。 服裝管理系統(tǒng)論文 51 end。 end。 end。 end。 end。 end。 end。 4.員工信息修改界面的保存按鈕代碼 procedure (Sender: TObject)。 var picture1:tpicture。 bmbh,sex:string。 begin if trim()=39。39。 then begin (39。員工姓名不 允許為空! 39。,39。提示 39。,64)。 end else begin if trim()=39。39。 then begin (39。所在部門(mén)不允許為空! 39。,39。提示 39。,64)。 end else begin with do begin close。 。 (39。select * from bmxxb where bmmc=:a39。)。 (39。a39。).Value:=trim()。 open。 end。 //讀取部門(mén)編號(hào)。 if 0 then begin bmbh:=(39。bmbh39。).AsString。 end。 //讀取性別信息。 if then begin sex:=39。男 39。 end。