JAVA課程設計產品銷售管理系統(tǒng)_第1頁
JAVA課程設計產品銷售管理系統(tǒng)_第2頁
JAVA課程設計產品銷售管理系統(tǒng)_第3頁
JAVA課程設計產品銷售管理系統(tǒng)_第4頁
JAVA課程設計產品銷售管理系統(tǒng)_第5頁
已閱讀5頁,還剩65頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、課程設計計說明書書 課程程名稱:Javva程序序設計課課程設計計 設計計項目:產品銷銷售管理理系統(tǒng) 學生生姓名: 學 號: 專 業(yè):軟軟件工程程 班 級: 指導導教師:_ 20177年2月任務與具具體要求求建立數據據庫:產產品庫(產品IID、名名稱、規(guī)規(guī)格等),銷售售員庫(銷售員員ID、姓名、性別、電話等等),銷銷售記錄錄庫(銷銷售日期期、銷售售產品IID、售售出數量量、單價價、銷售售員IDD等)。實現現對銷售售數據的的輸入、查詢、修改與與維護(例如操操作員管管理、數數據備份份等)等等功能。設計說明明書包括括的內容容需求分析析、系統(tǒng)統(tǒng)功能結結構、軟軟硬件環(huán)環(huán)境、開開發(fā)工具具、數據據庫結構構設計

2、、各個功功能模塊塊的詳細細實現方方法、系系統(tǒng)測試試數據與與結果、設計體體會、參參考文獻獻等應完成的的圖紙系統(tǒng)功能能結構框框架圖、各功能能模塊窗窗口界面面圖、算算法流程程圖、測測試結果果圖等評語及成成績指導教師師(簽字字)_年_月日目錄TOC o 1-3 h z u HYPERLINK l _Toc475094254 1 問問題概述述 1 問問題概述述設計一個個產品銷銷售管理理系統(tǒng),以解決決傳統(tǒng)產產品信息息管理方方式的諸諸多不便便和弊端端。2 系統(tǒng)統(tǒng)需求分分析在客戶的的日常管管理中,經常需需要對產產品的相相關信息息進行處處理,采采用傳統(tǒng)統(tǒng)的手工工記錄,查詢方方式,顯顯然有很很多不便便,如多多次的

3、增增、刪、改可能能使記錄錄變得混混亂,為為今后的的信息提提取帶來來很多麻麻煩。為為了解決決這一問問題,可可采用現現代化的的手段計算算機進行行系統(tǒng)的的管理。這樣可可大大提提高管理理的質量量和效率率,并且且使客戶戶的日常常管理也也從手工工操作中中解脫出出來,減減少紙制制材料的的數量,對日常常信息的的查詢、方便、快捷。因此,基于這這些方面面的考慮慮,決定定開發(fā)本本系統(tǒng)。3 系統(tǒng)統(tǒng)概要設設計3.1系系統(tǒng)的主主要功能能系統(tǒng)的主主要功能能是實現現基本的的客戶的的數據管管理和維維護。主主要包括括:(1)添添加:添添加產品品信息記記錄(2)顯示:顯示產產品信息息記錄(3)刪除:刪除產產品信息息記錄(4)查詢:

4、查詢產產品信息息記錄(5)修改:修改產產品信息息記錄(6)保存:將產品品保存到到數據庫庫3.2 系統(tǒng)的的總體結結構產品數據據庫管理理:顯示全部部產品信信息:將將全部的的產品信信息打印印出來添加產品品記錄信信息:添添加新的的產品記記錄信息息更新產品品記錄信信息:將將已經添添加的產產品信息息進行更更新刪除產品品記錄信信息:將將已經添添加的產產品記錄錄刪除銷售員數數據庫管管理:顯顯示全部部銷售員員息:將將全部的的產品信信息打印印出來查詢銷售售員信息息:通過過ID查查詢銷售售員并將將其信息息打印出出來添加銷售售員記錄錄信息:添加新新的銷售售員信息息更新銷售售員記錄錄信息:將已經經添加的的銷售員員信息進

5、進行更新新刪除銷售售員記錄錄信息:將已經經添加的的銷售員員記錄刪刪除銷售記錄錄數據庫庫管理:顯示全全部銷售售記錄信信息:將將全部的的銷售記記錄信息息打印出出來查詢銷售售記錄信息息:查詢詢銷售記記錄并將將其信息息打印出出來添加銷售售記錄信息息:添加加新的銷銷售記錄錄信息更新銷售售記錄信息息:將已已經添加加的銷售售記錄信息息進行更更新刪除銷售售記錄信息息:將已已經添加加的銷售售記錄刪刪除3.3 系統(tǒng)軟軟硬件環(huán)環(huán)境本程序所所適用的的計算機機系統(tǒng)軟軟硬件環(huán)環(huán)境要求求為:硬件環(huán)境境: PenntiuumIIII5000以上 內存存:2556M軟件環(huán)境境: Winndowws XXP及以上上3.4 數據結

6、結構設計計客戶信息息數據結結構類型型如下:銷售記錄錄包括銷銷售日期期、銷售售產品IID、售售出數量量、單價價、銷售售員IDD,定義義方式如如下:privvatee Sttrinng ssaleesDaate;privvatee Inntegger prooducctIDD;privvatee Sttrinng ssaleesVoolummes;privvatee Sttrinng ssaleesPrricee;privvatee Inntegger sallesIID;產品信息息包括產產品IDD、名稱稱、規(guī)格格,定義義方式如如下:privvateeinttprooducctIDD;privva

7、tee Sttrinng prooducctNaame;privvatee Sttrinng prooducctSppeciificcatiionss;銷售員信信息包括括銷售員員ID、姓名、性別、電話,定義方方式如下下:privvateeinttsallespperssonIID;privvatee Sttrinng sallespperssonNNamee;privvateeinttsaleespeersoonPhhonee;4 系統(tǒng)統(tǒng)的詳細細設計首先聲明明了三個個類分別別存儲三三種不同同的數據據庫的信信息如下下,再通通過一系系列對數數據庫的的操作實實現對數數據的增增、刪、改、查查。4.1產

8、產品信息息管理功能實現現:通過過使用SSQL語語句對數數據庫的的操作進進行對產產品信息息的管理理代碼實現現:packkagee PrroduuctSSysttemOOne;impoort javva.ssql.*;impoort javva.uutill.*;/對產產品的DDaopubllic claass ProoducctDaao /對對產品庫庫的查詢詢操作;pubblicc Liist queery() tthroows SQLLExccepttionnCoonneectiion connn=DDBUttil.gettConnnecctioon();/鏈接數數據庫Sttateemennt

9、 sstmtt=coonn.creeateeStaatemmentt();Sttrinng ssql=seelecct * frrom prooducctdaate;ReesulltSeet rrs=sstmtt.exxecuuteQQuerry(ssql);Liist prooducctLiist=neww ArrrayyLisst();PrroduuctDDatee prroduuctDDatee=nuull;whhilee(rss.neext()pprodducttDatte=nnew ProoducctDaate();pprodducttDatte.ssetPProdducttID(r

10、s.gettIntt(PProdducttID);pprodducttDatte.ssetPProdducttNamme(rrs.ggetSStriing(prroduuctNNamee);pprodducttDatte.ssetPProdducttSpeecifficaatioons(rs.gettStrringg(pprodducttSpeecifficaatioons);pprodducttLisst.aadd(prooducctDaate);reeturrn pprodducttLisst;/對產產品庫進進行IDD查詢pubblicc Liist queeryEEverry( intt

11、 PIID) thrrowss SQQLExxcepptioonCoonneectiion connn=DDBUttil.gettConnnecctioon();/鏈接數數據庫Sttrinng ssql=seelecct * frrom prooducctdaate wheere prooducctIDD=?;PrrepaareddStaatemmentt psst=cconnn.prrepaareSStattemeent(sqll);psst.ssetIInt(1, PIDD);ReesulltSeet rrs=ppst.exeecutteQuueryy();Liist prooducctL

12、iist=neww ArrrayyLisst();PrroduuctDDatee prroduuctDDatee=nuull;whhilee(rss.neext()pprodducttDatte=nnew ProoducctDaate();pprodducttDatte.ssetPProdducttID(rs.gettIntt(PProdducttID);pprodducttDatte.ssetPProdducttNamme(rrs.ggetSStriing(prroduuctNNamee);pprodducttDatte.ssetPProdducttSpeecifficaatioons(rs

13、.gettStrringg(pprodducttSpeecifficaatioons);pprodducttLisst.aadd(prooducctDaate);reeturrn pprodducttLisst;pubblicc vooid adddProoducct(iint PIDD,Sttrinng PPNAMME,SStriing PSPPECIIFICCATIIONSS) tthroows SQLLExccepttionn/對數據據庫的添添加操作作Coonneectiion connn=DDBUttil.gettConnnecctioon();/鏈接數數據庫Sttrinng ssql

14、=innserrt iintoo prroduuctddatee vaaluees ( ?,?,?); PrrepaareddStaatemmentt psst=cconnn.prrepaareSStattemeent(sqll);psst.ssetIInt(1, PIDD);psst.ssetSStriing(2, PNAAME);psst.ssetSStriing(3, PSPPECIIFICCATIIONSS);psst.eexeccuteeUpddatee();/輸輸入你要要更新產產品的IID,進進行修改改你的產產品信息息pubblicc vooid upddateeProoducct

15、(iint PIDD,Sttrinng PPNAMME,SStriing PSPPECIIFICCATIIONSS) tthroows SQLLExccepttionn/更新Coonneectiion connn=DDBUttil.gettConnnecctioon();/鏈接數數據庫Sttrinng ssql=uppdatte pprodducttdatte sset prooducctNaame=? , prroduuctSSpeccifiicattionns=? whheree prroduuctIID=?;PrrepaareddStaatemmentt psst=cconnn.prre

16、paareSStattemeent(sqll);psst.ssetSStriing(1, PNAAME);psst.ssetSStriing(2, PSPPECIIFICCATIIONSS);psst.ssetIInt(3, PIDD);psst.eexeccuteeUpddatee();/輸輸入你要要刪除的的產品的的ID進進行刪除除操作pubblicc vooid dellProoducct(iint PIDD) tthroows SQLLExccepttionn/刪除Coonneectiion connn=DDBUttil.gettConnnecctioon();/鏈接數數據庫Sttrin

17、ng ssql=deelette ffromm prroduuctddatee whheree prroduuctIID=?;PrrepaareddStaatemmentt psst=cconnn.prrepaareSStattemeent(sqll);psst.ssetIInt(1, PIDD);psst.eexeccuteeUpddatee();4.2銷銷售員信信息管理理功能實現現:通過過使用SSQL語語句對數數據庫的的操作進進行對銷銷售員信信息的管管理代碼實現現:packkagee PrroduuctSSysttemOOne;impoort javva.ssql.Connnecctioo

18、n;impoort javva.ssql.PreeparredSStattemeent;impoort javva.ssql.RessulttSett;impoort javva.ssql.SQLLExccepttionn;impoort javva.ssql.Staatemmentt;impoort javva.uutill.ArrrayyLisst;impoort javva.uutill.Itteraatorr;impoort javva.uutill.Liist;publlic claass SallespperssonDDateeDaoo /對對產品庫庫的查詢詢操作;puubliic

19、 LListt quueryy() thrrowss SQQLExxcepptioonCConnnecttionn coonn=DBUUtill.geetCoonneectiion();/鏈接接數據庫庫SStattemeent stmmt=cconnn.crreatteSttateemennt();SStriing sqll=sseleect * ffromm saalessperrsonndatte;RResuultSSet rs=stmmt.eexeccuteeQueery(sqll);LListt saaleSSperrsonnLisst=nnew ArrrayLListt(); SSa

20、leespeersoonDaate salleSpperssonDDatee=nuull;wwhille(rrs.nnextt()salleSpperssonDDatee=neew SSaleespeersoonDaate();salleSpperssonDDatee.seetSaalessperrsonnID(rs.gettIntt(ssaleespeersoonIDD);salleSpperssonDDatee.seetSaalessperrsonnNamme(rrs.ggetSStriing(saalessperrsonnNamme);salleSpperssonDDatee.seetS

21、aalessperrsonnPhoone(rs.gettIntt(ssaleespeersoonPhhonee);salleSpperssonLListt.addd(ssaleeSpeersoonDaate);rretuurn salleSpperssonLListt;/對對產品庫庫進行IID查詢詢puubliic LListt quueryyEveery( innt SSID) thhrowws SSQLEExceeptiionCConnnecttionn coonn=DBUUtill.geetCoonneectiion();/鏈接接數據庫庫SStriing sqll=sseleect *

22、ffromm saalessperrsonndatte wwherre ssaleespeersoonIDD=?;PPreppareedSttateemennt ppst=connn.ppreppareeStaatemmentt(sqql);ppst.settIntt(1, SIID);RResuultSSet rs=pstt.exxecuuteQQuerry();LListt saaleSSperrsonnLisst=nnew ArrrayLListt(); SSaleespeersoonDaate salleSpperssonDDatee=nuull;wwhille(rrs.nnextt(

23、)salleSpperssonDDatee=neew SSaleespeersoonDaate();salleSpperssonDDatee.seetSaalessperrsonnID(rs.gettIntt(ssaleespeersoonIDD);salleSpperssonDDatee.seetSaalessperrsonnNamme(rrs.ggetSStriing(saalessperrsonnNamme);salleSpperssonDDatee.seetSaalessperrsonnPhoone(rs.gettIntt(ssaleespeersoonPhhonee);salleSp

24、perssonLListt.addd(ssaleeSpeersoonDaate);rretuurn salleSpperssonLListt;/對對銷售員員庫的添添加puubliic vvoidd adddSaaleppersson(intt SIID,SStriing SNAAME,intt SPPHONNE) thrrowss SQQLExxcepptioon/對數數據庫的的添加操操作CConnnecttionn coonn=DBUUtill.geetCoonneectiion();/鏈接接數據庫庫SStriing sqll=iinseert intto ssaleespeersoonda

25、ate valluess ( ?,?,?); PPreppareedSttateemennt ppst=connn.ppreppareeStaatemmentt(sqql);ppst.settIntt(1, SIID);ppst.settStrringg(2, SNNAMEE);ppst.settIntt(3, SPPHONNE);ppst.exeecutteUppdatte();/輸入你你要更新新銷售員員的IDD,進行行修改你你的產品品信息puubliic vvoidd uppdatteSaalessperrsonn(innt SSID,Strringg SNNAMEE,innt SSPHO

26、ONE) thhrowws SSQLEExceeptiion/更更新CConnnecttionn coonn=DBUUtill.geetCoonneectiion();/鏈接接數據庫庫SStriing sqll=uupdaate sallespperssonddatee seet ssaleespeersoonNaame=? ,sallespperssonPPhonne=? whheree saalessperrsonnID=?;PPreppareedSttateemennt ppst=connn.ppreppareeStaatemmentt(sqql);ppst.settStrringg(1

27、, SNNAMEE);ppst.settIntt(2, SPPHONNE);ppst.settIntt(3, SIID);ppst.exeecutteUppdatte();/輸入你你要刪除除的銷售售員的IID進行行刪除操操作puubliic vvoidd deelPrroduuct(intt SIID) thrrowss SQQLExxcepptioon/刪除除CConnnecttionn coonn=DBUUtill.geetCoonneectiion();/鏈接接數據庫庫SStriing sqll=ddeleete froom ssaleespeersoondaate wheere sal

28、lespperssonIID=?;PPreppareedSttateemennt ppst=connn.ppreppareeStaatemmentt(sqql);ppst.settIntt(1, SIID);ppst.exeecutteUppdatte();4.3銷銷售記錄錄信息管管理功能實現現:通過過使用SSQL語語句對數數據庫的的操作進進行對銷銷售記錄錄信息的的管理代碼實現現:packkagee PrroduuctSSysttemOOne;impoort javva.ssql.*;impoort javva.uutill.*;publlic claass SolldNooteDDateeD

29、aoo ppubllic Lisst qquerry() thhrowws SSQLEExceeptiion Connnecctioon cconnn=DBBUtiil.ggetCConnnecttionn();/鏈鏈接數據據庫 Staatemmentt sttmt =coonn.creeateeStaatemmentt(); Strringg sqql=sellectt * froom ssolddnottedaate ; RessulttSett rss=sttmt.exeecutteQuueryy(sqql); Lisst ssolddNotteLiist=neww ArrrayyLis

30、st(); SSolddNotteDaate solldNooteDDatee=nuull; whiile(rs.nexxt() sooldNNoteeDatte =neww SooldNNoteeDatte(); sooldNNoteeDatte.ssetSSaleesDaate(rs.gettStrringg(ssaleesDaate); sooldNNoteeDatte.ssetSSaleesIDD(rss.geetInnt(sallesIID); sooldNNoteeDatte.ssetSSaleesPrricee(rss.geetSttrinng(sallesPPricce); s

31、ooldNNoteeDatte.ssetSSaleesVoolummes(rs.gettStrringg(ssaleesVoolummes); sooldNNoteeDatte.ssetPProdducttID(rs.gettIntt(pprodducttID); sooldNNoteeLisst.aadd(solldNooteDDatee); retturnn sooldNNoteeLisst; ppubllic Lisst qquerryEvveryy(innt SSID) thhrowws SSQLEExceeptiion Coonneectiion connn=DDBUttil.get

32、tConnnecctioon(); Sttrinng ssql=seelecct * frrom solldnooteddatee whheree saalessID=? ; PrrepaareddStaatemmentt psst=cconnn.prrepaareSStattemeent(sqll); psst.ssetIInt(1, SIDD); ReesulltSeet rrs=ppst.exeecutteQuueryy(); Liist solldNooteLListt=neew AArraayLiist(); SolldNooteDDatee sooldNNoteeDatte=nnu

33、lll; whiile(rs.nexxt() sooldNNoteeDatte =neww SooldNNoteeDatte(); sooldNNoteeDatte.ssetSSaleesDaate(rs.gettStrringg(ssaleesDaate); sooldNNoteeDatte.ssetPProdducttID(rs.gettIntt(pprodducttID); sooldNNoteeDatte.ssetSSaleesIDD(rss.geetInnt(sallesIID); sooldNNoteeDatte.ssetSSaleesPrricee(rss.geetSttrinn

34、g(sallesPPricce); sooldNNoteeDatte.ssetSSaleesVoolummes(rs.gettStrringg(ssaleesVoolummes); sooldNNoteeLisst.aadd(solldNooteDDatee); retturnn sooldNNoteeLisst; /售出出產品 ppubllic voiid sselll(innt SSALEESIDD,Sttrinng ssaleesPrricee,Sttrinng ssaleesVoolummes,intt saalessDatte,iint PIDD) tthroows SQLLExcc

35、epttionn Connnecctioon cconnn=DBBUtiil.ggetCConnnecttionn(); Strringg sqql=inssertt innto solldnooteddatee vaaluees ( ?,?,?,?,?) ; PreeparredSStattemeent pstt=coonn.preeparreSttateemennt(ssql); pstt.seetInnt(11, SSALEESIDD); pstt.seetSttrinng(22, ssaleesVoolummes); pstt.seetSttrinng(33, ssaleesPrric

36、ee); pstt.seetInnt(44,saalessDatte); pstt.seetInnt(55, PPID); pstt.exxecuuteUUpdaate(); /更新新銷售數數據的銷銷售員信信息 ppubllic voiid uupdaateSSaleespeersoon(iint PIDD,innt SSALEESIDD) tthroows SQLLExccepttionn Connnecctioon cconnn=DBBUtiil.ggetCConnnecttionn(); Strringg sqql=upddatee sooldnnoteedatte sset salle

37、sIID=? whheree prroduuctIID=? ; PreeparredSStattemeent pstt=coonn.preeparreSttateemennt(ssql); pstt.seetInnt(11, SSALEESIDD); pstt.seetInnt(22, PPID); pstt.exxecuuteUUpdaate(); /刪除銷銷售數據據的信息息 ppubllic voiid ddeleeSallesDDatee(innt PPID) thhrowws SSQLEExceeptiion Connnecctioon cconnn=DBBUtiil.ggetCCon

38、nnecttionn(); Strringg sqql=delletee frrom solldnooteddatee whheree prroduuctIID=?; PreeparredSStattemeent pstt=coonn.preeparreSttateemennt(ssql); pstt.seetInnt(11, PPID); pstt.exxecuuteUUpdaate(); 5 系統(tǒng)統(tǒng)測試及及調試5.1產產品信息息管理1.進入入主菜單單后,輸輸入“1”進入產產品信息息管理界界面如下下圖2.在產產品信息息管理菜菜單下,輸入“1”顯示所所有的產產品信息息如下圖圖3.在產產品信息息

39、管理菜菜單下,輸入“2”和產品品的IDD進行產產品信息息查詢如下下圖:4.在產產品信息息管理菜菜單下,輸入“3”和相關關信息進進行對產產品信息息的修改改如下圖圖:5.在產產品信息息管理菜菜單下,輸入“4”和相關關信息進進行添加加產品信信息的操操作如下下圖6.在產產品信息息管理菜菜單下,輸入“5”和IDD進行對對產品信信息的刪刪除如下下圖5.2銷銷售員信信息管理理1.在主主菜單下下,輸入入“2”進入銷售售員信息息管理菜菜單2.在銷銷售員信信息管理理菜單下下,輸入入“1”顯示全全部銷售售員信息息如下圖圖:3.在銷銷售員信信息管理理菜單下下,輸入入“2”和IDD進行對對銷售員員信息的的查詢如如下圖:

40、4.在銷銷售員信信息管理理菜單下下,輸入入“3”和相關關信息進進行對銷銷售員信信息的修修改如下下圖:4.在銷銷售員信信息管理理菜單下下,輸入入“4”和相關關信息進進行對銷銷售員信信息的添添加如下下圖:5.在銷銷售員信信息管理理菜單下下,輸入入“5”和相關關信息進進行對銷銷售員信信息的修修改如下下圖:5.3產產品記錄錄信息管管理1.在主主菜單下下,輸入入“3”進入銷銷售記錄錄信息管管理菜單單2.在銷銷售記錄錄信息管管理菜單單下,輸輸入“1”顯示全全部銷售售記錄信息息如下:3.在銷銷售記錄錄信息管管理菜單單下,輸輸入“2”和相關關信息添添加銷售售記錄信信息如下下圖:4.在銷銷售記錄錄信息管管理菜單

41、單下,輸輸入“3”和相關關信息更更新銷售售記錄信信息如下下圖:5.在銷銷售記錄錄信息管管理菜單單下,輸輸入“4”和相關關信息更更新銷售售記錄信信息如下下圖:6 結束束語本次操作作實訓雖雖然很辛辛苦,但實在是是受益匪匪淺。在在操作實實訓過程程中碰到到了很多多問題,剛開始始的時候候,還真真不知道道從哪里里下手。但最終終在圖書書、同學學和老師的的幫助下下都得到到了解決決,讓我我學會了了好多書書本上沒沒有的東東西,通通過本次次操作實實訓我也也能將課課本上的的知識融融會貫通通,起到到了很好好的輔助助學習的的效果,但是我我發(fā)現我我學到的的知識比比整整一一個學期期學到的的都多。理論和和實踐的的相結合合是學習

42、習最有效效的方法法。在實實驗的過過程中發(fā)發(fā)現了自自己的不不足之處處,對以以前所學學過的知知識理解解得不夠夠深刻,掌握得得不夠牢牢固,這這次操作作實訓之之后,一一定把以以前所學學過的知知識重新新溫故。通過這次次操作實實訓使我我懂得了了理論與與實際相相結合是是很重要要的,只只有理論論知識是是遠遠不不夠的,只有把把所學的的理論知知識與實實踐相結結合起來來,從理理論中得得出結論論,才能能真正為為社會服服務,從從而提高高自己的的實際動動手能力力和獨立立思考的的能力。最后,要要感謝學學校為我我們提供供這次實實驗機會會,也要要感謝老師的的教導,幫助與與支持。7 參考考文獻書名JJavaa編程思思想(第第4版

43、)作者BBrucce EEckeel 出版社機機械工業(yè)業(yè)出版社社出版時間間20007年66月1日日8 附錄錄主要代碼碼:AddPProdducttDatteSyysteemAcctioon.jjavaa:packkagee PrroduuctSSysttemOOne;impoort javva.ssql.SQLLExccepttionn;impoort javva.uutill.Sccannner;publlic claass AdddProoducctDaateSSysttemAActiion puubliic AAddPProdducttDatteSyysteemAcctioon() Pr

44、roduuctDDao prooducctDaao=nnew ProoducctDaao(); SSysttem.outt.prrinttln(請你你輸入要要添加產產品的信信息:); SScannnerr scc=neew SScannnerr(Syysteem.iin); SSysttem.outt.prrinttln(請你你輸入產產品的IID:); iint PIDD=scc.neextIInt(); SSysttem.outt.prrinttln(請你你輸入 產品的的名稱:); SStriing PNAAME=sc.nexxt(); SSysttem.outt.prrinttln(請你你

45、輸入產產品的規(guī)規(guī)格:); SStriing PSPPECIIFICCATIIONSS=scc.neext(); ttry pprodducttDaoo.adddPrroduuct(PIDD, PPNAMME, PSPPECIIFICCATIIONSS); cattch (SQQLExxcepptioon ee) / TTODOO Auuto-genneraatedd caatchh bllockkee.prrinttStaackTTracce();AddSSaleeperrsonnSysstemmActtionn.jaava:packkagee PrroduuctSSysttemOOne;im

46、poort javva.ssql.SQLLExccepttionn;impoort javva.uutill.Sccannner;publlic claass AdddSallepeersoonSyysteemAcctioon pubblicc AdddSaalepperssonSSysttemAActiion() SaalessperrsonnDatteDaao ssaleespeersoonDaateDDao=neww SaalessperrsonnDatteDaao();Syysteem.oout.priintlln(請輸入入你要添添加的銷銷售員的的信息:);Sccannner sc=n

47、eww Sccannner(Sysstemm.inn);Syysteem.oout.priintlln(請你輸輸入銷售售員的IID:);innt SSID=sc.nexxtInnt();Syysteem.oout.priintlln(請你輸輸入銷售售員的名名字:);Sttrinng SSNAMME=ssc.nnextt();Syysteem.oout.priintlln(請你輸輸入銷售售員的電電話號碼碼:);innt SSPHOONE=sc.nexxtInnt();trry ssaleespeersoonDaateDDao.adddSallepeersoon(SSID, SNNAMEE, SS

48、PHOONE); cattch (SQQLExxcepptioon ee) / TTODOO Auuto-genneraatedd caatchh bllockkee.prrinttStaackTTracce();AddSSelllSolldNooteDDateeDaooSysstemmActtionn.jaava:packkagee PrroduuctSSysttemOOne;impoort javva.ssql.SQLLExccepttionn;impoort javva.uutill.Sccannner;publlic claass AdddSelllSooldNNoteeDatteDa

49、aoSyysteemAcctioon puubliic AAddSSelllSolldNooteDDateeDaooSysstemmActtionn() SSolddNotteDaateDDao solldNooteDDateeDaoo=neew SSolddNotteDaateDDao();SSysttem.outt.prrinttln(輸入入你要添添加的銷銷售記錄錄數據:);SScannnerr sccannner =neew SScannnerr(Syysteem.iin);SSysttem.outt.prrinttln(請你你輸入銷銷售產品品的IDD:);iint PIDD=sccan

50、nner.nexxtInnt();SSysttem.outt.prrinttln(請你你輸入銷銷售單價價:);SStriing sallesPPricce=sscannnerr.neext();SSysttem.outt.prrinttln(請你你輸入銷銷售產品品的數量量:);SStriing sallesVVoluumess=sccannner.nexxt();SSysttem.outt.prrinttln(請你你輸入銷銷售日期期:);iint sallesDDatee=sccannner.nexxtInnt();SSysttem.outt.prrinttln(請你你輸入銷銷售員的的ID:)

51、;iint SALLESIID=sscannnerr.neextIInt();ttry solldNooteDDateeDaoo.seell(SALLESIID, sallesPPricce, sallesVVoluumess, ssaleesDaate, PIID); caatchh (SSQLEExceeptiion e) / TODDO AAutoo-geenerrateed ccatcch bbloccke.pprinntSttackkTraace();AllQQuerryPrroduuctSSysttemAActiion.javva:packkagee PrroduuctSSystt

52、emOOne;impoort javva.ssql.SQLLExccepttionn;impoort javva.uutill.*;publlic claass AlllQueeryPProdducttSysstemmActtionn ppubllic AlllQueeryPProdducttSysstemmActtionn() PProdducttDaoo prroduuctDDao=neww PrroduuctDDao(); LListt liistPProdducttDaoo;tryy liistPProdducttDaoo = prooducctDaao.qquerry();Itter

53、aatorr pii=liistPProdducttDaoo.itteraatorr(); whiile(pi.hassNexxt() ProoducctDaate nexxt =(PrroduuctDDatee)pii.neext(); intt prroduuctIID=nnextt.geetPrroduuctIID(); Strringg pprodducttNamme=nnextt.geetPrroduuctNNamee(); Strringg pprodducttSpeecifficaatioons=nexxt.ggetPProdducttSpeecifficaatioons();

54、Sysstemm.ouut.pprinntlnn(產產品的IID:+prroduuctIID+ 產品品的名稱稱: +prroduuctNNamee+ 產品的的規(guī)格:+pprodducttSpeecifficaatioons); ccatcch (SQLLExccepttionn e) / TOODO Autto-ggeneeratted cattch bloocke.priintSStacckTrracee(); AllQQuerrySaalessperrsonnSysstemmActtionn.jaava:packkagee PrroduuctSSysttemOOne;impoort jav

55、va.ssql.SQLLExccepttionn;impoort javva.uutill.*;/測試試publlic claass AlllQueerySSaleespeersoonSyysteemAcctioon ppubllic AlllQueerySSaleespeersoonSyysteemAcctioon() SSaleespeersoonDaateDDao sallespperssonDDateeDaoo=neew SSaleespeersoonDaateDDao(); LListt liistSSaleespeersoonDaateDDao;tryy liistSSaleesp

56、eersoonDaateDDao = ssaleespeersoonDaateDDao.queery();Itteraatorr sii= llisttSallespperssonDDateeDaoo.itteraatorr(); whiile(si.hassNexxt() SaalessperrsonnDatte nnextt = (SaalessperrsonnDatte)ssi.nnextt(); innt ssaleespeersoonIDD = nexxt.ggetSSaleespeersoonIDD(); Sttrinng ssaleespeersoonNaame=nexxt.gg

57、etSSaleespeersoonNaame(); innt ssaleespeersoonPhhonee=neext.gettSallespperssonPPhonne(); Syysteem.oout.priintlln(銷售員員的IDD:+sallespperssonIID+ 銷銷售員的的名字:+ssaleespeersoonNaame+ 銷銷售員的的手機號號碼:+saalessperrsonnPhoone); ccatcch (SQLLExccepttionn e) / TOODO Autto-ggeneeratted cattch bloocke.priintSStacckTrrac

58、ee(); AllQQuerrySooldNNoteeSysstemmActtionn.jaava:packkagee PrroduuctSSysttemOOne;/* * priivatte SStriing sallesDDatee; pprivvatee Inntegger prooducctIDD; pprivvatee Sttrinng ssaleesVoolummes; pprivvatee Sttrinng ssaleesPrricee; pprivvatee Inntegger sallesIID; */impoort javva.ssql.SQLLExccepttionn;i

59、mpoort javva.uutill.Itteraatorr;impoort javva.uutill.Liist;publlic claass AlllQueerySSolddNotteSyysteemAcctioon pubblicc AlllQuueryySolldNooteSSysttemAActiion() SooldNNoteeDatteDaao ssolddNotteDaateDDao=neww SooldNNoteeDatteDaao();Liist lisstSooldNNoteeDatteDaao;trry llisttSolldNooteDDateeDaoo = sol

60、ldNooteDDateeDaoo.quueryy();IIterratoor ssi=llisttSolldNooteDDateeDaoo.itteraatorr();wwhille(ssi.hhasNNextt()SolldNooteDDatee neext=(SooldNNoteeDatte)ssi.nnextt();Strringg saalessDatte=nnextt.geetSaalessDatte();intt prroduuctIID=nnextt.geetPrroduuctIID();Strringg saalessVollumees=nnextt.geetSaalessV

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論