數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告-銷售管理信息系統(tǒng)_第1頁
數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告-銷售管理信息系統(tǒng)_第2頁
數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告-銷售管理信息系統(tǒng)_第3頁
數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告-銷售管理信息系統(tǒng)_第4頁
數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告-銷售管理信息系統(tǒng)_第5頁
已閱讀5頁,還剩24頁未讀, 繼續(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ù)學(xué)院課程設(shè)計(jì)報(bào)告201 0 201 1 學(xué)年第 一 學(xué)期課程名稱 數(shù)據(jù)庫系統(tǒng)原理 設(shè)計(jì)題目 銷售管理信息系統(tǒng) 學(xué)生姓名 學(xué) 號(hào) 310809010207 專業(yè)班級(jí) 計(jì)算機(jī)0802 指導(dǎo)教師 2010 年 1月 14 日目錄一、系統(tǒng)簡(jiǎn)介11.1、應(yīng)用背景11.2、題目1二、系統(tǒng)分析與設(shè)計(jì)12.1、需求分析12.2、系統(tǒng)設(shè)計(jì)11系統(tǒng)功能設(shè)計(jì)12系統(tǒng)功能設(shè)計(jì)模塊2三、分析與設(shè)計(jì)數(shù)據(jù)庫23.1、概念設(shè)計(jì)23.2、邏輯設(shè)計(jì)33.3、數(shù)據(jù)庫關(guān)系圖53.4、數(shù)據(jù)庫結(jié)構(gòu)的實(shí)現(xiàn)5四、框架設(shè)計(jì)84.1、主窗體84.2、主窗體菜單114.3、連接數(shù)據(jù)庫窗體114.4、系統(tǒng)運(yùn)行后的各個(gè)功能

2、模塊13五、系統(tǒng)使用說明24六、總結(jié)及致謝25七、參考文獻(xiàn)25河南理工大學(xué)數(shù)據(jù)庫課程設(shè)計(jì)一、系統(tǒng)簡(jiǎn)介1.1、應(yīng)用背景無論是一個(gè)銷售公司還是一個(gè)銷售商店,都有很多的銷售數(shù)據(jù)需要管理。手工管理這些紛繁復(fù)雜數(shù)據(jù)的方式已經(jīng)不適應(yīng)時(shí)代的潮流,實(shí)現(xiàn)數(shù)據(jù)規(guī)范化、自動(dòng)化的電腦管理,是一個(gè)管理規(guī)范、運(yùn)作高效的企事業(yè)單位的必然要求。本系統(tǒng)銷售管理信息系統(tǒng),就是為了實(shí)現(xiàn)各銷售單位高效管理而設(shè)計(jì)的。1.2、題目 銷售管理信息系統(tǒng)使用microsoft的sql server 2000作為后臺(tái)的數(shù)據(jù)庫系統(tǒng),運(yùn)用數(shù)據(jù)庫的創(chuàng)建和客戶端動(dòng)態(tài)連接數(shù)據(jù)的方法、利用數(shù)據(jù)庫后臺(tái)存儲(chǔ)過程和觸發(fā)器、利用數(shù)據(jù)庫緩存技術(shù)提供訪問效率、利用ad

3、oconnection實(shí)現(xiàn)數(shù)據(jù)庫的事務(wù)處理,完成一個(gè)信息管理系統(tǒng),能實(shí)現(xiàn)系統(tǒng)登錄、交易管理、進(jìn)貨統(tǒng)計(jì)、銷售統(tǒng)計(jì)、業(yè)績(jī)查看、查看數(shù)據(jù)表等功能。二、系統(tǒng)分析與設(shè)計(jì)2.1、需求分析 本系統(tǒng)主要考慮了最為普遍的銷售管理需求:1、 進(jìn)貨時(shí)入庫登記,以便日后查看和統(tǒng)計(jì)進(jìn)貨情況;2、 銷售時(shí)把相應(yīng)數(shù)量的商品從現(xiàn)存商品庫中減去,并記錄于另外的一個(gè)銷售庫中,以便日后查看和統(tǒng)計(jì)銷售信息;3、 是銷售就難免會(huì)有顧客退貨情況發(fā)生,因此還需建立一個(gè)相應(yīng)的退貨管理,把退回來的貨加入現(xiàn)存商品庫,再從銷售庫中減去,進(jìn)行退貨登記;4、 還要能夠隨時(shí)查看各種信息表,如員工信息、進(jìn)貨信息、銷售信息、退貨信息;5、 除了以上一些基本

4、功能外,實(shí)際中公司用來進(jìn)行決策和管理分析的數(shù)據(jù)才是用得最多的數(shù)據(jù)。因此還需要有一些相應(yīng)的關(guān)于以上數(shù)據(jù)的統(tǒng)計(jì)信息。如希望查看各個(gè)時(shí)間段(如今日、本月、本年度等)的進(jìn)貨和銷售情況,以便對(duì)以后的運(yùn)作進(jìn)行一個(gè)準(zhǔn)確的預(yù)測(cè)和正確的決斷;6、 為了調(diào)動(dòng)員工的積極性,員工薪水應(yīng)該和他的銷售情況掛鉤的,因此還需要能夠查看各員工的銷售情況,以便對(duì)他們的業(yè)績(jī)進(jìn)行考核和評(píng)比。以上數(shù)據(jù)如果采用傳統(tǒng)的管理方式,則顯得繁瑣且容易出錯(cuò),透明度也不高,容易使人有機(jī)可乘,造成公司賬目混亂。本系統(tǒng)正是針對(duì)以上問題而設(shè)計(jì),可以有效的管理數(shù)據(jù)。主要功能有交易管理,包括進(jìn)貨登記管理、銷售登記管理、退貨登記管理;進(jìn)貨統(tǒng)計(jì)管理,其中包括有關(guān)

5、進(jìn)貨的各種統(tǒng)計(jì)數(shù)據(jù)表,如今日進(jìn)貨統(tǒng)計(jì)、本月進(jìn)貨統(tǒng)計(jì)、本季度進(jìn)貨統(tǒng)計(jì)、本年度進(jìn)貨統(tǒng)計(jì)等;銷售統(tǒng)計(jì)管理,其中包括有關(guān)銷售的各種統(tǒng)計(jì)數(shù)據(jù)表,如今日銷售統(tǒng)計(jì)、本月銷售統(tǒng)計(jì)、本季度銷售統(tǒng)計(jì)、本年度銷售統(tǒng)計(jì)等;員工銷售業(yè)績(jī)的考核,可以很方便地查看個(gè)員工的銷售情況,以便對(duì)個(gè)員工的業(yè)績(jī)進(jìn)行考核比較。2.2、系統(tǒng)設(shè)計(jì)1系統(tǒng)功能設(shè)計(jì)本系統(tǒng)總體的功能是實(shí)現(xiàn)銷售公司銷售管理的系統(tǒng)化、規(guī)范化和自動(dòng)化,要完成的功能有:1) 系統(tǒng)登錄:包括用戶登錄、添加用戶、修改密碼、退出系統(tǒng)等。2) 交易管理:包括進(jìn)貨登記、銷售登記、退貨等級(jí)等。其中進(jìn)貨登記中還包括進(jìn)貨廠商的登記,如果是新的進(jìn)貨廠商,可以在此登記入庫。進(jìn)貨和銷售的主要交

6、易都是在此進(jìn)行。每次交易(包括進(jìn)貨、銷售和退貨)都需要對(duì)商品名、生產(chǎn)廠商、商品型號(hào)、單價(jià)、數(shù)量、總金額、交易日期、經(jīng)受業(yè)務(wù)員編號(hào)等各項(xiàng)進(jìn)行記錄。3) 進(jìn)貨統(tǒng)計(jì):包括今日進(jìn)貨統(tǒng)計(jì)、本月進(jìn)貨統(tǒng)計(jì)、本季度進(jìn)貨統(tǒng)計(jì)、本年度進(jìn)貨統(tǒng)計(jì)等。其中每次進(jìn)貨統(tǒng)計(jì)都是按進(jìn)貨廠商和進(jìn)貨金額順序排列的。使用一個(gè)表格現(xiàn)實(shí)所選時(shí)間段的全部進(jìn)貨數(shù)據(jù),包括進(jìn)貨編號(hào)、商品名、生產(chǎn)廠商、產(chǎn)品型號(hào)、單價(jià)、數(shù)量、總金額、進(jìn)貨日期、業(yè)務(wù)員編號(hào)等;再使用另一表格顯示分別從各個(gè)廠商進(jìn)貨的金額,還有一個(gè)文本框用于顯示此時(shí)間段的總進(jìn)貨金額。4) 銷售統(tǒng)計(jì):包括今日銷售統(tǒng)計(jì)、本月銷售統(tǒng)計(jì)、本季度銷售統(tǒng)計(jì)、本年度銷售統(tǒng)計(jì)等。其中每次銷售統(tǒng)計(jì)都是按產(chǎn)

7、品廠商和銷售金額順序排列的,用戶可以一目了然地看出各種型號(hào)產(chǎn)品的銷售額。使用一個(gè)表格顯示所選時(shí)間段的全部銷售數(shù)據(jù),包括銷售編號(hào)、商品名、生產(chǎn)廠商、產(chǎn)品型號(hào)、單價(jià)、數(shù)量、總金額、銷售日期、業(yè)務(wù)員編號(hào)等;再使用另一表格分別顯示各個(gè)廠商產(chǎn)品的銷售金額,還有一個(gè)文本框用于顯示此時(shí)間段的總銷售金額。5) 業(yè)績(jī)查看:實(shí)現(xiàn)各員工銷售情況的統(tǒng)計(jì),可以一次性顯示所有員工的銷售情況,也可以根據(jù)員工編號(hào)查看各個(gè)員工的銷售情況。6) 查看數(shù)據(jù)表:實(shí)現(xiàn)各種數(shù)據(jù)表的瀏覽,包括進(jìn)貨表、銷售表、退貨表、員工表、進(jìn)貨商表。瀏覽時(shí)此數(shù)據(jù)表的所有信息項(xiàng)全部顯示。如果員工信息或進(jìn)貨商信息有變化,還可以對(duì)員工表和進(jìn)貨商表進(jìn)行修改,其他

8、的表則不能修改,防止有人制造數(shù)據(jù)。2系統(tǒng)功能設(shè)計(jì)模塊 對(duì)上述的功能進(jìn)行集中、分塊,按照結(jié)構(gòu)化程序設(shè)計(jì)的要求,盡心分析,得到如下如所示的系統(tǒng)功能模塊圖。 圖1 程序運(yùn)行主界面圖 圖2 系統(tǒng)菜單界面三、分析與設(shè)計(jì)數(shù)據(jù)庫3.1、概念設(shè)計(jì)根據(jù)以上分析,可得如下為e-r圖manufacturerretreatemployeesellgoods退貨管理銷售銷售mnmnmnnmnmmn型號(hào)數(shù)量銷售年銷售日業(yè)務(wù)員編號(hào)單價(jià)銷售月總金額商品編號(hào)生產(chǎn)廠商 商品名員工編號(hào) 員工姓名 員工電話 員工地址 廠商編號(hào) 法人代表 廠商名稱 廠商地址 商品編號(hào)生產(chǎn)廠商商品名型號(hào)單價(jià)總金額業(yè)務(wù)員編號(hào)數(shù)量退貨年退貨月退貨日業(yè)務(wù)員編

9、號(hào)進(jìn)貨日進(jìn)貨月進(jìn)貨年總金額數(shù)量單價(jià)型號(hào)商品名生產(chǎn)廠商商品編號(hào)3.2、邏輯設(shè)計(jì)根據(jù)e-r圖設(shè)計(jì)數(shù)據(jù)庫表表1 employee表(員工表)字段名數(shù)據(jù)類型說明員工編號(hào)int標(biāo)識(shí),自動(dòng)編號(hào),主鍵員工姓名nvarchar字段大小為10員工電話nvarchar字段大小為20員工地址nvarchar字段大小為100表2 goods表(現(xiàn)存貨表)字段名數(shù)據(jù)類型說明商品編號(hào)int標(biāo)識(shí),自動(dòng)編號(hào),主鍵生產(chǎn)廠商nvarchar字段大小為20,外鍵商品名nvarchar字段大小為20型號(hào)nvarchar字段大小為20單價(jià)money貨幣型數(shù)量numeric數(shù)值型總金額money貨幣型進(jìn)貨年smallint短整型進(jìn)貨月s

10、mallint短整型進(jìn)貨日smallint短整型業(yè)務(wù)員編號(hào)int整型,外鍵表3 sell表(已售商品表)字段名數(shù)據(jù)類型說明商品編號(hào)int標(biāo)識(shí),自動(dòng)編號(hào),主鍵生產(chǎn)廠商nvarchar字段大小為20,外鍵商品名nvarchar字段大小為20型號(hào)nvarchar字段大小為20單價(jià)money貨幣型數(shù)量numeric數(shù)值型總金額money貨幣型銷售年smallint短整型銷售月smallint短整型銷售日smallint短整型業(yè)務(wù)員編號(hào)int整型,外鍵表4 retreat表(退貨表)字段名數(shù)據(jù)類型說明商品編號(hào)int標(biāo)識(shí),自動(dòng)編號(hào),主鍵生產(chǎn)廠商nvarchar字段大小為20,外鍵商品名nvarchar字段

11、大小為20型號(hào)nvarchar字段大小為20單價(jià)money貨幣型數(shù)量numeric數(shù)值型總金額money貨幣型退貨年smallint短整型退貨月smallint短整型退貨日smallint短整型業(yè)務(wù)員編號(hào)int整型,外鍵表5 manufacturer表(進(jìn)貨廠商表)字段名數(shù)據(jù)類型說明廠商編號(hào)int標(biāo)識(shí),自動(dòng)編號(hào),主鍵廠商名稱nvarchar唯一約束,字段大小為20法人代表nvarchar字段大小為10廠商地址nvarchar字段大小為100表6 uesrdb表字段名數(shù)據(jù)類型說明用戶編號(hào)int標(biāo)識(shí),自動(dòng)編號(hào),主鍵用戶名nvarchar字段大小為10密碼nvarchar字段大小為103.3、數(shù)據(jù)庫

12、關(guān)系圖圖3 數(shù)據(jù)庫關(guān)系圖3.4、數(shù)據(jù)庫結(jié)構(gòu)的實(shí)現(xiàn)1)創(chuàng)建系統(tǒng)用戶表格userdbcreate table userdb(用戶編號(hào) int identity(1,1) not null,用戶名 nvarchar(10) collate chinese_prc_ci_as null,密碼 nvarchar(10) collate chinese_prc_ci_as null,constraint pk_userdb primary key clustered(用戶編號(hào)) on primary)on primarygo2)創(chuàng)建員工基本信息表格employeecreate table employee

13、(員工編號(hào) int identity(1,1) not null,員工姓名 nvarchar(10) collate chinese_prc_ci_as null,員工電話 nvarchar(20) collate chinese_prc_ci_as null,員工地址 nvarchar(100) collate chinese_prc_ci_as null,constraint pk_employee primary key clustered(員工編號(hào)) on primary)on primarygo3)創(chuàng)建進(jìn)貨廠商信息表格manufacturercreate table manufact

14、urer(廠商編號(hào) int identity(1,1) not null,廠商名稱 nvarchar(20) collate chinese_prc_ci_as not null,法人代表 nvarchar(10) collate chinese_prc_ci_as null,電話 nvarchar(20) collate chinese_prc_ci_as null,廠商地址 nvarchar(100) collate chinese_prc_ci_as null,constraint pk_manufacturer primary key clustered(廠商編號(hào)) on primar

15、y,constraint ix_manufacturer_1 unique nonclustered(廠商名稱)on primary)on primarygo4)創(chuàng)建現(xiàn)存貨信息表格goodscreate table goods(商品編號(hào) int identity(1,1) not null,生產(chǎn)廠商 nvarchar(20) collate chinese_prc_ci_as null,商品名 nvarchar(20) collate chinese_prc_ci_as null,型號(hào) nvarchar(20) collate chinese_prc_ci_as null,單價(jià) money n

16、ull constraint df_goods_單價(jià) default(0),數(shù)量 numeric(10,0) null constraint df_goods_數(shù)量 default(0),總金額 money null,進(jìn)貨年 smallint null constraint df_goods_進(jìn)貨年 default(datepart(year,getdate(),進(jìn)貨月 smallint null constraint df_goods_進(jìn)貨月 default(datepart(month,getdate(),進(jìn)貨日 smallint null constraint df_goods_進(jìn)貨日

17、default(datepart(day,getdate(),業(yè)務(wù)員編號(hào) int null,constraint pk_goods primary key clustered(商品編號(hào)) on primary,constraint fk_goods_employee foreign key(業(yè)務(wù)員編號(hào))references employee(員工編號(hào)),constraint fk_goods_manufacturer foreign key(生產(chǎn)廠商)references manufacturer(廠商名稱)on primarygo5)創(chuàng)建已售商品信息表格sellcreate table se

18、ll(商品編號(hào) int identity(1,1) not null,生產(chǎn)廠商 nvarchar(20) collate chinese_prc_ci_as not null,商品名 nvarchar(50) collate chinese_prc_ci_as null,型號(hào) nvarchar(50) collate chinese_prc_ci_as null,單價(jià) money null constraint df_sell_單價(jià) default(0),數(shù)量 int null constraint df_sell_數(shù)量 default(0),總金額 money null constraint

19、 df_sell_總金額 default(0),銷售年 smallint null constraint df_sell_銷售年 default(datepart(year,getdate(),銷售月 smallint null constraint df_sell_銷售月 default(datepart(month,getdate(),銷售日 smallint null constraint df_sell_銷售日 default(datepart(day,getdate(),業(yè)務(wù)員編號(hào) int null,constraint pk_sell primary key clustered(商

20、品編號(hào)) on primary,constraint fk_sell_employee foreign key(業(yè)務(wù)員編號(hào))references employee(員工編號(hào)),constraint fk_sell_manufacturer foreign key(生產(chǎn)廠商)references manufacturer(廠商名稱)on primarygo6)創(chuàng)建退貨信息表格retreatcreate table retreat(退貨編號(hào) int identity(1,1) not null,廠商 nvarchar(20) collate chinese_prc_ci_as null,商品名 n

21、varchar(20) collate chinese_prc_ci_as null,型號(hào) nvarchar(20) collate chinese_prc_ci_as null,單價(jià) money null constraint df_retreat_單價(jià) default(0),數(shù)量 int null constraint df_retreat_數(shù)量 default(0),總金額 money null constraint df_retreat_總金額 default(0),退貨年 smallint null,退貨月 smallint null,退貨日 smallint null,業(yè)務(wù)員編號(hào)

22、int null,constraint pk_retreat primary key clustered(退貨編號(hào)) on primary,constraint fk_retreat_employee foreign key(業(yè)務(wù)員編號(hào))references employee(員工編號(hào)),constraint fk_retreat_manufacturer foreign key(廠商)references manufacturer(廠商名稱)on primarygo7)在sqlserver 2000上創(chuàng)建數(shù)據(jù)庫use mastergoif exists (select name from m

23、aster.dbo.sysdatabases where name=nsellsystem)drop databasesellsystemgocreate databasesellsystemgouse sellsystemgo四、框架設(shè)計(jì)4.1、主窗體本系統(tǒng)的主窗體是一個(gè)多文檔(mdi)窗體,使用mdi窗體可以使程序條理清晰。因?yàn)閙di窗體時(shí)父窗體,它負(fù)責(zé)整個(gè)程序的啟動(dòng)和關(guān)閉,其他的窗體都是它的子窗體,一個(gè)應(yīng)用程序只能有一個(gè)mdi窗體,但可以擁有多個(gè)子窗體。主窗體的界面顯示如圖4所示:圖4銷售管理信息系統(tǒng)主窗體主窗體的實(shí)現(xiàn)代碼如下:private sub mdiform_load() 在主窗

24、體中打開對(duì)數(shù)據(jù)庫的連接 dim strcnn as string 定義一個(gè)連接串變量 strcnn = provider=msdasql.1;persist security info=false;data source=sellsystem strcnn = provider=sqloledb.1;password=sa;persist security info=true;user id=sa;initial catalog=sellsystem;data source=(local) conn.open strcnn 沒有登錄前設(shè)置各菜單不可用 mdifrmmain.mnadduser.

25、enabled = false mdifrmmain.mnchpwd.enabled = false mdifrmmain.mntrade.enabled = false mdifrmmain.mnbuy.enabled = false mdifrmmain.mnsell.enabled = false mdifrmmain.mngrade.enabled = false mdifrmmain.mntable.enabled = falseend subprivate sub mdiform_unload(cancel as integer) if conn.state = adstateop

26、en then conn.close end ifend subprivate sub mnadduser_click() frmadduser.show frmadduser.setfocusend subprivate sub mnbuylog_click() frmaddgoods.showend sub private sub mnchpwd_click() frmchpwd.show frmchpwd.setfocusend subprivate sub mnem_click() frmemtable.showend subprivate sub mnemlogin_click()

27、frmlogin.show frmlogin.setfocusend subprivate sub mnexit_click() unload meend subprivate sub mnfc_click() frmfctable.showend subprivate sub mngoodstable_click() frmgoods.showend subprivate sub mngrade_click() frmshowgrade.showend subprivate sub mnretable_click() frmretreattable.showend subprivate su

28、b mnretreat_click() frmretreat.showend subprivate sub mnselllog_click() frmsell.showend subprivate sub mnselltable_click() frmshowsell.showend subprivate sub mntbuy_click() 設(shè)置frmbuyst窗體中sstabbuy控件的current tab=0,即進(jìn)入tab=0的選項(xiàng)卡 frmbuyst.sstabbuy.tab = 0 frmbuyst.showend subprivate sub mnthmbuy_click() f

29、rmbuyst.sstabbuy.tab = 1 frmbuyst.showend subprivate sub mnthsbuy_click() frmbuyst.sstabbuy.tab = 2 frmbuyst.showend subprivate sub mnthybuy_click() frmbuyst.sstabbuy.tab = 3 frmbuyst.showend subprivate sub mntsell_click() frmsellst.sstabsell.tab = 0 frmsellst.showend subprivate sub mnthmsell_click(

30、) frmsellst.sstabsell.tab = 1 frmsellst.showend subprivate sub mnthssell_click() frmsellst.sstabsell.tab = 2 frmsellst.showend subprivate sub mnthysell_click() frmsellst.sstabsell.tab = 3 frmsellst.showend sub4.2、主窗體菜單使用菜單編輯器為本窗體添加多級(jí)菜單,完成后如圖1 程序運(yùn)行主界面和圖 圖2 系統(tǒng)菜單界面所示。4.3、連接數(shù)據(jù)庫窗體連接數(shù)據(jù)庫窗體主要是負(fù)責(zé)動(dòng)態(tài)地打開對(duì)數(shù)據(jù)庫的鏈接

31、。其截面圖如圖5所示:圖5 連接數(shù)據(jù)庫窗體圖連接數(shù)據(jù)庫窗體實(shí)現(xiàn)的代碼:private sub cmdcancel_click() unload meend subprivate sub cmdconnect_click() if optionwindows.value = true then windows身份驗(yàn)證方式 connstr = provider=sqloledb.1;integrated security=sspi; _ + persist security info=false;initial catalog= + trim(cmbdatabase.text) _ + ;data

32、 source= + trim(cmbserver.text) else sql server身份驗(yàn)證方式 connstr = provider=sqloledb.1;persist security info=false;user id= _ + trim(txtuser.text) + ;password= + trim(txtpassword.text) _ + ;initial catalog= + trim(cmbdatabase.text) + ;data source= _ + trim(cmbserver.text) end if on error goto errconnec

33、t if conn.state = adstateopen then conn.close end if conn.open connstr msgbox 連接數(shù)據(jù)庫成功!, vbokonly + vbexclamation, 提示 顯示登錄窗體 frmlogin.show frmlogin.setfocus unload me exit suberrconnect: msgbox err.description, vbokonly + vbexclamation, 提示end subprivate sub form_load() 讓窗體居中 call makecenter(me)end su

34、bprivate sub optionsqlserver_click() if optionsqlserver.value = true then lbluser.enabled = true lblpassword.enabled = true txtuser.enabled = true txtpassword.enabled = true end ifend subprivate sub optionwindows_click() if optionwindows.value = true then lbluser.enabled = false lblpassword.enabled

35、= false txtuser.enabled = false txtpassword.enabled = false end ifend sub4.4、系統(tǒng)運(yùn)行后的各個(gè)功能模塊 此部分主要包含系統(tǒng)運(yùn)行后,部分主要功能模塊的界面(功能模塊相似的不列在內(nèi)),以及部分實(shí)現(xiàn)代碼。1、進(jìn)貨登記窗體圖6 進(jìn)貨登記窗體進(jìn)貨登記窗體實(shí)現(xiàn)的代碼:dim rs_addfc as new adodb.recordsetdim rs_add as new adodb.recordsetprivate sub cmdaddfc_click() txtgoodsno.enabled = false if txtmanu

36、facturer.text = then msgbox 請(qǐng)?zhí)顚憦S商名稱!, vbokonly + vbinformation, 注意 txtmanufacturer.setfocus exit sub elseif txtcoporatation.text = then msgbox 請(qǐng)?zhí)顚憦S商法人代表!, vbokonly + vbinformation, 注意 txtcoporatation.setfocus exit sub elseif txtphone.text = then msgbox 請(qǐng)?zhí)顚戨娫挘? vbokonly + vbinformation, 注意 txtphone.s

37、etfocus exit sub elseif txtaddress.text = then msgbox 請(qǐng)?zhí)顚憦S商地址!, vbokonly + vbinformation, 注意 txtaddress.setfocus exit sub end if dim sqlfc as string sqlfc = select * from manufacturer rs_addfc.open sqlfc, conn, adopenkeyset, adlockpessimistic rs_addfc.addnew rs_addfc.fields(1) = txtmanufacturer.text

38、 rs_addfc.fields(2) = txtcoporatation.text rs_addfc.fields(3) = txtphone.text rs_addfc.fields(4) = txtaddress.text rs_addfc.update msgbox 添加廠商成功, vbokonly + vbexclamation, 提示 rs_addfc.closeend subprivate sub cmdadd_click() txtgoodsno.enabled = false if txtfc.text = then msgbox 請(qǐng)?zhí)顚憦S商名稱!, vbokonly + v

39、binformation, 注意 txtfc.setfocus 使txtfc獲得光標(biāo)焦點(diǎn) exit sub elseif txtname.text = then msgbox 請(qǐng)?zhí)顚懮唐访Q!, vbokonly + vbinformation, 注意 txtname.setfocus exit sub elseif txttype.text = then msgbox 請(qǐng)?zhí)顚懮唐沸吞?hào)!, vbokonly + vbinformation, 注意 txttype.setfocus exit sub elseif txtprice.text = then msgbox 請(qǐng)?zhí)顚懮唐穬r(jià)格!, vbo

40、konly + vbinformation, 注意 txtprice.setfocus exit sub elseif txtquantity.text = then msgbox 請(qǐng)?zhí)顚懮唐窋?shù)量!, vbokonly + vbinformation, 注意 txtquantity.setfocus exit sub elseif txtyear.text = then msgbox 請(qǐng)?zhí)顚戜N售年份!, vbokonly + vbinformation, 注意 txtyear.setfocus exit sub elseif txtmon.text = then msgbox 請(qǐng)?zhí)顚戜N售月份!

41、, vbokonly + vbinformation, 注意 txtmon.setfocus exit sub elseif txtday.text = then msgbox 請(qǐng)?zhí)顚戜N售日!, vbokonly + vbinformation, 注意 txtday.setfocus exit sub elseif txtem.text = then msgbox 請(qǐng)?zhí)顚憳I(yè)務(wù)員姓名!, vbokonly + vbinformation, 注意 txtem.setfocus exit sub elseif txtmoney.text = then msgbox 請(qǐng)?zhí)顚懣偨痤~!, vbokonly

42、 + vbinformation, 注意 txtmoney.setfocus exit sub end if dim sql as string sql = select * from goods rs_add.open sql, conn, adopenkeyset, adlockpessimistic rs_add.addnew rs_add.fields(1) = txtfc.text rs_add.fields(2) = txtname.text rs_add.fields(3) = txttype.text rs_add.fields(4) = txtprice.text rs_ad

43、d.fields(5) = val(txtquantity.text) 使用val函數(shù)把textbox.text中的文本型數(shù)據(jù)轉(zhuǎn)換成數(shù)字型數(shù)據(jù) rs_add.fields(6) = val(txtmoney.text) rs_add.fields(7) = txtyear.text rs_add.fields(8) = txtmon.text rs_add.fields(9) = txtday.text rs_add.fields(10) = txtem.text rs_add.update msgbox 添加商品入庫成功, vbokonly + vbexclamation, 提示 rs_ad

44、d.closeend subprivate sub cmdreset_click() txtname.text = txtfc.text = txttype.text = txtprice.text = txtquantity.text = txtyear.text = txtmon.text = txtday.text = txtem.text = txtmoney.text = end subprivate sub cmdresetfc_click() txtmanufacturer.text = txtcoporatation.text = txtphone.text = txtaddr

45、ess.text = end sub2、進(jìn)貨統(tǒng)計(jì)窗體圖7 進(jìn)貨統(tǒng)計(jì)選項(xiàng)卡圖進(jìn)貨統(tǒng)計(jì)窗體實(shí)現(xiàn)代碼:private sub form_activate() 讓窗體居中 call makecenter(me) dim inty as integer 當(dāng)前年份 dim intm as integer 當(dāng)前月份 dim intd as integer 當(dāng)前日期 inty = year(date) intm = month(date) intd = day(date) dim sqlbuy as string dim sqlfctotal as string 各廠商進(jìn)貨總金額 dim sqltotal a

46、s string 總進(jìn)貨金額 dim rs_check as new adodb.recordset dim rs_fctotal as new adodb.recordset dim rs_total as new adodb.recordset rs_check.cursorlocation = aduseclient 設(shè)置游標(biāo)方式 rs_fctotal.cursorlocation = aduseclient rs_total.cursorlocation = aduseclient adodc1.connectionstring = connstr set datagrid1.data

47、source = adodc1 adodc2.connectionstring = connstr set datagrid2.datasource = adodc2 adodc3.connectionstring = connstr set datagrid3.datasource = adodc3 adodc4.connectionstring = connstr set datagrid4.datasource = adodc4 adodc5.connectionstring = connstr set datagrid5.datasource = adodc5 adodc6.conne

48、ctionstring = connstr set datagrid6.datasource = adodc6 adodc7.connectionstring = connstr set datagrid7.datasource = adodc7 adodc8.connectionstring = connstr set datagrid8.datasource = adodc8 select case sstabbuy.tab case 0 今日進(jìn)貨選項(xiàng)卡 sstabbuy.tabenabled(0) = true 設(shè)為可用 sstabbuy.tabenabled(1) = false 設(shè)為不可用 sstabbuy.tabenabled(2) = false sstabbuy.tabenabled

溫馨提示

  • 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)論