




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、數(shù)據(jù)庫系統(tǒng)課程設(shè)計(jì) 貨存控制系統(tǒng)組 長: 杜 康 40809010113數(shù) 據(jù) 庫分析員: 郭仙草 40809010130用戶界面設(shè)計(jì)員: 王 彤 40809010132程 序 員: 包曙光 40809010118 胡 萍 40809010133測 試 員: 李元芳 40809010131一、 課程設(shè)計(jì)題目:貨存管理系統(tǒng) 一個(gè)公司希望為控制它的貨存建立一個(gè)數(shù)據(jù)庫,貨存中的產(chǎn)品被分為幾類,如服裝、食品和文具。當(dāng)產(chǎn)品需要從供應(yīng)商那里重新訂購時(shí),工作人員需要提出一個(gè)購買訂單。跟蹤記錄要提供買進(jìn)、賣出的貨物以及其他的費(fèi)用。實(shí)驗(yàn)課程任務(wù)與要求目的與任務(wù):1.掌握數(shù)據(jù)庫設(shè)計(jì)和實(shí)現(xiàn)的基本過程2.掌握數(shù)據(jù)庫模
2、式設(shè)計(jì)、分析和實(shí)現(xiàn)的方法3.了解數(shù)據(jù)庫應(yīng)用系統(tǒng)軟件開發(fā)的一般過程。實(shí)驗(yàn)基本要求: (1) 學(xué)習(xí)相關(guān)的預(yù)備知識(2) 按照數(shù)據(jù)庫設(shè)計(jì)與實(shí)現(xiàn)過程完成數(shù)據(jù)庫的設(shè)計(jì),應(yīng)用程序的開發(fā),上機(jī)調(diào)試、運(yùn)行(3) 寫出課程設(shè)計(jì)報(bào)告開發(fā)環(huán)境說明:處理器:intel pentium 4 3.06以上內(nèi)存:256m以上硬盤空間:40g以上操作系統(tǒng):windows 2000 /xp/win7開發(fā)軟件:c+builder 6.0數(shù)據(jù)庫:microsoft sql service 2000二、功能需求分析:根據(jù)系統(tǒng)要求分析,本系統(tǒng)功能如下:用戶管理:添加用戶,修改用戶密碼??蛻艄芾恚禾砑涌蛻?,查詢客戶信息。供應(yīng)商管理:添加
3、供應(yīng)商,查詢供應(yīng)商信息。倉庫管理:添加倉庫,查詢倉庫信息。貨物管理:添加物品信息,物品類型信息。入庫管理:貨物的入庫信息的添加和修改。出庫管理:貨物的出庫信息的添加和修改。庫存信息:對貨物的現(xiàn)有信息存量查詢。三、數(shù)據(jù)庫概念設(shè)計(jì):本實(shí)例根據(jù)根據(jù)上面的設(shè)計(jì)規(guī)劃出的實(shí)體有倉庫實(shí)體、客戶實(shí)體、供應(yīng)商實(shí)體、管理員實(shí)體、貨物實(shí)體、貨物類型實(shí)體、入庫實(shí)體、出庫實(shí)體、庫存實(shí)體。各個(gè)實(shí)體的e-r圖描述如下:倉 庫倉庫編號倉庫名稱倉庫地址管理員編號倉庫面積 倉庫實(shí)體e-r圖供 應(yīng) 商供應(yīng)商名稱供應(yīng)商編號供應(yīng)商地址聯(lián)系方式郵編 供應(yīng)商實(shí)體e-r圖客 戶客戶名稱地址客戶編號聯(lián)系方式 客戶實(shí)體e-r圖管理員管理員編號管
4、理員姓名密碼管理員實(shí)體e-r圖貨 物物品名稱類型編號物品編號 貨物實(shí)體e-r圖貨物類型類型名稱類型描述類型編號 貨物類型實(shí)體e-r圖入 庫供應(yīng)商編號物品名稱類型名稱物品編號入庫數(shù)量購入單價(jià)采購金額入庫日期 入庫實(shí)體e-r圖出 庫客戶編號物品名稱類型名稱物品編號出庫數(shù)量出售單價(jià)出庫金額出庫日期 出庫實(shí)體e-r圖 庫 存?zhèn)}庫編號物品名稱類型名稱物品編號物品數(shù)量 庫存實(shí)體e-r圖整體e-r圖如下所示:四、數(shù)據(jù)庫邏輯設(shè)計(jì):關(guān)系數(shù)據(jù)庫的數(shù)據(jù)模型(即關(guān)系模型)由一組關(guān)系模式組成,因而er圖向關(guān)系模型的轉(zhuǎn)換實(shí)際上就是將實(shí)體(包括實(shí)體的屬性)和聯(lián)系轉(zhuǎn)換為關(guān)系模式,一般遵循以下基本原則: 1.一個(gè)實(shí)體型轉(zhuǎn)換為一
5、個(gè)關(guān)系模式。實(shí)體的屬性就是關(guān)系的屬性,實(shí)體的碼就是關(guān)系的碼。 2.一個(gè)1:x(x為1或n)聯(lián)系通常與某一端的關(guān)系模式合并,其中1:n的聯(lián)系需要與n端對應(yīng)的關(guān)系模式合并。需要在合并的關(guān)系模式的屬性中加入另一個(gè)關(guān)系模式的碼和聯(lián)系本身的屬性。 3.一個(gè)m:n聯(lián)系轉(zhuǎn)換為一個(gè)關(guān)系模式。與該關(guān)系相連的各實(shí)體的碼以及聯(lián)系本身的屬性均轉(zhuǎn)換為關(guān)系的屬性,而關(guān)系的碼為各實(shí)體碼的組合。 4.三個(gè)或三個(gè)以上實(shí)體間的一個(gè)多元聯(lián)系可以轉(zhuǎn)換為一個(gè)關(guān)系模式。與該多元聯(lián)系相連的各實(shí)體的碼以及聯(lián)系本身的屬性均轉(zhuǎn)換為關(guān)系的屬性,而關(guān)系的碼為各實(shí)體的碼的組合。 5.具有相同碼的關(guān)系模式可合并。使用sql server 2000企業(yè)管
6、理器建立數(shù)據(jù)庫和表(也可使用sql語句建立數(shù)據(jù)庫)。數(shù)據(jù)庫包括:1.倉庫的數(shù)據(jù)項(xiàng)描述: storage數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明倉庫編號sno倉庫的編號char5主鍵倉庫名稱sname倉庫的名稱char20倉庫地址saddr倉庫的地址char40管理員編號mno管理員的編號char5外鍵倉庫面積ssize倉庫的大小int2.供應(yīng)商的數(shù)據(jù)項(xiàng)描述:provider數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明供應(yīng)商編號 pno供應(yīng)商的識別號碼char5主鍵供應(yīng)商名稱 pname供應(yīng)商公司的名稱char20供應(yīng)商地址 paddr供應(yīng)商公司的地址char40郵編postcode公司的郵編cha
7、r6 電話ptel公司的電話char113.客戶的數(shù)據(jù)項(xiàng)描述:client數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明客戶編號cno客戶的編號char5主鍵客戶名稱cname客戶公司的名稱char20地址caddr客戶公司的地址char40聯(lián)系電話ctel客戶聯(lián)系電話char114貨物的數(shù)據(jù)項(xiàng)描述:goods數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明物品編號gno物品的編號char5主鍵物品名稱 gname物品的名稱char20類型編號 tno物品的類型char5外鍵5.貨物類型的數(shù)據(jù)項(xiàng)描述:type數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明類型編號tno物品的類型的編號char5主鍵類型名稱 tna
8、me物品的類型的名稱char20類型描述 tdescription物品的類型的描述char506.管理員的數(shù)據(jù)項(xiàng)描述:manager數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明管理員編號mno管理員的編號char5主鍵管理員姓名mname管理員的姓名char20密碼pw該管理員的密碼char67.庫存的數(shù)據(jù)項(xiàng)描述: stock數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明物品編號gno貨物表中物品編號char5外鍵、主鍵倉庫編號sno倉庫的編號char5外鍵物品名稱gname貨物的名稱char10類型名稱tname貨物的分類char20物品數(shù)量gnum貨物的存儲量int入庫(合計(jì))-出庫(合計(jì))8.入庫
9、的數(shù)據(jù)項(xiàng)描述:stock_in數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明物品編號gno貨物表中物品編號char5外鍵、主鍵供應(yīng)商編號pno供應(yīng)商的編號char5外鍵、主鍵物品名稱gname貨物的名稱char10類型名稱tname貨物的分類char20購入單價(jià)ginprice貨物購入的價(jià)格real入庫數(shù)量innum入庫的數(shù)量int采購金額inprice本次采購的金額real購入單價(jià)*入庫數(shù)量入庫日期indate入庫的時(shí)間char209.出庫的數(shù)據(jù)項(xiàng)描述:stock_out數(shù)據(jù)項(xiàng)名對應(yīng)英文名數(shù)據(jù)項(xiàng)含義類型長度說明物品編號gno貨物表中物品編號char5外鍵、主鍵客戶編號cno客戶的編號char5外鍵
10、、主鍵物品名稱gname貨物的名稱char10類型名稱tname貨物的分類char4出售單價(jià)goutprice貨物出售的價(jià)格real出庫數(shù)量outnum出庫的數(shù)量int出庫金額outprice本次出庫的金額real出庫數(shù)量*出售單價(jià)出庫日期outdate出庫的時(shí)間char20五、系統(tǒng)開發(fā)1. 數(shù)據(jù)庫建立create database storage_manage;供應(yīng)商 providercreate table provider(pno char(5) primary key,pname char(20),padddr char(40),postcode char(6),ptel char(1
11、1);客戶 clientcreate table client(cno char(5) primary key,cname char(20),caddr char(40),ctel char(11);貨物類型 typecreate table type(tno char(5) primary key,tname char(20),tdescription char(50);貨物 goodscreate table goods(gno char(5) primary key,gname char(20),tno char(5),foreign key(tno) references type(t
12、no);管理員 managercreate table manager(mno char(5) primary key,mname char(20),pw char(6);倉庫 storagecreate table storage(sno char(5) primary key,sname char(20),saddr char(40),mno char(5),ssize int,foreign key(mno) references manager(mno);庫存 stockcreate table stock(gno char(5),sno char(5),gname char(10),
13、tname char(20),gnum int,primary key(gno),foreign key(gno) references goods(gno),foreign key(sno) references storage(sno);入庫 stock_increate table stock_in(gno char(5),pno char(5),gname char(10),tname char(20),ginprice real,innum int,inprice real,indata char(20),primary key(gno,pno),foreign key(gno) r
14、eferences goods(gno),foreign key(pno) references provider(pno);出庫 stock_outcreate table stock_out(gno char(5),cno char(5),gname char(10),tname char(20),goutprice real,outnum int,outprice real,outdata char(20),primary key(gno,cno),foreign key(gno) references goods(gno),foreign key(cno) references cli
15、ent(cno);2、界面設(shè)計(jì)form1/-#include <vcl.h>#pragma hdrstop#include "unit1.h"#include "unit2.h"/-#pragma package(smart_init)#pragma resource "*.dfm"tform1 *form1;/-_fastcall tform1:tform1(tcomponent* owner) : tform(owner)/-void _fastcall tform1:button1click(tobject *sen
16、der) adoquery1->sql->clear(); adoquery1->sql->add("select * from manager "); adoquery1->sql->add("where mname='"+edit1->text+"' and pw='"+edit2->text+"'"); if(adoquery1->execsql() showmessage("登陸成功"); form2-
17、>show(); else showmessage("用戶名或密碼錯(cuò)誤!"); /-void _fastcall tform1:button2click(tobject *sender)close(); /-form2/-#include <vcl.h>#pragma hdrstop#include "unit2.h"#include "unit1.h"#include "unit3.h"#include "unit4.h"#include "unit5.h"
18、;#include "unit6.h"#include "unit7.h"#include "unit8.h"#include "unit9.h"#include "unit10.h"#include "unit11.h"#include "unit12.h"#include "unit13.h"#include "unit14.h"#include "unit15.h"#include &quo
19、t;unit16.h"/-#pragma package(smart_init)#pragma resource "*.dfm"tform2 *form2;/-_fastcall tform2:tform2(tcomponent* owner) : tform(owner)/-void _fastcall tform2:n5click(tobject *sender)form3->show();form2->close();/-void _fastcall tform2:n6click(tobject *sender)form4->show();
20、form2->close();/-void _fastcall tform2:n18click(tobject *sender)form1->show();form2->close();/-void _fastcall tform2:n8click(tobject *sender)form6->show();form2->close();/-void _fastcall tform2:n7click(tobject *sender)form5->show();form2->close();/-void _fastcall tform2:n12click
21、(tobject *sender)form10->show();form2->close();/-void _fastcall tform2:n9click(tobject *sender)form7->show();form2->close();/-void _fastcall tform2:n10click(tobject *sender)form8->show();form2->close();/-void _fastcall tform2:n16click(tobject *sender)form9->show();form2->clos
22、e();/-void _fastcall tform2:n13click(tobject *sender)form12->show();form2->close();/-void _fastcall tform2:n14click(tobject *sender)form11->show();form2->close();/-void _fastcall tform2:n15click(tobject *sender)form14->show();form2->close();/-void _fastcall tform2:n11click(tobject
23、*sender)form9->show();form2->close();/-void _fastcall tform2:n17click(tobject *sender)form15->show();form2->close();/-void _fastcall tform2:n19click(tobject *sender) form16->show(); form2->close();/-form3/-#include <vcl.h>#pragma hdrstop#include "unit3.h"#include &q
24、uot;unit2.h"/-#pragma package(smart_init)#pragma resource "*.dfm"tform3 *form3;/-_fastcall tform3:tform3(tcomponent* owner) : tform(owner)/-void _fastcall tform3:button1click(tobject *sender)form3->adotable1->active=true; form3->adotable1->append(); form3->adotable1->
25、;fieldbyname("cno")->asstring=edit1->text; form3->adotable1->fieldbyname("cname")->asstring=edit2->text; form3->adotable1->fieldbyname("caddr")->asstring=edit3->text; form3->adotable1->fieldbyname("ctel")->asstring=edit4-
26、>text; form3->adotable1->post(); showmessage("錄入成功!");/-void _fastcall tform3:button2click(tobject *sender)edit1->text=' 'edit2->text=' 'edit3->text=' 'edit4->text=' '/-void _fastcall tform3:button3click(tobject *sender) form2->show()
27、; form3->close();/-form4/-#include <vcl.h>#pragma hdrstop#include "unit4.h"#include "unit2.h"/-#pragma package(smart_init)#pragma resource "*.dfm"tform4 *form4;/-_fastcall tform4:tform4(tcomponent* owner) : tform(owner)/-void _fastcall tform4:button1click(tobje
28、ct *sender)adoquery1->active=false;adoquery1->sql->clear();adoquery1->sql->add("select * from client");adoquery1->sql->add("where cno like '"+edit1->text+"%'");adoquery1->active=true;/-void _fastcall tform4:button2click(tobject *sender
29、)adoquery1->active=false;adoquery1->sql->clear();adoquery1->sql->add("select * from client");adoquery1->sql->add("where cname like '"+edit2->text+"%'");adoquery1->active=true;/-void _fastcall tform4:button3click(tobject *sender) form2-
30、>show(); form4->close();/-from5/-#include <vcl.h>#pragma hdrstop#include "unit5.h"#include "unit2.h"/-#pragma package(smart_init)#pragma resource "*.dfm"tform5 *form5;/-_fastcall tform5:tform5(tcomponent* owner) : tform(owner)/-void _fastcall tform5:button1c
31、lick(tobject *sender) form5->adotable1->active=true; form5->adotable1->append(); form5->adotable1->fieldbyname("pno")->asstring=edit1->text; form5->adotable1->fieldbyname("pname")->asstring=edit2->text; form5->adotable1->fieldbyname("
32、;paddr")->asstring=edit3->text; form5->adotable1->fieldbyname("postcode")->asstring=edit3->text; form5->adotable1->fieldbyname("ptel")->asstring=edit5->text; form5->adotable1->fieldbyname("prep")->asstring=edit6->text; form
33、5->adotable1->post(); showmessage("錄入成功!");/-void _fastcall tform5:button2click(tobject *sender) edit1->text=' ' edit2->text=' ' edit3->text=' ' edit4->text=' ' edit5->text=' ' edit6->text=' '/-void _fastcall tform5:bu
34、tton3click(tobject *sender) form2->show(); form5->close();/-form6/-#include <vcl.h>#pragma hdrstop#include "unit6.h"#include "unit2.h"/-#pragma package(smart_init)#pragma resource "*.dfm"tform6 *form6;/-_fastcall tform6:tform6(tcomponent* owner) : tform(owne
35、r)/-void _fastcall tform6:button1click(tobject *sender)adoquery1->active=false;adoquery1->sql->clear();adoquery1->sql->add("select * from provider");adoquery1->sql->add("where pno like '"+edit1->text+"%'");adoquery1->active=true;/-void
36、 _fastcall tform6:button2click(tobject *sender) adoquery1->active=false;adoquery1->sql->clear();adoquery1->sql->add("select * from provider");adoquery1->sql->add("where pname like '"+edit2->text+"%'");adoquery1->active=true;/-void _fas
37、tcall tform6:button3click(tobject *sender)form2->show();form6->close();/-form7/-#include <vcl.h>#pragma hdrstop#include "unit7.h"#include "unit2.h"/-#pragma package(smart_init)#pragma resource "*.dfm"tform7 *form7;/-_fastcall tform7:tform7(tcomponent* owner)
38、 : tform(owner)/-void _fastcall tform7:button2click(tobject *sender) edit1->text=' ' edit2->text=' ' edit3->text=' ' edit5->text=' '/-void _fastcall tform7:button3click(tobject *sender)form2->show();form7->close();/-void _fastcall tform7:button1click
39、(tobject *sender) form7->adotable1->active=true; form7->adotable1->append(); form7->adotable1->fieldbyname("sno")->asstring=edit1->text; form7->adotable1->fieldbyname("sname")->asstring=edit2->text; form7->adotable1->fieldbyname("sad
40、dr")->asstring=edit3->text; form7->adotable1->fieldbyname("mno")->asstring=dbcombobox1->text; form7->adotable1->fieldbyname("ssize")->asstring=edit5->text; form7->adotable1->post(); showmessage("錄入成功!");/-form8/-#include <vcl.h>#pragma hdrstop#include "unit8.h"#include "unit2.h"/-#pragma package(smart_init)#pragma resource "*.dfm"tform8 *form8;/-_fastcall tform8:tform8(tcomponent* owner) : tform(owner)/-void _fastcall t
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 勘察合同范例 付款方式
- 公司有效合同范例
- 協(xié)調(diào)員 合同范例
- 廠區(qū)維修框架合同范例
- 賣舊貨合同范例
- 口罩訂購合同范例
- 參茸購銷合同范例
- 發(fā)貨送貨合同范例
- 博羅網(wǎng)簽合同范例
- 化糞池合作合同范本
- 《橋本氏甲狀腺炎》課件
- 玉米密植精準(zhǔn)調(diào)控高產(chǎn)技術(shù)-李少昆
- 人美版七-九年級美術(shù)知識點(diǎn)
- 解三角形(十年高考)-2024高考數(shù)學(xué)
- (高清版)JTG 3810-2017 公路工程建設(shè)項(xiàng)目造價(jià)文件管理導(dǎo)則
- 中國居民營養(yǎng)與健康狀況調(diào)查報(bào)告
- DLT 560 電力安全工作規(guī)程(高壓試驗(yàn)室部分)
- 初一英語完形填空練習(xí)(50篇)
- ① 小數(shù)的意義(課件) 2023-2024學(xué)年四年級下冊數(shù)學(xué)人教版
- 【SRAM電路設(shè)計(jì)與版圖實(shí)現(xiàn)12000字(論文)】
- (高清版)DZT 0217-2020 石油天然氣儲量估算規(guī)范
評論
0/150
提交評論