數(shù)據(jù)庫原理及應(yīng)用設(shè)計(jì)課程設(shè)計(jì) 汽車銷售管理系統(tǒng)_第1頁
數(shù)據(jù)庫原理及應(yīng)用設(shè)計(jì)課程設(shè)計(jì) 汽車銷售管理系統(tǒng)_第2頁
數(shù)據(jù)庫原理及應(yīng)用設(shè)計(jì)課程設(shè)計(jì) 汽車銷售管理系統(tǒng)_第3頁
數(shù)據(jù)庫原理及應(yīng)用設(shè)計(jì)課程設(shè)計(jì) 汽車銷售管理系統(tǒng)_第4頁
數(shù)據(jù)庫原理及應(yīng)用設(shè)計(jì)課程設(shè)計(jì) 汽車銷售管理系統(tǒng)_第5頁
已閱讀5頁,還剩21頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、 淮 海 工 學(xué) 院 計(jì)算機(jī)工程學(xué)院課程設(shè)計(jì)報(bào)告設(shè)計(jì)名稱: 數(shù)據(jù)庫原理及應(yīng)用設(shè)計(jì)課程設(shè)計(jì) 姓 名: xx 學(xué) 號(hào): 110831123 專業(yè)班級(jí): 軟件工程081班 系 (院): 計(jì)算機(jī)工程學(xué)院 設(shè)計(jì)時(shí)間: 2010.12.202011.12.31 設(shè)計(jì)地點(diǎn): 計(jì)算機(jī)樓一樓機(jī)房 成績(jī):指導(dǎo)教師評(píng)語: 簽名: 年 月 日一、概述1.1項(xiàng)目背景 高效的汽車銷售管理系統(tǒng)是當(dāng)前信息化汽車公司管理系統(tǒng)之需要,面對(duì)龐大的汽車銷售和庫存信息,就需要有汽車管理系統(tǒng)來提高管理工作的效率,通過建立這樣的系統(tǒng),可以做到汽車信息的規(guī)范管理、快速查詢和科學(xué)統(tǒng)計(jì),從而減少管理方面的工作量;1.2 編寫目的進(jìn)一步了解軟件的

2、功能劃分、軟件總體結(jié)構(gòu),掌握數(shù)據(jù)庫設(shè)計(jì)原理及相關(guān)軟件的使用;1.3 軟件定義汽車銷售管理系統(tǒng)轎實(shí)現(xiàn)對(duì)汽車信息、客戶信息、廠商信息、倉庫信息、汽車銷售、訂單等管理。從客戶咨詢、訂購,到簽定購銷合同、交款、提車等多個(gè)銷售環(huán)節(jié)上,系統(tǒng)提供了嚴(yán)密的跟蹤管理服務(wù),對(duì)車輛庫存、財(cái)務(wù)管理、業(yè)務(wù)分析都提供了一套科學(xué)的管理方法。 1.4 開發(fā)環(huán)境系統(tǒng)開發(fā)環(huán)境為一臺(tái)安裝windows xp的個(gè)人計(jì)算機(jī)作為客戶機(jī),其上安裝了sql server 2000,本系統(tǒng)使用visual stadio 2008來開發(fā),系統(tǒng)設(shè)計(jì)與運(yùn)行均可在客戶機(jī)上進(jìn)行。二、需求分析2.1 功能劃分及功能描述管理員:q 管理員/客戶帳號(hào)管理 系

3、統(tǒng)管理員可以登錄該系統(tǒng),登錄時(shí)需要驗(yàn)證管理員登錄號(hào)和密碼,進(jìn)入之后可以添加管理員、修改管理員,對(duì)客戶可以進(jìn)行查詢與刪除操作;q 汽車基本信息管理系統(tǒng)管理員可以按汽車型號(hào)或價(jià)格查詢汽車信息,對(duì)查到的結(jié)果進(jìn)行修改刪除操作,在刪除汽車信息時(shí),對(duì)應(yīng)的汽車數(shù)量也相應(yīng)的從倉庫中刪除;q 汽車進(jìn)貨信息管理 系統(tǒng)管理員可以添加進(jìn)貨信息,在添加的同時(shí)根據(jù)需要將進(jìn)貨的數(shù)量加入倉庫及汽車信息中;q 汽車銷售信息管理系統(tǒng)管理員可以根據(jù)客戶 /型號(hào)與廠商/ 客戶名、汽車型號(hào)及廠商名查詢相應(yīng)的利潤信息,并將查詢結(jié)果顯示在表格中,管理員可以刪除任何一行信息,并可根據(jù)任意一行信息做刪除操作;q 汽車庫存信息管理系統(tǒng)管理員可以

4、根據(jù)倉庫號(hào)查詢刪除倉庫信息,并可以一次添加一個(gè)倉庫;q 廠商管理系統(tǒng)管理員可以根據(jù)廠商名查詢廠商的所有信息,并選擇一行進(jìn)行修改,同時(shí)也可以添加廠商信息;q 訂單管理系統(tǒng)管理員可以查看需面議的訂單、已交易(未銷售)的訂單,可以對(duì)訂單標(biāo)記已銷售、面議或通過。普通用戶:q 注冊(cè)普通用戶通過填自己信息進(jìn)行注冊(cè)q 汽車銷售信息普通用戶可以查看自己的所有訂單,包括需面議的、成功交易的、未處理的訂單,根據(jù)汽車型號(hào)或價(jià)格查詢自己需要的汽車進(jìn)行預(yù)定操作。2.2 功能模塊圖三、系統(tǒng)設(shè)計(jì) 3.1 數(shù)據(jù)流圖3.1.1頂層數(shù)據(jù)流圖3.1.2 0層數(shù)據(jù)流圖3.1.3 1層數(shù)據(jù)流圖3.2 數(shù)據(jù)字典3.2.1數(shù)據(jù)項(xiàng)編號(hào)數(shù)據(jù)項(xiàng)

5、名數(shù)據(jù)項(xiàng)含義說明數(shù)據(jù)項(xiàng)類型長(zhǎng)度與其他數(shù)據(jù)項(xiàng)的邏輯關(guān)系1admin_id管理員號(hào) 不許為空int4-2admin_name管理員姓名 不許為空varchar10-3admin_pwd管理員登陸密碼 允許為空varchar20-4cus_id客戶號(hào) 不許為空int4-5cus_pwd客戶登陸密碼 允許為空varchar206cus_name客戶姓名 不許為空varchar10-7cus_sex客戶性別 不許為空varchar2-8cus_age客戶年齡 允許為空int4-9cus_tel客戶聯(lián)系電話 允許為空varchar10-10car_id汽車號(hào) 不許為空int4-11car_name汽車型號(hào)

6、 不許為空varchar20-12car_price汽車價(jià)格 不許為空varchar10car_price=stock_price13car_amount汽車數(shù)量 不許為空int4-14house_id庫存號(hào) 不許為空int4-15house_amount庫存量 不許為空int4-16supply_id廠商號(hào) 不許為空int4-17supply_name廠商名 不許為空varchar50-18supply_tel廠商聯(lián)系電話 允許為空varchar10-19sale_price銷售價(jià)格 不許為空varchar10-20sale_amount銷售數(shù)量 不許為空int4-21sale_date銷售

7、時(shí)間 允許為空datetime8-22stock_id進(jìn)貨號(hào) 不許為空int4-23stock_price進(jìn)貨價(jià) 不許為空varchar10-24stock_amount進(jìn)貨數(shù)量 不許為空int4-25stock_date進(jìn)貨時(shí)間 允許為空datetime8-26order_id預(yù)定號(hào) 不許為空int4-27order_amount預(yù)定數(shù)量 不許為空varchar10-28order_price預(yù)定價(jià)格 不許為空varchar10-29order_date預(yù)定日期 允許為空datetime8-30order_treat訂單標(biāo)記(0表未處理,3表示為“面議”1代表“已處理”)varchar5-3

8、.2.2數(shù)據(jù)結(jié)構(gòu)編號(hào)數(shù)據(jù)結(jié)構(gòu)名含義說明組成1admin管理員管理員號(hào)、姓名、登陸密碼2customer客戶客戶號(hào)、客戶登陸密碼、客戶姓名、性別、年齡、聯(lián)系電話3car汽車信息廠商號(hào)、型號(hào)、汽車號(hào)、價(jià)格、庫存號(hào)、汽車數(shù)量4warehouse庫存庫存號(hào)、庫存數(shù)量5suppliers廠商廠商號(hào)、廠商名、聯(lián)系電話6sale汽車銷售出售日期、客戶號(hào)、汽車號(hào)、銷售價(jià)格、數(shù)量7stock進(jìn)貨信息進(jìn)貨號(hào)、汽車型號(hào)、庫存號(hào)、廠商號(hào)、進(jìn)貨價(jià)、進(jìn)貨數(shù)量、日期8orders訂單訂單號(hào)、客戶號(hào)、汽車號(hào)、廠商號(hào)、預(yù)定數(shù)量、價(jià)格、時(shí)間、訂單標(biāo)記3.2.3數(shù)據(jù)流編號(hào)數(shù)據(jù)流名輸入輸出1變更管理員變更信息管理員信息2變更客戶變更

9、信息客戶信息3查詢客戶客戶名客戶信息3變更廠商變更信息廠商信息查詢廠商廠商名廠商信息4變更車輛變更信息車輛信息5查詢車輛車型號(hào)/車輛價(jià)格車輛信息6變更倉庫變更信息倉庫信息查詢倉庫倉庫號(hào)倉庫信息7變更車輛銷售變更信息車輛銷售信息8查詢車輛銷售客戶/型號(hào)與廠商/客戶、型號(hào)與廠商利潤值9變更進(jìn)貨變更信息進(jìn)貨信息10變更訂單變更信息訂單信息11查詢訂單-訂單信息3.2.4數(shù)據(jù)存儲(chǔ)數(shù)據(jù)存儲(chǔ)名輸入數(shù)據(jù)流輸出數(shù)據(jù)流管理員信息變更管理員查詢管理員客戶信息變更客戶查詢客戶、查詢銷售信息、查詢訂單請(qǐng)求庫存信息變更庫存信息查詢庫存、查詢汽車信息車輛信息變更車輛查詢車輛、查詢銷售信息、查詢庫存信息、查詢訂單請(qǐng)求廠商信

10、息變更廠商查詢廠商、查詢汽車信息車輛銷售信息變更車輛銷售查詢銷售信息、查詢倉庫信息、查詢汽車信息訂單信息變更訂單查詢訂單信息、查詢銷售信息、查詢汽車信息3.2.5處理過程處理過程名輸入數(shù)據(jù)流輸出數(shù)據(jù)流客戶登記終端變更銷售、變更訂單訂貨提交訂單信息獲得/查詢訂單信息客戶結(jié)賬結(jié)賬變更銷售信息、倉庫信息、汽車信息3.3概念結(jié)構(gòu)設(shè)計(jì)e-r圖34 關(guān)系模型 管理員admin(管理員號(hào)admin,姓名admin_name,登陸密碼admin_pwd);客戶customer (客戶號(hào)cus_id、客戶登陸密碼cus_pwd、客戶姓名cus_name、性別cus_sex、年齡cus_age、聯(lián)系電話cus_t

11、el);汽車car(廠商號(hào)supply_id、型號(hào)car_name、汽車號(hào)car_id、價(jià)格car_price、庫存號(hào)house_id、汽車數(shù)量car_amount);倉庫warehouse (庫存號(hào)house_id、庫存數(shù)量house_amount);廠商suppliers(廠商號(hào)supply_id、廠商名supply_name、聯(lián)系電話supply_tel);汽車銷售sale (出售日期sale_date、客戶號(hào)cus_id、汽車號(hào)car_id、銷售價(jià)格sale_price、數(shù)量sale_amount);進(jìn)貨信息stock (進(jìn)貨號(hào)stock_id、汽車型號(hào)car_name、庫存號(hào)hous

12、e_id、廠商號(hào)supply_id、進(jìn)貨價(jià)stock_price、進(jìn)貨數(shù)量stock_amount、日期stock_date);訂單orders (訂單號(hào)order_id、客戶號(hào)cus_id、汽車號(hào)car_id、廠商號(hào)supply_id、預(yù)定數(shù)量order_amoount、價(jià)格order_price、時(shí)間order_date、訂單標(biāo)記order_treat);35數(shù)據(jù)庫設(shè)計(jì) 管理員admin表:客戶 customer表: 汽車信息 car表: 倉庫 warehouse表:廠商 suppliers表:汽車銷售 sale表:進(jìn)貨信息 stock表:訂單 orders表:四、系統(tǒng)實(shí)現(xiàn)4.1 汽車銷售

13、系統(tǒng)界面及相應(yīng)的代碼4.1.1注冊(cè)界面#region 點(diǎn)擊注冊(cè) private void btnregister_click(object sender, eventargs e) name = txtuser.text.trim().tostring(); read = sql.executereader(dbo.selectcus, commandtype.storedprocedure); while (read.read() if (readcus_name.tostring().trim() = name) messagebox.show(已有相同用戶名!請(qǐng)重新輸入!); txtus

14、er.text = ; read.close(); return; read.close(); password = textbpwd.text.trim().tostring(); password1 = textbpwd1.text.trim().tostring(); age = textbage.text.trim().tostring(); tel = textbtel.text.trim().tostring(); sex = radiobboy.text.trim().tostring(); model.customer customer = new carsale.model.

15、customer(name,password,sex,age,tel); if (string.isnullorempty(name) | string.isnullorempty(password) | string.isnullorempty(age) | string.isnullorempty(tel) messagebox.show(輸入框不許為空!); else if (password != password1) messagebox.show(兩次輸入密碼不一致!); textbpwd.text = ; textbpwd1.text = ; else txtuser.text

16、= ; textbpwd.text = ; textbpwd1.text = ; textbage.text = ; textbtel.text = ; if (user.insert(customer) messagebox.show(注冊(cè)成功!); else messagebox.show(注冊(cè)失??!); #endregion4.1.2管理員管理界面 #region 修改管理員 private void btnchange_click(object sender, eventargs e) nname = txtchangeuser.text.trim().tostring(); npas

17、sword = txtchangepwd.text.trim().tostring(); npassword1 = txtchangepwd1.text.trim().tostring(); if(string.isnullorempty(npassword)|string.isnullorempty(npassword1) messagebox.show(輸入框不許為空!); else if (npassword != npassword1) messagebox.show(兩次輸入密碼不一致!); txtchangepwd.text = ; txtchangepwd1.text = ; e

18、lse int byname = user.selectbyname(comboboxusers.text.trim().tostring(); model.admin ad = new carsale.model.admin(byname, nname, npassword); txtchangepwd.text = ; txtchangepwd1.text = ; txtchangeuser.text = ; if (user.update(ad) messagebox.show(修改管理員成功!); manageadmin_load(sender,e); else messagebox.

19、show(修改管理員失?。?; #endregion4.1.3 廠商信息管理界面#region 刪除 private void btncancel_click(object sender, eventargs e) try string sid = datagridview1.currentrow.cells廠商號(hào).value.tostring(); bool b =supply.deletesupply(convert.toint32(sid);if (b) messagebox.show(刪除成功!); string supplyname = comboboxsp.text.trim().

20、tostring(); model.suppliers sp = new carsale.model.suppliers(supplyname); datagridview1.datasource = supply.selectallbyname(sp); managesuppliers_load(sender, e); else messagebox.show(刪除失?。?; catch (exception ex) messagebox.show(ex.message.tostring();#endregion4.1.4 客戶信息管理界面#region 查詢客戶 private void

21、btnseek_click(object sender, eventargs e) username = comboboxuser.text.trim().tostring(); if (radiobuttonboy.checked) sex = 男; else sex = 女; datagridviewusers.datasource = cus.selectbysexname(username,sex); #endregion4.1.5 汽車信息管理界面#region 修改 private void btnchange_click(object sender, eventargs e) t

22、ry string uname = textboxtype.text.trim().tostring(); int hid = convert.toint32(comboboxhouse.text.trim().tostring(); string uprice = txtcarprice.text.trim().tostring(); string usupply = comboboxsupply.text.trim().tostring(); int sid = sp.selectbyname(usupply); string id = datagridviewcar.currentrow

23、.cells汽車代號(hào).value.tostring(); if (car.updatecar(uname, hid, uprice, sid, convert.toint32(id) messagebox.show(修改汽車信息成功!); if (rbbytype.checked = true) type = comboboxtype.text.trim().tostring(); datagridviewcar.datasource = car.selectbyname(type); else price1 = txtprice.text.trim().tostring(); price2

24、= txtprice1.text.trim().tostring(); datagridviewcar.datasource = car.selectbyprice(price1, price2); managecar_load(sender, e); else messagebox.show(修改汽車信息失敗!); catch (exception ex) messagebox.show(ex.message.tostring(); #endregion4.1.6 倉庫管理信息界面#region 添加一個(gè)倉庫 private void buttonadd_click(object sende

25、r, eventargs e) int amount =0; model.warehouse house=new carsale.model.warehouse(amount); if (warehouse.insert(house) messagebox.show(添加一個(gè)倉庫成功!); managehouse_load(sender,e); else messagebox.show(添加一個(gè)倉庫失敗!); #endregion4.1.7 客戶預(yù)定汽車#region 查看需面議的訂單 private void btnall_click(object sender, eventargs e)

26、datagridvieworder.datasource = order.selectallorderall(customer,3); #endregion #region 查看已處理訂單 private void btned_click(object sender, eventargs e) datagridvieworder.datasource = order.selectallorderall(customer,1); #endregion#region 查看未處理的訂單 private void btnnull_click(object sender, eventargs e) da

27、tagridvieworder.datasource = order.selectallorderall(customer,0); #endregion#region 預(yù)定訂單 private void btnorder_click(object sender, eventargs e) string number = textbamount.text.trim().tostring(); string price = txtgiveprice.text.trim().tostring(); string date = datetimepickerdate.text.trim().tostri

28、ng(); string cus =customer; int ci = u.selectbycustomer(cus); string cartype = datagridvieworder.currentrow.cells汽車型號(hào).value.tostring(); string sname = datagridvieworder.currentrow.cells廠商名.value.tostring(); int carid=car.selectbycartype(cartype,s.selectbyname(sname); if (order.insertorder(ci, carid,

29、 convert.toint32(number), s.selectbyname(sname), price, convert.todatetime(date) messagebox.show(訂單已保存!); usermain_load(sender,e); #endregion4.1.8 訂單管理#region 確定已銷售 private void btnsaleed_click(object sender, eventargs e) trystring orderid = datagridvieworder.currentrow.cells訂單號(hào).value.tostring();boo

30、l b = order.deleteorder(convert.toint32(orderid);int cusid = convert.toint32(datagridvieworder.currentrow.cells客戶號(hào).value.tostring();string cartype = datagridvieworder.currentrow.cells汽車型號(hào).value.tostring();string supplyname = datagridvieworder.currentrow.cells廠商姓名.value.tostring(); int carid = car.se

31、lectbycartype(cartype,ss.selectbyname(supplyname);string priceu = datagridvieworder.currentrow.cells訂購價(jià)格.value.tostring();string amountu = datagridvieworder.currentrow.cells訂購數(shù)量.value.tostring(); if (b) messagebox.show(處理成功!); datagridvieworder.datasource = order.selectsupply();model.sale s = new ca

32、rsale.model.sale(cusid, carid, priceu, convert.toint32(amountu); if (!sale.insertsale(s) messagebox.show(插入銷售表時(shí)失?。?; int houseid = warehouse.selectbycartype(carid); if (!order.updateamount(carid, convert.toint32(amountu) messagebox.show(修改汽車數(shù)量失??!); int sum = car.selectamount(houseid); if (!(warehous

33、e.updatehouse(houseid,sum) messagebox.show(更新倉庫庫存失??!); else messagebox.show(處理失?。?; catch (exception ex) messagebox.show(ex.message.tostring(); #endregion4.1.9 進(jìn)貨管理#region 將進(jìn)貨信息添加到倉庫中 private void button1_click(object sender, eventargs e) try string price = textboxprice.text.tostring(); int amount =

34、 convert.toint32(textboxamount.text.trim().tostring(); datetime date = convert.todatetime(datetimepickerdate.text.trim().tostring(); int house = convert.toint32(comboboxhouse.text.trim().tostring(); string carname = textboxcartype.text.trim().tostring(); /根據(jù)廠商名搜索廠商代號(hào) string supplyname = comboboxsnam

35、e.text.trim().tostring(); int supplyid = sp.selectbyname(supplyname); int caidd = car.selectbycartype(carname, supplyid); int houseid = warehouse.selectbycartype(caidd); if (warehouse.updateamount2(house, amount) messagebox.show(更新倉庫成功!); catch messagebox.show(已超出倉庫容量!); #endregion#region 添加進(jìn)貨(添加汽車信

36、息、將汽車數(shù)量存入庫存中) private void btnadd_click(object sender, eventargs e) string price = textboxprice.text.tostring(); int amount = convert.toint32(textboxamount.text.trim().tostring(); datetime date = convert.todatetime(datetimepickerdate.text.trim().tostring(); int house = convert.toint32(comboboxhouse.

37、text.trim().tostring(); string carname = textboxcartype.text.trim().tostring(); /根據(jù)廠商名搜索廠商代號(hào) string supplyname = comboboxsname.text.trim().tostring(); int supplyid = sp.selectbyname(supplyname); int caidd = car.selectbycartype(carname,supplyid); /將各個(gè)信息裝入實(shí)體類stock中 model.stock stock=new carsale.model.

38、stock(carname,supplyid,house,price,amount,date);try / / 將進(jìn)貨信息插入stock表中 / if (stockdao.insert(stock) messagebox.show(添加進(jìn)貨成功!); / / 將進(jìn)貨信息中汽車信息插入到car表中 / same = false; read = sql.executereader(dbo.selectcar, commandtype.storedprocedure); while (read.read() if (readcar_name.tostring().trim() = carname)

39、& (convert.toint32(readsupply_id.tostring() = supplyid) /判斷car表中是否已有該汽車型號(hào) same = true; int car_amount = convert.toint32(readcar_amount.tostring().trim(); car_amount = car_amount + amount; model.car car1 = new carsale.model.car(carname, car_amount); if (!car.update(car1) messagebox.show(相同型號(hào)中添加數(shù)量時(shí)操作失

40、??!); read.close(); return; read.close(); if (!same) model.car car1 = new carsale.model.car(carname, price, amount, house, supplyid); if (!car.insert(car1) messagebox.show(添加汽車信息失??!); else messagebox.show(添加進(jìn)貨失??!); catch (exception ex) messagebox.show(ex.message.tostring(); #endregion4.1.10銷售管理 #region 查詢利潤值 private void btnsee

溫馨提示

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

評(píng)論

0/150

提交評(píng)論