




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、原創(chuàng)性聲明原創(chuàng)性聲明 本人鄭重聲明: 所呈交的學位論文,是本人在導師的指導下,獨 立進行研究工作所取得的成果。除文中已經(jīng)注明引用的內容外,本論文 不含任何其他個人或集體已經(jīng)發(fā)表或撰寫過的作品或成果。對本文的研 究做出重要貢獻的個人和集體,均已在文中以明確方式標明。本聲明的 法律結果由本人承擔。 xxx 大學 2011 屆畢業(yè)論文 題目:題目:書店管理系統(tǒng)的設計與實現(xiàn)書店管理系統(tǒng)的設計與實現(xiàn) 班 級: 姓 名: 指導老師: 2011 年 2 月 28 日 圖書管理系統(tǒng)的設計與實現(xiàn)圖書管理系統(tǒng)的設計與實現(xiàn) 文檔信息 文件類型: 軟件開發(fā)用技術文檔 當前版本:v1.0 beta 作 者: 開發(fā)人員:
2、 單位:xx 班 完成日期: 軟件信息 軟件名稱:書店管理系統(tǒng) 版 本 號: v1.0 語言類型:簡體中文 授權類型:測試版 運行環(huán)境:windows xp/2003/vista/7 等 軟件大?。?3069 kb 指導老師: 軟件作者:劉洋 聯(lián)系信箱: 版權所有:copyright2010-2011.powered by 劉洋. 開發(fā)日期:2010 年 10 月-2011 年 2 月 相關站點:csdn,cnblog,msdn 等 軟件簡介:書店管理系統(tǒng) v1.0 beta 測試版 面向中小型書店、個體書 店進行全面的人員、物流管理,旨在實現(xiàn)書店管理信息化。 本系統(tǒng)采用會員制管理,將人員分為
3、經(jīng)理、倉庫管理員、售 書員、會員、游客等,分別擁有不同的權限,各司其職,以 便提高工作效率。 系統(tǒng)功能包括:供應商管理、進書管理、圖書資料管理、售 書管理、會員管理、員工管理、庫存統(tǒng)計、售書統(tǒng)計、退貨 統(tǒng)計、基本統(tǒng)計分析等。 北京大學網(wǎng)絡教育學院計算機科學與技術 2011-2-28 目錄目錄 一、序言4 二、需求分析說明書4 2.1 系統(tǒng)介紹 .4 2.2 系統(tǒng)面向的用戶群體 .4 2.3 系統(tǒng)的功能性需求 .4 2.4 系統(tǒng)的非功能性需求 .5 2.4.1 用戶界面需求.5 2.4.2 軟硬件環(huán)境需求.5 2.4.3 軟件質量需求.5 三、可行性分析報告5 3.1 技術可行性 .5 3.2
4、人員可能性 .5 3.3 時間、設備可能性 .5 3.4 系統(tǒng)工作量 .5 3.5 代碼工作量 .5 3.6 文檔要求 .5 四、開發(fā)環(huán)境與項目規(guī)劃5 4.1 開發(fā)環(huán)境 .5 4.2 項目規(guī)劃與管理 .5 4.2.1 開發(fā)人員安排.5 4.2.2 開發(fā)進度安排.5 五、軟件界面設計標準與規(guī)范5 5.1 編寫目的 .5 5.2 界面設計思想 .6 5.3 界面設計原則 .6 5.4 界面設計樣式 .6 5.5 常見提示信息樣式 .6 5.6 常見錯誤信息樣式 .7 5.7 其他界面約定 .7 六、軟件編碼設計標準與規(guī)范7 6.1 對象命名約定 .7 6.2 常量和變量命名約定 .8 6.3 結構
5、化編碼約定 .8 6.4 數(shù)據(jù)源的約定 .9 6.5 數(shù)據(jù)庫訪問約定 .9 6.6 其他約定 .9 七、數(shù)據(jù)庫分析與設計10 7.1 數(shù)據(jù)庫環(huán)境說明.10 7.2 數(shù)據(jù)庫命名標準與規(guī)范.10 7.3 數(shù)據(jù)庫邏輯設計.10 7.4 數(shù)據(jù)庫物理設計.10 7.4.1 表、視圖匯總 .10 7.4.2 各表、視圖設計詳解 .11 八、軟件體系結構設計說明書15 8.1 系統(tǒng)概述 .15 8.2 設計約束 .15 8.3 設計策略 .15 8.4 系統(tǒng)概要設計說明書 .16 8.4.1 圖例說明.16 8.4.2 系統(tǒng)總體結構圖.16 8.4.3 銷售子系統(tǒng)流程圖.17 8.4.4 進貨子系統(tǒng)流程圖.
6、17 8.4.5 退貨子系統(tǒng)流程圖.17 8.5 系統(tǒng)詳細設計說明書 .17 8.5.1 系統(tǒng)模塊匯總.17 8.5.2 系統(tǒng)核心模塊詳解.18 九、用戶界面設計報告32 9.1 界面設計規(guī)范 .32 9.2 系統(tǒng)窗體匯總 .32 9.3 主界面設計 .33 9.4 子界面設計 .33 9.5 界面資源設計 .34 十、軟件測試分析報告34 10.1 測試范圍與主要內容 .34 10.2 測試方法 .34 10.3 測試報告 .34 10.4 改進建議與措施 .35 十一、軟件使用說明書35 11.1 軟件概述.35 11.3 使用說明.35 11.2.1 系統(tǒng)登陸.35 11.2.2 注銷與
7、退出.35 11.2.3 辦理進貨登記.35 11.2.4 關于/幫助.38 參考資料39 一、序言一、序言 本書店管理系統(tǒng)的設計與推出是多方面原因促成的。我在日常的生活中發(fā) 現(xiàn),許多中小型書店、個體書店其日常管理工作都是人工操作,歷史數(shù)據(jù)很難 保存和利用,對于書店的經(jīng)營非常不利。針對這種狀況,我計劃開發(fā)一個面向 中小型書店、個體書店的書店管理系統(tǒng),實現(xiàn)對人員、物流的全面管理,以幫 助這些書店早日實現(xiàn)書店管理信息化。 為了系統(tǒng)的順利開發(fā)和維護,特編制如下技術文檔: 二、二、需求分析說明書需求分析說明書 2.12.1 系統(tǒng)介紹系統(tǒng)介紹 本系統(tǒng)定位于中小型書店、個體書店,暫時考慮單機環(huán)境下的實現(xiàn);
8、操作 系統(tǒng)選擇目前常用的 windows xp/2003。系統(tǒng)性質為 mis(管理信息系統(tǒng))或財 務軟件。 本系統(tǒng)采用會員制管理,系統(tǒng)功能應包含進書管理、售書管理、退貨管理、 庫存管理、統(tǒng)計分析、相關人員管理等。系統(tǒng)界面力求簡潔、易用,在標準化 的基礎上考慮界面的美觀和新穎。 系統(tǒng)計劃 2010 年 10 月初開始,2011 年 2 月初完成初步開發(fā)工作,其余工 作根據(jù)時間安排進行。 2.22.2 系統(tǒng)面向的用戶群體系統(tǒng)面向的用戶群體 系統(tǒng)面向中小型書店、個體書店,用戶群體為這些書店的經(jīng)理、采購員 倉庫管理員、圖書銷售人員、書店的會員游客等。 2.32.3 系統(tǒng)的功能性需求系統(tǒng)的功能性需求 功
9、能序號功能名稱功能說明 1 供應商管理包含供應商信息的登記、修改等 2 圖書種類管理包含圖書大類、小類的創(chuàng)建 3 圖書資料管理包含圖書資料的添加、修改等 4 新書入庫管理登記新書的來源、數(shù)量、單價、折扣、金額等 5 庫存統(tǒng)計分門別類統(tǒng)計圖書現(xiàn)有庫存量、入庫時間等 6 進貨記錄查詢查詢歷次進貨記錄 7 退貨登記登記供應商、圖書種類、退貨的數(shù)量、原因等 8 退貨統(tǒng)計按供應商統(tǒng)計退貨記錄 9 退貨記錄查詢查詢歷次退貨記錄 10 圖書銷售管理登記銷售的種類、數(shù)量、單價、折扣、顧客/會 員等 11 會員管理包含會員的創(chuàng)建、修改、刪除等 12 優(yōu)惠政策管理包含優(yōu)惠政策的制定與執(zhí)行 13 本日售書統(tǒng)計統(tǒng)計本
10、日銷售圖書的數(shù)量、金額等 14 售書記錄查詢查詢歷次售書記錄 15 員工管理包含員工帳號的創(chuàng)建、修改、刪除等 16 統(tǒng)計分析按年月日時段統(tǒng)計書店經(jīng)營狀況 17 圖書檢索提供按圖書的編號、書名、責任者、出版社等 途徑的檢索 18 系統(tǒng)帳號管理提供上級對下級的資料、密碼管理, 19 個人資料、密碼管 理 提供修改個人資料、密碼的工具 2.42.4 系統(tǒng)的非功能性需求系統(tǒng)的非功能性需求 .1 用戶界面需求 簡潔、易用、易懂,美觀、大方、標準,具備一定的兼容性。 .2 軟硬件環(huán)境需求 軟件環(huán)境:兼容當前主流操作系統(tǒng) windows xp/2003/vista/7 等。
11、硬件環(huán)境:當前主流計算機,打印機、掃描儀等。 .3 軟件質量需求 易用、健壯、兼容性好、運行穩(wěn)定、有一定安全保障。 三三、可行性分析報告、可行性分析報告 3.13.1 技術可行性技術可行性 系統(tǒng)的性質為 mis 或財務軟件,因而數(shù)據(jù)庫的設計與操縱是系統(tǒng)設計的核 心。我在 2009 年 11 月至 2009 年 12 月曾經(jīng)成功完成了“學生學籍管理系統(tǒng)” 的開發(fā)任務,具備一定的系統(tǒng)分析與設計能力,熟悉數(shù)據(jù)庫的設計與操縱,因 而該系統(tǒng)的實現(xiàn)在技術上是可行的。 3.23.2 時間、設備可能性時間、設備可能性 系統(tǒng)設計與開發(fā)工作預計耗時一個月。實驗設備如:計算機、打印機、掃描 儀等不足
12、,上機任務可以完成,打印機、掃描儀的實驗根據(jù)具體條件暫時延緩 執(zhí)行。 3.33.3 系統(tǒng)工作量系統(tǒng)工作量 該系統(tǒng)的工作量相對于我來說很大,必須保證按進度完成任務。實際工作量 預計超過一個月(每天 2-4 小時) 。如包含軟件維護及技術文檔的整理、制作, 工作量將更大。 3.43.4 代碼工作量代碼工作量 預計需 40 天左右。 3.53.5 文檔要求文檔要求 依據(jù)國家計算機軟件產品開發(fā)文件編制指南和現(xiàn)代軟件工程的理論 與原則編制標準的軟件技術文檔。 四、開發(fā)環(huán)境與項目規(guī)劃四、開發(fā)環(huán)境與項目規(guī)劃 4.14.1 開發(fā)環(huán)境開發(fā)環(huán)境 前臺開發(fā)環(huán)境:microsoft visual basic 6.0
13、后臺數(shù)據(jù)庫環(huán)境:microsoft access 2000/2002 4.2 項目規(guī)劃與管理 4.2.1 開發(fā)進度安排 2010 年 10 月 1 日至 10 月 10 日:系統(tǒng)分析,進行需求定義,定義系統(tǒng)概況 10 月 11 日至 10 月 20 日:數(shù)據(jù)庫分析與設計 10 月 21 日至 10 月 30 日:軟件體系結構設計 2011 年 1 月 1 日至 2 月 10 日:軟件編碼 2 月 10 日至 3 月 1 日:系統(tǒng)測試 五、軟件界面設計標準與規(guī)范五、軟件界面設計標準與規(guī)范 5.1 編寫目的 制定界面設計標準規(guī)范的目的是為了規(guī)范和統(tǒng)一軟件界面設計制定軟件界 面設計標準與規(guī)范。 5.
14、2 界面設計思想 首先考慮標準化,在標準化的基礎上進行界面的美工設計。 5.3 界面設計原則 簡單易用、簡潔明了、兼容性好、標準、規(guī)范。 5.4 界面設計樣式 采用標準 windows 界面,自上至下依次為:標題欄、菜單欄、工具條、工 作區(qū)、狀態(tài)欄等。如下圖示: 圖 1.系統(tǒng)界面 5.55.5 常見提示信息樣式常見提示信息樣式 菜單欄 工具條 狀態(tài)欄 工作區(qū) 提示信息按以下標準進行:采用標準 windows 對話框樣式,添加信息圖標, 后接提示信息文本和相應按鈕。 如下圖示: 圖 2.常見提示信息樣式 5.65.6 常見錯誤信息樣式常見錯誤信息樣式 錯誤信息依據(jù)提示信息樣式設計,將信息圖標更改
15、為警告圖標。 如下圖示: 圖 3.常見錯誤信息樣式 5.75.7 其他界面約定其他界面約定 除主界面外,所有子界面均采用模式窗體,即該窗體不消失,不可以在本程 序內將焦點移出子窗體。 六、軟件編碼設計標準與規(guī)范六、軟件編碼設計標準與規(guī)范 6.16.1 對象命名約定對象命名約定 對象名對象類型命名約定(前綴碼) form 窗體 frm command 按鈕 cmd label 標簽 lab textbox 文本框 txt combobox 組合框 comb listbox 列表框 lstb adodb 數(shù)據(jù)庫訪問對象 adodb datagrid 數(shù)據(jù)表格顯示組件 datagrid frame
16、框架 fam option 單選框 opt checkbox 復選框 chk picturebox 圖象顯示組件 ptb commondialog 通用對話框組件 comdlg timer 時間組件 tim toolbar 工具欄 tlbar menu 菜單 mnu 信息圖標 提示文本 按鈕 警告圖標 提示文本 sstab 頁框 sstab imagelist 界面資源組件 imglst 6.26.2 常量和變量命名約定常量和變量命名約定 變量名數(shù)據(jù)類型變量類型含義 usershenfenstring 全局變量用戶身份標志 logokboolean 全局變量登陸狀態(tài) usernamestrin
17、g 全局變量用戶名 gongyingshangidstring 全局變量供應商編號 gongyingshangstring 全局變量供應商名稱 tushubianhaostring 全局變量圖書編號 dingjiasingle 全局變量圖書定價 shumingstring 全局變量書名 huiyuankahaostring 全局變量會員卡號 hyxingmingstring 全局變量會員姓名 hydengjistring 全局變量會員等級 6.36.3 結構化編碼約定結構化編碼約定 編碼應清晰、可讀性好,運用縮進、空行,結合大小寫區(qū)別等方法保持程序 結構良好。凡與數(shù)據(jù)庫操作相關的模塊一律加上容
18、錯代碼,涉及多表操作的模 塊應運用“事務”處理,以保持數(shù)據(jù)完整性。 編碼風格參照下例進行: public sub checkuser(userid as string, passwd as string) dim userdb as database dim userrd as recordset dim dbname as string dim strsql as string screen.mousepointer = 11 on error goto errend dbname = app.path if right(dbname, 1) 、 then dbname = dbname +
19、 、 dbname = dbname + database、wfssdatabase.mdb strsql = select 用戶身份 from admin where 用戶 id= data source= persist security info=false adodc1.connectionstring = connstr exit sub errend: msgbox 連接數(shù)據(jù)庫失敗!, vbokonly + vbexclamation, 打開數(shù)據(jù) 庫出錯 end end sub 模塊名:gethydazhe 模塊原型:public function gethydazhe(bianh
20、ao as string) as string 代碼: public function gethydazhe(bianhao as string) as string on error goto errend if bianhao = then gethydazhe = 1 exit function end if adodc1.commandtype = adcmdtext adodc1.recordsource = select 打折 from 會員政策 where 會員 級別= & bianhao & adodc1.refresh if adodc1.recordset.recordco
21、unt 0 then adodc1.recordset.movefirst gethydazhe = adodc1.recordset!打折 else msgbox 會員政策數(shù)據(jù)丟失,請與經(jīng)理聯(lián)系!, vbokonly + vbexclamation, 檢索錯誤 gethydazhe = 1 end if exit function errend: msgbox 檢索數(shù)據(jù)庫出錯!, vbokonly + vbexclamation, 檢索錯誤 getdingjia = 未知 end function 模塊名:getkucun 模塊原型:public function getkucun(bian
22、hao as string) as string 代碼: public function getkucun(bianhao as string) as string on error goto errend adodc1.commandtype = adcmdtext adodc1.recordsource = select 庫存量 from book where 圖書編 號= & bianhao & adodc1.refresh if adodc1.recordset.recordcount 0 then adodc1.recordset.movefirst getkucun = adodc
23、1.recordset!庫存量 else msgbox 圖書資料數(shù)據(jù)丟失,請與經(jīng)理聯(lián)系!, vbokonly + vbexclamation, 檢索錯誤 getkucun = 0 end if exit function errend: msgbox 檢索數(shù)據(jù)庫出錯!, vbokonly + vbexclamation, 檢索錯誤 getdingjia = 未知 end function 模塊名:hyshengji 模塊原型:public function hyshengji(hykahao as string) as boolean 代碼: public function hyshengji
24、(hykahao as string) as boolean on error goto errend dim biaozhun as integer dim sumbook as integer if hykahao = guest then hyshengji = false exit function end if begintrans adodc1.commandtype = adcmdtext adodc1.recordsource = select sum(實收金額) as 總金額 from 售書記錄 where 會員卡號= & hykahao & adodc1.refresh i
25、f adodc1.recordset.recordcount 0 then adodc1.recordset.movefirst sumbook = cint(adodc1.recordset!總金額) else sumbook = 0 end if adodc1.commandtype = adcmdtext adodc1.recordsource = select 會員標準 from 會員政策 where 會員級別= adodc1.refresh adodc1.recordset.movefirst biaozhun = cint(adodc1.recordset!會員標準) if sum
26、book = biaozhun then adodc1.commandtype = adcmdtext adodc1.recordsource = select * from 會員表 where 會員卡號 = & hykahao & adodc1.refresh if adodc1.recordset.recordcount 0 then adodc1.recordset.movefirst adodc1.recordset!會員等級 = adodc1.recordset.update end if end if adodc1.commandtype = adcmdtext adodc1.re
27、cordsource = select 會員標準 from 會員政策 where 會員級別= adodc1.refresh adodc1.recordset.movefirst biaozhun = cint(adodc1.recordset!會員標準) if sumbook = biaozhun then adodc1.commandtype = adcmdtext adodc1.recordsource = select * from 會員表 where 會員卡號 = & hykahao & adodc1.refresh if adodc1.recordset.recordcount 0
28、then adodc1.recordset.movefirst adodc1.recordset!會員等級 = adodc1.recordset.update end if end if adodc1.commandtype = adcmdtext adodc1.recordsource = select 會員標準 from 會員政策 where 會員級別= adodc1.refresh adodc1.recordset.movefirst biaozhun = cint(adodc1.recordset!會員標準) if sumbook = biaozhun then adodc1.comm
29、andtype = adcmdtext adodc1.recordsource = select * from 會員表 where 會員卡號 = & hykahao & adodc1.refresh if adodc1.recordset.recordcount 0 then adodc1.recordset.movefirst adodc1.recordset!會員等級 = adodc1.recordset.update end if end if adodc1.commandtype = adcmdtext adodc1.recordsource = select 會員標準 from 會員
30、政策 where 會員級別= adodc1.refresh adodc1.recordset.movefirst biaozhun = cint(adodc1.recordset!會員標準) if sumbook = biaozhun then adodc1.commandtype = adcmdtext adodc1.recordsource = select * from 會員表 where 會員卡號 = & hykahao & adodc1.refresh if adodc1.recordset.recordcount 0 then adodc1.recordset.movefirst
31、adodc1.recordset!會員等級 = adodc1.recordset.update end if end if adodc1.commandtype = adcmdtext adodc1.recordsource = select 會員標準 from 會員政策 where 會員級別= adodc1.refresh adodc1.recordset.movefirst biaozhun = cint(adodc1.recordset!會員標準) if sumbook = biaozhun then adodc1.commandtype = adcmdtext adodc1.recor
32、dsource = select * from 會員表 where 會員卡號 = & hykahao & adodc1.refresh if adodc1.recordset.recordcount 0 then adodc1.recordset.movefirst adodc1.recordset!會員等級 = adodc1.recordset.update end if end if committrans hyshengji = false exit function errend: rollback hyshengji = true screen.mousepointer = vbde
33、fault msgbox 檢查會員是否應升級時操作失??!, vbokonly + vbexclamation, 圖書銷售 cmdok.enabled = true end function 模塊名:cmdsellbook_click 模塊原型:private sub cmdsellbook_click() 代碼: private sub cmdsellbook_click() on error goto errend dim qd as integer cmdsellbook.enabled = false if txtshuliang.text = then msgbox 請輸入交易的數(shù)量!
34、, vbokonly + vbexclamation, 填寫數(shù) 量 txtshuliang.setfocus cmdsellbook.enabled = true exit sub end if if getkucun(tushubianhao) = 0 or getkucun(tushubianhao) txtshuliang.text then msgbox 該類圖書庫存量不足,請與倉庫管理員聯(lián)系!, vbokonly + vbexclamation, 庫存不足 txtshuliang.setfocus cmdsellbook.enabled = true exit sub end if
35、if txtzhekou.text = then msgbox 請輸入交易的實際折扣率!, vbokonly + vbexclamation, 填寫折扣 txtzhekou.setfocus cmdsellbook.enabled = true exit sub end if if txtzhekou.text 1 then msgbox 實際折扣率填寫錯誤!請在 0 與 1 之間選擇., vbokonly + vbexclamation, 填寫折扣 txtzhekou.setfocus cmdsellbook.enabled = true exit sub end if if txtsjji
36、ne.text = then msgbox 請輸入交易的實際金額!, vbokonly + vbexclamation, 填 寫金額 txtsjjine.setfocus cmdsellbook.enabled = true exit sub end if if txtmemo.text = then txtmemo.text = 無 qd = msgbox(確定入帳嗎?, vbokcancel + vbquestion, 確認入帳) if qd = vbcancel then cmdsellbook.enabled = true exit sub end if 售書入帳 screen.mou
37、sepointer = 11 begintrans adodc1.commandtype = adcmdtable adodc1.recordsource = 售書記錄 adodc1.refresh adodc1.recordset.addnew adodc1.recordset!圖書編號 = tushubianhao adodc1.recordset!數(shù)量 = txtshuliang.text adodc1.recordset!會員卡號 = huiyuankahao adodc1.recordset!實際打折 = txtzhekou.text adodc1.recordset!實收金額 =
38、txtsjjine.text adodc1.recordset!日期 = year(now) & - & month(now) & - & day(now) & . adodc1.recordset!備注 = txtmemo.text adodc1.recordset.update adodc1.commandtype = adcmdtext adodc1.recordsource = select * from book where 圖書編號= & tushubianhao & adodc1.refresh if adodc1.recordset.recordcount 0 then ado
39、dc1.recordset.movefirst adodc1.recordset!庫存量 = adodc1.recordset!庫存量 - txtshuliang.text adodc1.recordset.update else rollback screen.mousepointer = vbdefault msgbox 圖書資料丟失,請與倉庫管理員聯(lián)系!, vbokonly + vbexclamation, 交易失敗 cmdsellbook.enabled = true exit sub end if if hyshengji(huiyuankahao) then rollback co
40、mmittrans screen.mousepointer = vbdefault msgbox 恭喜您,交易成功!, vbokonly + vbinformation, 交易成功 unload me exit sub errend: rollback screen.mousepointer = vbdefault msgbox err.description, vbokonly + vbexclamation, 操作數(shù)據(jù)庫 出錯 交易失敗 cmdsellbook.enabled = true end sub .3 系統(tǒng)模塊詳解 模塊名:checkgysid 模塊原型:publ
41、ic function checkgysid(uid as string) as boolean 代碼: public function checkgysid(uid as string) as boolean dim userdb as database dim userrd as recordset dim dbname as string dim strsql as string screen.mousepointer = 11 on error goto errend dbname = app.path if right(dbname, 1) then dbname = dbname
42、+ dbname = dbname + databasewfssdatabase.mdb strsql = select 圖書分類 from 圖書分類 where 圖書分類號 = & uid & 打開數(shù)據(jù)庫 set userdb = dbengine.workspaces(0).opendatabase(dbname, false, true) 檢索用戶,驗證密碼 set userrd = userdb.openrecordset(strsql, dbopensnapshot) if userrd.recordcount 0 then 關閉數(shù)據(jù)庫 userrd.close set userrd
43、 = nothing userdb.close set userdb = nothing checkgysid = true screen.mousepointer = vbdefault else 關閉數(shù)據(jù)庫 userrd.close set userrd = nothing userdb.close set userdb = nothing screen.mousepointer = vbdefault checkgysid = false end if exit function errend: screen.mousepointer = vbdefault msgbox err.des
44、cription, vbokonly + vbexclamation, 創(chuàng)建類別 err.clear 關閉數(shù)據(jù)庫 userrd.close set userrd = nothing userdb.close set userdb = nothing end function 模塊名:checkfenlei 模塊原型:public function checkfenlei(uid as string) as boolean 代碼: public function checkfenlei(uid as string) as boolean dim userdb as database dim us
45、errd as recordset dim dbname as string dim strsql as string screen.mousepointer = 11 on error goto errend dbname = app.path if right(dbname, 1) then dbname = dbname + dbname = dbname + databasewfssdatabase.mdb strsql = select 圖書分類 from 圖書分類 where 圖書分類= & uid & 打開數(shù)據(jù)庫 set userdb = dbengine.workspaces(
46、0).opendatabase(dbname, false, true) 檢索用戶,驗證密碼 set userrd = userdb.openrecordset(strsql, dbopensnapshot) if userrd.recordcount 0 then 關閉數(shù)據(jù)庫 userrd.close set userrd = nothing userdb.close set userdb = nothing checkfenlei = true screen.mousepointer = vbdefault else 關閉數(shù)據(jù)庫 userrd.close set userrd = noth
47、ing userdb.close set userdb = nothing screen.mousepointer = vbdefault checkfenlei = false end if exit function errend: screen.mousepointer = vbdefault msgbox err.description, vbokonly + vbexclamation, 創(chuàng)建類別 err.clear 關閉數(shù)據(jù)庫 userrd.close set userrd = nothing userdb.close set userdb = nothing end functi
48、on 模塊名:cmdnewfenlei_click 模塊原型:private sub cmdnewfenlei_click() 代碼: private sub cmdnewfenlei_click() on error goto errend if txtbianhao.text = then msgbox 請?zhí)顚憟D書分類號!, vbokonly + vbexclamation, 創(chuàng)建分 類 txtbianhao.setfocus exit sub end if if txtleibie.text = then msgbox 請?zhí)顚憟D書分類名稱!, vbokonly + vbexclamati
49、on, 創(chuàng)建 分類 txtleibie.setfocus exit sub end if if checkfenlei(txtleibie.text) then msgbox 圖書分類名稱不唯一,請另選一個!, vbokonly + vbexclamation, 創(chuàng)建分類 txtleibie.setfocus txtleibie.selstart = 0 txtleibie.sellength = len(txtleibie.text) exit sub end if if combofulei.text and combofulei.text 選擇父類 then if not checkfe
50、nlei(combofulei.text) then msgbox 所選父類不存在!請重試!, vbokonly + vbexclamation, 選擇父類 combofulei.setfocus exit sub end if adodc1.commandtype = adcmdtext adodc1.recordsource = select 圖書分類號 from 圖書分類 where 圖書分類號=所屬父類編號 and 圖書分類= & combofulei.text & adodc1.refresh adodc1.recordset.movefirst fuleibianhao = ado
51、dc1.recordset!圖書分類號 end if if checkgysid(txtbianhao.text) then msgbox 圖書分類編號不唯一,請另選一個!, vbokonly + vbexclamation, 創(chuàng)建分類 txtbianhao.setfocus txtbianhao.selstart = 0 txtbianhao.sellength = len(txtbianhao.text) exit sub end if if fuleibianhao = then fuleibianhao = txtbianhao.text adodc1.commandtype = ad
52、cmdtable adodc1.recordsource = 圖書分類 adodc1.refresh adodc1.recordset.addnew adodc1.recordset!圖書分類號 = txtbianhao.text adodc1.recordset!圖書分類 = txtleibie.text adodc1.recordset!所屬父類編號 = fuleibianhao adodc1.recordset.update msgbox 創(chuàng)建分類成功!, vbokonly + vbinformation, 創(chuàng)建分類 txtbianhao.text = txtleibie.text =
53、combofulei.text = 選擇父類 fuleibianhao = txtfulei.text = txtbianhao.setfocus exit sub errend: msgbox 更新數(shù)據(jù)庫失敗!, vbokonly + vbexclamation, 數(shù)據(jù)庫出 錯 end sub 模塊名:checkuserid 模塊原型:public function checkuserid(uid as string) as boolean 代碼: public function checkuserid(uid as string) as boolean dim userdb as data
54、base dim userrd as recordset dim dbname as string dim strsql as string screen.mousepointer = 11 on error goto errend dbname = app.path if right(dbname, 1) then dbname = dbname + dbname = dbname + databasewfssdatabase.mdb strsql = select 用戶身份 from admin where 用戶 id= & uid & 打開數(shù)據(jù)庫 set userdb = dbengin
55、e.workspaces(0).opendatabase(dbname, false, true) 檢索用戶,驗證密碼 set userrd = userdb.openrecordset(strsql, dbopensnapshot) if userrd.recordcount 0 then 關閉數(shù)據(jù)庫 userrd.close set userrd = nothing userdb.close set userdb = nothing checkuserid = true screen.mousepointer = vbdefault else 關閉數(shù)據(jù)庫 userrd.close set
56、userrd = nothing userdb.close set userdb = nothing screen.mousepointer = vbdefault checkuserid = false end if exit function errend: screen.mousepointer = vbdefault msgbox err.description, vbokonly + vbexclamation, 修改密碼 err.clear 關閉數(shù)據(jù)庫 userrd.close set userrd = nothing userdb.close set userdb = nothi
57、ng end function 模塊名:cmdchgpass_click 模塊原型:private sub cmdchgpass_click() 代碼: private sub cmdchgpass_click() on error goto errend if txtuserid.text = then msgbox 請輸入你的帳號!, vbokonly + vbexclamation, 更改密 碼 txtuserid.setfocus exit sub end if if txtpasswd.text = then msgbox 請輸入你的舊密碼!, vbokonly + vbexclam
58、ation, 更改 密碼 txtpasswd.setfocus exit sub end if if txtnewpasswd.text = then msgbox 請輸入你的新密碼!, vbokonly + vbexclamation, 更改 密碼 txtnewpasswd.setfocus exit sub end if if txtnewpasswd.text txtnewpasswdc.text then msgbox 密碼輸入不一致,請重試!, vbokonly + vbexclamation, 更改密碼 txtpasswd.text = txtnewpasswd.text = tx
59、tnewpasswdc.text = txtpasswd.setfocus exit sub end if if checkuserid(txtuserid.text) then adodc1.commandtype = adcmdtext adodc1.recordsource = select * from admin where 用戶密碼 = & txtpasswd.text & and 用戶 id= & txtuserid.text & adodc1.refresh if adodc1.recordset.recordcount 0 then adodc1.recordset.move
60、first adodc1.recordset!用戶密碼 = txtnewpasswd.text adodc1.recordset.update else msgbox 用戶密碼驗證錯誤!你無權修改密碼!, vbokonly + vbexclamation, 密碼錯誤 txtpasswd.text = txtnewpasswd.text = txtnewpasswdc.text = exit sub end if msgbox 用戶密碼修改成功!請牢記!, vbokonly + vbinformation, 更改密碼 txtpasswd.text = txtnewpasswd.text = tx
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 醫(yī)院感染防控應急處置預案
- 公司股權分配及管理辦法
- 建筑工程項目報告
- 垃圾焚燒發(fā)電前景如何
- 電動車公共充電樁使用方法
- 基于語音控制的智能家居
- 安全防護和文明施工措施
- 工程項目預算及費用統(tǒng)計表
- 新能源車輛推廣與應用戰(zhàn)略研究報告
- 銀行業(yè)務流程優(yōu)化與風控管理方案
- 2019版新人教版高中英語必修+選擇性必修共7冊詞匯表匯總(帶音標)
- T-CACM 1420-2022 中成藥安慰劑模擬效果評價規(guī)范
- GJB9001C內部審核檢查表
- 2022年高考必背古詩文60篇默寫完成情況自查表-(可編輯)
- 人體九大系統(tǒng)的常見疾病
- 《心理學:蝴蝶效應》課件
- 2022自動扶梯梯級鏈與自動人行道踏板鏈設計與計算規(guī)范
- (2024)新聞記者采編人員從業(yè)資格考試試題(附答案)
- 印章移交清單
- 可愛的中國教案全冊
- 立體庫風險分析及安全措施
評論
0/150
提交評論