




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、課程設(shè)計(jì)設(shè)計(jì)題目: 超市銷(xiāo)售管理系統(tǒng) 學(xué)生姓名: 潘 小 濤 學(xué) 號(hào): 20052408 專(zhuān)業(yè)班級(jí):計(jì)算機(jī)科學(xué)與技術(shù)05-2班2008年 9月23日一設(shè)計(jì)要求1信息要求本系統(tǒng)至少應(yīng)該包含超市所有貨物管理相關(guān)的根本信息,包括進(jìn)貨信息和銷(xiāo)售信息等。它們都應(yīng)該包括商品貨物的根本信息如員商品編號(hào)、商品名稱(chēng)、規(guī)格、產(chǎn)地、單位、進(jìn)價(jià)、批發(fā)價(jià)、零售價(jià)等和客戶(hù)的根本信息如客戶(hù)編號(hào)、客戶(hù)名稱(chēng)、聯(lián)系人、聯(lián)系 、地址、客戶(hù)信箱、銀行帳號(hào)等。2功能要求本系統(tǒng)的根本功能要求如下:進(jìn)貨商品的信息維護(hù)包括簡(jiǎn)單查詢(xún)、修改、刪除和添加等功能;銷(xiāo)售商品的信息維護(hù)包括簡(jiǎn)單查詢(xún)、修改、刪除和添加等功能;客戶(hù)的信息維護(hù)包括簡(jiǎn)單查詢(xún)、修
2、改、刪除和添加等功能;系統(tǒng)用戶(hù)的信息維護(hù)包括簡(jiǎn)單查詢(xún)、修改、刪除、添加和權(quán)限分配等功能;系統(tǒng)信息備份、復(fù)原;二軟件環(huán)境及開(kāi)發(fā)工具1個(gè)人電腦及Win XP Pro23SQL Server 2000三需求分析對(duì)該超市銷(xiāo)售管理系統(tǒng)進(jìn)行深入的業(yè)務(wù)流程分析后畫(huà)出數(shù)據(jù)流圖。由數(shù)據(jù)流圖圖可以看出來(lái),每個(gè)操作員查看信息前必須先登錄這個(gè)管理系統(tǒng),每個(gè)操作員的信息保存在操作員信息表中。用戶(hù)登錄系統(tǒng)后可以查看商品進(jìn)銷(xiāo)管理信息和客戶(hù)信息,也可以通過(guò)查詢(xún)選擇自己希望得到的信息。四數(shù)據(jù)庫(kù)設(shè)計(jì)1概念設(shè)計(jì)根據(jù)需求分析的結(jié)果,得到的用ER圖表示的概念設(shè)計(jì)結(jié)果如下列圖所示銷(xiāo)售調(diào)整進(jìn)貨調(diào)整商品信息查詢(xún)刪除用戶(hù)修改用戶(hù)信息添加新用戶(hù)
3、刪除客戶(hù)修改客戶(hù)信息添加新客戶(hù)添加新商品修改商品信息刪除商品超市銷(xiāo)售信息管理系統(tǒng)商品信息管理客戶(hù)信息管理用戶(hù)信息管理銷(xiāo)售管理查詢(xún)銷(xiāo)售信息管理庫(kù)存量調(diào)整2邏輯設(shè)計(jì)根據(jù)分析,整個(gè)銷(xiāo)售系統(tǒng)系統(tǒng)需要的數(shù)據(jù)表如下:商品信息:商品編號(hào)、商品名稱(chēng)、規(guī)格、產(chǎn)地、單位、進(jìn)價(jià)、批發(fā)價(jià)、零售價(jià)等;客戶(hù)信息:客戶(hù)編號(hào)、客戶(hù)名稱(chēng)、聯(lián)系人、聯(lián)系 、地址、客戶(hù)信箱、銀行帳號(hào)等;操作員信息:操作員編號(hào)、操作員姓名、操作員密碼、操作員級(jí)別等;銷(xiāo)售信息:銷(xiāo)售號(hào)、客戶(hù)編號(hào)、客戶(hù)名、商品編號(hào)、商品名稱(chēng)、單價(jià)、數(shù)量、金額、銷(xiāo)售時(shí)間等。五系統(tǒng)設(shè)計(jì)由于這個(gè)超市銷(xiāo)售信息管理系統(tǒng)是一個(gè)比擬小型的數(shù)據(jù)庫(kù)系統(tǒng),只需要儲(chǔ)存文本信息,都是小字段的問(wèn)題
4、,作為一個(gè)小型的數(shù)據(jù)庫(kù)系統(tǒng),數(shù)據(jù)量最多在百至千條左右,故采用微軟的SQL Server作為后臺(tái)數(shù)據(jù)庫(kù),使用SQL語(yǔ)言進(jìn)行操作。操作員信息表,包括了操作員編號(hào)、操作員姓名、操作員密碼和操作員級(jí)別,其中操作員編號(hào)是主碼:商品信息表,商品編號(hào)、商品名稱(chēng)、規(guī)格、產(chǎn)地、單位、進(jìn)價(jià)、批發(fā)價(jià)、零售價(jià)等,其中商品編號(hào)是主碼:客戶(hù)信息表,包括客戶(hù)編號(hào)、客戶(hù)名稱(chēng)、聯(lián)系人、聯(lián)系 、地址、客戶(hù)信箱、銀行帳號(hào)等。其中客戶(hù)編號(hào)是主碼:銷(xiāo)售信息表,包括銷(xiāo)售號(hào)、客戶(hù)編號(hào)、客戶(hù)名、商品編號(hào)、商品名稱(chēng)、單價(jià)、數(shù)量、金額、銷(xiāo)售時(shí)間等,其中銷(xiāo)售號(hào)是主碼:庫(kù)存信息表,包括商品編號(hào)、商品名稱(chēng)、庫(kù)存數(shù)量、庫(kù)存金額等,其中商品編號(hào)是主碼:六
5、系統(tǒng)操作說(shuō)明和運(yùn)行結(jié)果翻開(kāi)Project.exe,出現(xiàn)登陸界面:輸入正確用戶(hù)名和密碼后進(jìn)入系統(tǒng),否那么出現(xiàn)錯(cuò)誤提示:系統(tǒng)主界面:商品信息管理界面:客戶(hù)信息管理界面:操作員信息管理界面:銷(xiāo)售查詢(xún)界面:銷(xiāo)售管理界面:庫(kù)存量調(diào)整界面:七程序清單由于系統(tǒng)是圖形化的信息管理系統(tǒng),故使用Delphi實(shí)現(xiàn)。程序清單過(guò)于冗長(zhǎng),在此僅列出其中關(guān)鍵局部。1. 用戶(hù)登錄局部:procedure TForm1.BitBtn1Click(Sender: TObject);var username,userpass,sqlstr:string;begin username:=trim(edit1.Text); userp
6、ass:=trim(edit2.Text); sqlstr:=select *from 操作員信息表 where (操作員姓名=+username+)and(操作員密碼=+userpass+) ; adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(sqlstr); adoquery1.Open; if adoquery1.RecordCount0 then begin self.Visible:=false; b:=true; application.CreateForm(Tmainn,mainn);owModal; mainn.F
7、ree; close;end else begin if i 3 then begin Application.MessageBox(用戶(hù)名稱(chēng)或密碼不正確,請(qǐng)重新輸入。,提示,0+64); Edit1.Clear; Edit2.Clear; Edit1.SetFocus; Inc(i); end else begin Application.MessageBox(對(duì)不起,您無(wú)權(quán)使用本系統(tǒng)。,提示,0+64); Application.Terminate ; end; end;end;procedure TForm1.BitBtn2Click(Sender: TObject);begin clo
8、se;end;procedure TForm1.FormClose(Sender: TObject);begin if b=false then application.Terminate;end;procedure TForm1.FormCreate(Sender: TObject);beginend;end. 2. 商品信息管理代碼:var spinfor: Tspinfor;implementation$R *.dfmprocedure tspinfor.editvalue;begin edit1.Text:=inttostr(adoquery1.fieldbyname(商品編號(hào)).Va
9、lue); edit2.Text:=adoquery1.fieldbyname(商品名稱(chēng)).Value; edit3.Text:=adoquery1.fieldbyname(規(guī)格).Value; edit4.Text:=adoquery1.fieldbyname(產(chǎn)地).Value; edit5.Text:=adoquery1.fieldbyname(單位).Value; edit6.Text:=floattostr(adoquery1.fieldbyname(進(jìn)價(jià)).Value); edit7.Text:=floattostr(adoquery1.fieldbyname(批發(fā)價(jià)).Value
10、); edit8.Text:=floattostr(adoquery1.fieldbyname(零售價(jià)).Value);end;procedure Tspinfor.formshow(Sender: TObject);begin adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(select *from 商品根底信息表); adoquery1.Open; adoquery1.First; editvalue; bitbtn4.Enabled:=false;end;procedure tspinfor.clearedit;begin
11、edit1.Clear; edit2.Clear; edit3.Clear; edit4.Clear; edit5.Clear; edit6.Clear; edit7.Clear; edit8.Clear;end ;procedure Tspinfor.BitBtn1Click(Sender: TObject);begin if not adoquery1.bof then begin adoquery1.Prior; self.editvalue; end else bitbtn1.Enabled:=false; bitbtn2.Enabled:=true;end;procedure Tsp
12、infor.BitBtn2Click(Sender: TObject);begin if not adoquery1.Eof then begin adoquery1.Next; editvalue; end else bitbtn2.Enabled:=false; bitbtn1.Enabled:=true;end;Btn3Click(Sender: TObject);var i:integer;begin clearedit; adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(select max(商品編號(hào)) as ss fro
13、m 商品根底信息表) ; adoquery1.Open; i:=adoquery1.FieldByName(ss).Value+1; edit1.Text:=inttostr(i); edit2.SetFocus; bitbtn4.Enabled:=true;end;procedure Tspinfor.BitBtn4Click(Sender: TObject);begin if (edit1.Text)and (edit2.Text)and (edit3.Text)and (edit4.Text)and (edit5.Text)and (edit6.Text)and (edit7.Text)
14、and (edit8.Text) then begin adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(insert 商品根底信息表 values(:a,:b,:c,:d,:e,:f,:g,:h) ); adoquery1.Parameters.ParamByName(a).Value:=strtoint(edit1.Text); adoquery1.Parameters.ParamByName(b).Value:=edit2.Text;aramByName(c).Value:=edit3.Text; adoquery1.Para
15、meters.ParamByName(d).Value:=edit4.Text; adoquery1.Parameters.ParamByName(e).Value:=edit5.Text; adoquery1.Parameters.ParamByName(f).Value:=strtofloat(edit6.Text); adoquery1.Parameters.ParamByName(g).Value:=strtofloat(edit7.Text); adoquery1.Parameters.ParamByName(h).Value:=strtofloat(edit8.Text); ado
16、query1.ExecSQL; showmessage(the save operation is succeed!); self.formshow(sender); end else showmessage(please fill in the blank completely!);end;procedure Tspinfor.BitBtn5Click(Sender: TObject);begin if (edit1.Text)and (edit2.Text)and (edit3.Text)and (edit4.Text)and (edit5.Text)and (edit6.Text)and
17、 (edit7.Text)and (edit8.Text) then begin adoquery1.Edit; adoquery1.fieldbyname(商品編號(hào)).Value:=strtoint(edit1.Text); adoquery1.fieldbyname(商品名稱(chēng)).Value:=edit2.Text; adoquery1.fieldbyname(規(guī)格).Value:=edit3.Text; adoquery1.fieldbyname(產(chǎn)地).Value:=edit4.Text; adoquery1.fieldbyname(單位).Value:=edit5.Text; adoq
18、uery1.fieldbyname(進(jìn)價(jià)).Value:=strtofloat(edit6.Text); adoquery1.fieldbyname(批發(fā)價(jià)).Value:=strtofloat(edit7.Text); adoquery1.fieldbyname(零售價(jià)).Value:=strtofloat(edit8.Text);st; showmessage(the amend operation is succeed!) ; end else showmessage(please fill in the blank completely!);end;procedure Tspinfor
19、.BitBtn6Click(Sender: TObject);begin if edit1.Text then begin if application.MessageBox(do you really want to delete the item ?,hint,mb_yesno)=id_yes then begin adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(delete from 商品根底信息表 where 商品編號(hào)=:a) ; adoquery1.Parameters.ParamByName(a).Value:=str
20、toint(edit1.Text); adoquery1.ExecSQL; showmessage(the delete operation is succeed!); self.formshow(sender); end end else showmessage(please fill in the commodity number blank!);end;procedure Tspinfor.BitBtn7Click(Sender: TObject);begin self.formshow(sender);end;procedure Tspinfor.Panel3Click(Sender:
21、 TObject);beginend;end.3. 銷(xiāo)售管理代碼:procedure TForm6.FormShow(Sender: TObject);begin adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(select * from 銷(xiāo)售表); adoquery1.Open; bitbtn2.Enabled:=false;end;procedure TForm6.BitBtn1Click(Sender: TObject);var i:integer;begin adoquery1.Close; adoquery1.SQL.C
22、lear; adoquery1.SQL.Add(select max(銷(xiāo)售號(hào)) as ss from 銷(xiāo)售表); adoquery1.Open; i:=adoquery1.FieldByName(ss).Value+1; edit1.Text:=inttostr(i); edit2.SetFocus; self.FormShow(sender); bitbtn2.Enabled:=true;end;procedure TForm6.BitBtn2Click(Sender: TObject);begin if (edit1.Text)and (edit2.Text)and (edit3.Text
23、)and (edit4.Text)and (edit5.Text)and (edit6.Text)and (edit7.Text)and (edit8.Text) then begin adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(insert 銷(xiāo)售表 values(:a,:b,:c,:d,:e,:f,:g,:h,:i); adoquery1.Parameters.ParamByName(a).Value:=strtoint(edit1.Text); adoquery1.Parameters.ParamByName(b).Val
24、ue:=strtoint(edit2.Text); adoquery1.Parameters.ParamByName(d).Value:=strtoint(edit4.Text); adoquery1.Parameters.ParamByName(e).Value:=edit5.Text; adoquery1.Parameters.ParamByName(f).Value:=strtofloat(edit6.Text); adoquery1.Parameters.ParamByName(g).Value:=strtofloat(edit7.Text); adoquery1.Parameters
25、.ParamByName(h).Value:=strtofloat(edit8.Text); adoquery1.Parameters.ParamByName(i).Value:=datetimepicker1.Date; adoquery1.ExecSQL; showmessage(the save operation is succeed!); self.formshow(sender); end else showmessage(please fill in the blank completely!);end;procedure TForm6.BitBtn3Click(Sender:
26、TObject);begin if (edit1.Text)and (edit2.Text)and (edit3.Text)and (edit4.Text)and (edit5.Text)and (edit6.Text)and (edit7.Text)and (edit8.Text) then begin if application.MessageBox(do you really want to amend the item ,hint,mb_yesno)=id_yes then begin adoquery1.Edit; adoquery1.fieldbyname(銷(xiāo)售號(hào)).Value:
27、=strtoint(edit1.Text); adoquery1.fieldbyname(客戶(hù)編號(hào)).Value:=strtoint(edit2.Text); adoquery1.fieldbyname(客戶(hù)名).Value:=edit3.Text; adoquery1.fieldbyname(商品編號(hào)).Value:=strtoint(edit4.Text); adoquery1.fieldbyname(商品名稱(chēng)).Value:=edit5.Text; adoquery1.fieldbyname(單價(jià)).Value:=strtofloat(edit6.Text); adoquery1.fie
28、ldbyname(數(shù)量).Value:=strtofloat(edit7.Text); adoquery1.fieldbyname(金額).Value:=strtofloat(edit8.Text); adoquery1.fieldbyname(銷(xiāo)售時(shí)間).Value:=datetimepicker1.Date; adoquery1.Post; self.formshow(sender); showmessage(the amend operation is succeed!) ; end end else showmessage(please fill in the blank comple
29、tely!);end;procedure TForm6.BitBtn4Click(Sender: TObject);begin if edit1.Text then begin if application.MessageBox(do you really want to delete the item ,hint,mb_yesno)=id_yes then begin adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(delete from 銷(xiāo)售表 where 銷(xiāo)售號(hào)=:a) ; adoquery1.Parameters.Para
30、mByName(a).Value:=strtoint(edit1.Text); adoquery1.ExecSQL; self.formshow(sender); end end else showmessage(please fill in the sell number blank!);end;procedure TForm6.BitBtn5Click(Sender: TObject);begin self.FormShow(sender);end;procedure TForm6.Panel1Click(Sender: TObject);beginend;end.4. 銷(xiāo)售查詢(xún)代碼:pr
31、ocedure TForm5 bobox1change(Sender: TObject);begin if Trim(ComboBox1.Text)then begin ADOQuery1.Close; ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add(select distinct); ADOQuery1.SQL.Add(Trim(ComboBox1.Text); ADOQuery1.SQL.Add(from 銷(xiāo)售表 ); ADOQuery1.Open; ComboBox2.Clear; while Not ADOQuery1.Eof do begin Combo
32、Box2.Items.Add(ADOQuery1.Fields0.value); ADOQuery1.Next; end; end;end;procedure TForm5.SpeedButton1Click(Sender: TObject);begin if (Trim(ComboBox2.Text)and(Trim(ComboBox1.Text) then begin CheckBox1.Checked := False; adoquery1.close; adoquery1.SQL.Clear; if CheckBox2.Checked = False then begin adoque
33、ry1.SQL.Add(select * from 銷(xiāo)售表 where ); adoquery1.SQL.Add(Trim(ComboBox1.Text); adoquery1.SQL.Add(=); adoquery1.SQL.Add(:a); end else begin adoquery1.SQL.Add(Select * from 銷(xiāo)售表 where); adoquery1.SQL.Add(Trim(ComboBox1.Text); adoquery1.SQL.Add(=); adoquery1.SQL.Add(:a); adoquery1.SQL.Add(and 銷(xiāo)售時(shí)間=:b an
34、d 銷(xiāo)售時(shí)間= :c); adoquery1.Parameters.ParamByName(b).Value := Int(DateTimePicker1.Date) ; adoquery1.Parameters.ParamByName(c).Value := Int(DateTimePicker2.Date); end; adoquery1.Parameters.ParamByName(a).value := Trim(ComboBox2.Text); adoquery1.Open; end;end;procedure TForm5.CheckBox1Click(Sender: TObjec
35、t);begin adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(Select * from 銷(xiāo)售表 ); adoquery1.Open;end;procedure TForm5.BitBtn1Click(Sender: TObject);begin close;end;procedure TForm5.Panel2Click(Sender: TObject);beginend;end.5. 庫(kù)存量管理代碼:procedure TForm4.formshow(Sender: TObject);begin radiobutton1.
36、Checked:=true; adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add(select Distinct 商品名稱(chēng) from 商品根底信息表 ); adoquery1.Open; while not adoquery1.Eof do begin combobox1.Items.Add(adoquery1.fieldbyname(商品名稱(chēng)).AsString); adoquery1.Next; end ; combobox1.ItemIndex:=0;end;procedure TForm4.BitBtn1Click(Sende
37、r: TObject);beginif (Trim(ComboBox1.Text)and(Trim(ComboBox2.Text)and (Trim(Edit1.Text)and(Trim(Edit2.Text)then begin ADOQuery1.Close; ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add(select * from 庫(kù)存表 where 商品編號(hào) = :a); ADOQuery1.Parameters.ParamByName(a).Value := Trim(ComboBox2.Text); ADOQuery1.Open; if ADOQu
38、ery1.RecordCount0 then begin if radiobutton1.Checked=true then begin ADOQuery1.Close; ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add(update 庫(kù)存表 set 庫(kù)存數(shù)量 = 庫(kù)存數(shù)量 + :a ,庫(kù)存金額 = 庫(kù)存金額 + :b where 商品編號(hào) = :c); ADOQuery1.Parameters.ParamByName(a).Value := StrToInt(Edit1.Text); ADOQuery1.Parameters.ParamByName(b).Value := StrToFloat(Edit2.Text); ADOQuery1.Parameters.ParamByName(c).Value := Trim(ComboBox2.Text); ADOQuery1.ExecSQL; end else begin
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 結(jié)腸癌護(hù)理常規(guī)
- 小區(qū)交付施工方案
- 2026版《全品高考》選考復(fù)習(xí)方案物理01 課時(shí)作業(yè)(一) 走近細(xì)胞含答案
- 如何發(fā)現(xiàn)胃腸腫瘤信號(hào)
- 圖書(shū)英文面試題及答案
- 幼兒快樂(lè)生活健康成長(zhǎng)
- 園林會(huì)計(jì)面試題及答案
- 前廳部考試題及答案
- 幼兒園健康課課件
- 內(nèi)科主管考試題及答案
- 免疫調(diào)節(jié)治療在腦卒中的運(yùn)用課件
- DB32∕T 186-2015 建筑消防設(shè)施檢測(cè)技術(shù)規(guī)程
- XX公司“十四五”戰(zhàn)略發(fā)展規(guī)劃及年度評(píng)價(jià)報(bào)告(模板)
- 機(jī)關(guān)檔案管理工作培訓(xùn)PPT課件
- 三寶四口及臨邊防護(hù)安全培訓(xùn)講義
- 油輪、化學(xué)品船的基本知識(shí)
- (高清正版)T_CAGHP 054—2019 地質(zhì)災(zāi)害治理工程質(zhì)量檢驗(yàn)評(píng)定標(biāo)準(zhǔn)(試行)
- 25T汽車(chē)吊檢驗(yàn)報(bào)告
- 變頻空調(diào)中的永磁電機(jī)電感分析
- 高考常考語(yǔ)法填空詞性轉(zhuǎn)換匯總
- AOI自動(dòng)光學(xué)檢測(cè)設(shè)備程序編寫(xiě)
評(píng)論
0/150
提交評(píng)論