基于C的圖書借閱管理系統(tǒng)畢業(yè)論文_第1頁(yè)
基于C的圖書借閱管理系統(tǒng)畢業(yè)論文_第2頁(yè)
基于C的圖書借閱管理系統(tǒng)畢業(yè)論文_第3頁(yè)
基于C的圖書借閱管理系統(tǒng)畢業(yè)論文_第4頁(yè)
基于C的圖書借閱管理系統(tǒng)畢業(yè)論文_第5頁(yè)
已閱讀5頁(yè),還剩31頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

計(jì)算機(jī)科學(xué)與技術(shù)系數(shù)據(jù)庫(kù)課程設(shè)計(jì)報(bào)告圖書借閱系統(tǒng)姓名:學(xué)號(hào):班級(jí):08級(jí)計(jì)算機(jī)科技三班指導(dǎo)老師:二○一一年十二月目錄一、需求分析 21.1.1圖書資料查詢管理 21.1.2借閱圖書資料管理 31.1.3歸還圖書資料管理 31.1.4圖書資料管理 41.1.5讀者信息管理 41.2數(shù)據(jù)庫(kù)需求和分析 41.2.1數(shù)據(jù)結(jié)構(gòu)(數(shù)據(jù)庫(kù)中表的設(shè)計(jì)) 41.2.2數(shù)據(jù)項(xiàng)具體設(shè)置 51.2.3數(shù)據(jù)流 51.2.4數(shù)據(jù)儲(chǔ)存 51.2.5處理過(guò)程 61.3數(shù)據(jù)庫(kù)概念結(jié)構(gòu)設(shè)計(jì)(E-R關(guān)系圖) 6二.整體設(shè)計(jì) 91.1選用程序語(yǔ)言 91.2選用MSAccess數(shù)據(jù)庫(kù) 101.3程序流程圖 11三.具體設(shè)計(jì)以及程序?qū)崿F(xiàn) 113.1程序的各個(gè)模塊的實(shí)現(xiàn)以及代碼和截圖 11四.結(jié)束語(yǔ) 35五.參考文獻(xiàn) 35需求分析需求分析是只收集和分析用戶對(duì)系統(tǒng)的信息需求和處理要求,得到設(shè)計(jì)所需的需求信息。這些信息是是選擇了對(duì)數(shù)據(jù)庫(kù)設(shè)計(jì)直接有用的信息,一般包括實(shí)體類、聯(lián)系類、數(shù)據(jù)的使用要求及沖突表等方面的內(nèi)容。下面我們從程序設(shè)計(jì)過(guò)程中分別對(duì)程序的需求分析和數(shù)據(jù)庫(kù)的需求分析結(jié)合進(jìn)行討論。1.1系統(tǒng)需求與功能分析1.1.1圖書資料查詢管理圖書資料管理系統(tǒng)主要是向讀者提供圖書借閱的服務(wù),讀者為了借閱圖書資料,一般情況下,需要在借閱圖書之前查詢所要借閱的圖書情況,所以該系統(tǒng)需要為讀者提供圖書查詢功能。例如,讀者可能想借閱某方面的圖書,但不知道在該方面有哪些圖書可供借閱,所以需要對(duì)圖書進(jìn)行查詢;或者,讀者知道想借的圖書信息,但不知道是否有該圖書、該圖書是否被借出、是否可以借閱等信息,這也需要使用圖書查詢功能。讀者在查詢圖書資料時(shí),可能依據(jù)以下條件進(jìn)行查詢:1.圖書資料的名稱;2.圖書資料的種類;3.圖書資料的作者;4.圖書資料名中的關(guān)鍵詞;經(jīng)過(guò)圖書資料的查詢,讀者可以獲得是否有自己想借閱的圖書資料、該圖書資料的簡(jiǎn)單信息以及該圖書的借閱情況等。1.1.2借閱圖書資料管理圖書資料管理系統(tǒng)的基本功能之一就是為讀者提供借閱服務(wù),讀者通過(guò)借書這一過(guò)程,可以把圖書資料借出,從而使讀者能夠更方便地閱覽圖書資料。結(jié)束過(guò)程中,圖書管理員要對(duì)讀者的借閱資格等進(jìn)行審查,對(duì)符合借書條件的員工,允許其借書,對(duì)其借書記錄進(jìn)行登記;對(duì)沒(méi)有借閱資格的讀者,禁止其借書。具體借書的步驟如下:1.讀者想借閱書籍或資料,須向管理員提交書號(hào)或資料號(hào)和本人的借書卡,借閱管理員先檢查該書或資料是否存在;如果存在,再檢查該書或資料是否在館;2.當(dāng)讀者要借的書或資料在館時(shí),借閱管理員要檢查該書或資料是否有人預(yù)定,如果預(yù)定的編號(hào)與當(dāng)時(shí)借閱讀者編號(hào)相同,則可借,當(dāng)不同時(shí),則被預(yù)定不能借出。3.借閱管理員檢查無(wú)預(yù)定時(shí),方可檢查員工借書卡,看其卡號(hào)是否存在,是否在有效期之內(nèi),并且還應(yīng)檢查借書卡是否有被鎖定,檢查是否交清罰款,是否有超期,檢查員工總借書量是否超出最大限額,有其中任何一樣,均不能借出。4.如果上述的都滿足條件,則可順利借出,在借出之后,如原有預(yù)定,則要修改為已借,除此之外還要對(duì)所借的書籍狀態(tài)進(jìn)行修改,并且還要記錄日志。1.1.3歸還圖書資料管理讀者在一本圖書或者資料借閱期滿之前應(yīng)該把該圖書或資料歸還,一般的還書步驟是:1.讀者把所借的圖書或資料和自己的借書卡交給還書處的借閱管理員。2.借閱管理員檢查圖書或資料是否存在于系統(tǒng)之中,如果存在,則系統(tǒng)繼續(xù)。3.借閱管理員對(duì)該圖書或資料進(jìn)行檢查,看有無(wú)損壞,如有圖書或資料存在壞損的情況,讀者應(yīng)進(jìn)行相應(yīng)的賠償。4.借閱管理員查看該圖書或資料是否超過(guò)規(guī)定的借閱期限,如已經(jīng)超過(guò),則讀者要按規(guī)定交納罰金。5.借閱管理員進(jìn)行登記,同時(shí)改變書的狀態(tài),并且查看在還書之前是否有人預(yù)定,如有預(yù)定,則書立即進(jìn)入預(yù)定狀態(tài),除預(yù)定者,其他人均不能借出,并且制定預(yù)定日期,同時(shí)還要記錄日志。1.1.4圖書資料管理圖書資料管理是實(shí)現(xiàn)圖書管理員對(duì)圖書或資料信息的添加、刪除、修改等變化進(jìn)行登記的功能。圖書管理員可以對(duì)圖書或資料的各種信息進(jìn)行修改維護(hù)。例如,可以對(duì)圖書或資料的類別、出版社等信息進(jìn)行添加;還可以對(duì)圖書或資料的名稱、作者等進(jìn)行修改,但其在具體應(yīng)用中主要是對(duì)圖書或資料的狀態(tài)進(jìn)行修改。1.1.5讀者信息管理讀者信息管理是讀者管理員對(duì)于讀者的各種信息進(jìn)行修改維護(hù)的功能。讀者管理員可以對(duì)讀者信息進(jìn)行修改,例如對(duì)讀者的編號(hào)、姓名、性別等信息進(jìn)行修改,為讀者設(shè)置密碼等功能;還可以添加或者刪除讀者信息,即添加或刪除讀者。1.2數(shù)據(jù)庫(kù)需求和分析1.2.1數(shù)據(jù)結(jié)構(gòu)(數(shù)據(jù)庫(kù)中表的設(shè)計(jì))編號(hào)數(shù)據(jù)結(jié)構(gòu)名屬性1管理員管理員姓名,密碼,信息,權(quán)限2讀者讀者姓名,性別,電話,身份證,密碼,罰款,身份,備注3身份身份信息,最大借閱時(shí),最大借閱數(shù)4圖書圖書編號(hào),圖書名,作者,出版社,出版日期,價(jià)格,數(shù)量,類型,備注5圖書分類類型,類型描述,類型編號(hào)1.2.2數(shù)據(jù)項(xiàng)具體設(shè)置編號(hào)標(biāo)識(shí)符類型(長(zhǎng)度)編號(hào)標(biāo)識(shí)符類型(長(zhǎng)度)1管理員姓名Varchar(10)2讀者姓名Varchar(10)3性別Varchar(2)4密碼int5身份證Float6罰款Money7圖書類型Varchar(50)8圖書名稱Varchar(50)9圖書數(shù)量Float18圖書編號(hào)Float19作者Varchar(50)20出版社Varchar(50)21類型描述Varchar(1000)22價(jià)格Money23借書日期Datetime24還書日期Datetime1.2.3數(shù)據(jù)流編號(hào)數(shù)據(jù)流名輸入輸出1管理員信息增加管理員管理員信息2讀者信息增加讀者信息讀者信息3圖書信息圖書信息,查詢信息圖書信息4添加圖書增加圖書圖書信息5借閱圖書借閱圖書信息圖書借閱信息6歸還圖書還書信息圖書借閱信息7圖書信息查詢查詢方式查詢結(jié)果1.2.4數(shù)據(jù)儲(chǔ)存數(shù)據(jù)存儲(chǔ)名輸入數(shù)據(jù)流輸出數(shù)據(jù)流說(shuō)明部分管理員信息管理員信息管理員信息讀者信息讀者信息讀者信息圖書信息圖書信息添加圖書借閱圖書歸還圖書圖書信息圖書借閱借閱圖書圖書信息圖書歸還歸還圖書圖書信息圖書信息查詢查詢方式圖書信息1.2.5處理過(guò)程處理過(guò)程名輸入數(shù)據(jù)流輸出數(shù)據(jù)流說(shuō)明部分增加管理員終端管理員信息增加讀者終端讀者信息添加圖書終端圖書信息借閱圖書借閱圖書圖書信息歸還圖書歸還圖書圖書信息圖書信息查詢圖書信息查詢圖書信息1.3數(shù)據(jù)庫(kù)概念結(jié)構(gòu)設(shè)計(jì)(E-R關(guān)系圖)本開(kāi)發(fā)小組成員經(jīng)過(guò)調(diào)查、信息流程分析、數(shù)據(jù)收集,并結(jié)合需求分析,明確了該系統(tǒng)的功能:1.實(shí)現(xiàn)新進(jìn)圖書的數(shù)據(jù)錄入。2.實(shí)現(xiàn)對(duì)所有購(gòu)進(jìn)圖書的分類查詢和分類統(tǒng)計(jì)。3.能夠按書名、作者等分類查詢現(xiàn)有圖書的數(shù)量。4.記錄借閱者的個(gè)人資料和所借圖書的書名、書號(hào)數(shù)據(jù)等。5.借書時(shí)如果每次超過(guò)限量或累積超過(guò)限量,提示相應(yīng)信息,并拒絕借閱。根據(jù)要求分析給出的數(shù)據(jù)流圖,參照數(shù)據(jù)字典中的詳細(xì)描述,給出日常業(yè)務(wù)管理部門的E-R圖:各實(shí)體及屬性如下:管理員管理員管理員姓名密碼使用者身份管理員及其屬性讀者讀者姓名名性別身份證電話密碼身份罰款備注讀者及其屬性圖書圖書圖書名作者出版日期類型備注圖書編號(hào)出版社數(shù)量?jī)r(jià)格圖書及其屬性借閱信息借閱信息讀者身份圖書編號(hào)借書日期還書日期借閱信息及其屬性圖書分類圖書分類類型類型描述類型編號(hào)圖書類型及其屬性Acess關(guān)系截圖:二整體設(shè)計(jì)1.1選用程序語(yǔ)言本系統(tǒng)是用C#語(yǔ)言,選用這個(gè)語(yǔ)言的原因有以下幾點(diǎn):1.C#與C/C++具有極大的相似性,我們之前認(rèn)真學(xué)習(xí)過(guò)C語(yǔ)言和c++語(yǔ)言,c#是這兩個(gè)語(yǔ)言的高效率版本,更易于上手。2.C#語(yǔ)言完美支持.NET平臺(tái),可以在Microsoft.NET平臺(tái)上事半功倍的構(gòu)建應(yīng)用程序的擴(kuò)展框架(即與數(shù)據(jù)庫(kù)的連接非常易于實(shí)現(xiàn),對(duì)數(shù)據(jù)可以直接進(jìn)行操作。)3.全界面人性化操作,實(shí)現(xiàn)代碼簡(jiǎn)單易懂,適合初學(xué)者學(xué)習(xí)。1.2選用MSAccess數(shù)據(jù)庫(kù)經(jīng)過(guò)幾天的學(xué)習(xí)和思考以及結(jié)合本系統(tǒng)的實(shí)際應(yīng)用,最后選擇使用MicrosoftAccess2003作為本系統(tǒng)的數(shù)據(jù)庫(kù)。MSAccess2003數(shù)據(jù)庫(kù)提供了表、查詢、窗體、報(bào)表、頁(yè)、宏、模塊7種用來(lái)建立數(shù)據(jù)庫(kù)系統(tǒng)的對(duì)象;提供了多種向?qū)А⑸善?、模板,把?shù)據(jù)存儲(chǔ)、數(shù)據(jù)查詢、界面設(shè)計(jì)、報(bào)表生成等操作規(guī)范化;為建立功能完善的數(shù)據(jù)庫(kù)管理系統(tǒng)提供了方便,也使得普通用戶不必編寫代碼,就可以完成大部分?jǐn)?shù)據(jù)管理的任務(wù)。個(gè)人感覺(jué)MicrsoftAccess2003作為一種關(guān)系數(shù)據(jù)庫(kù)管理系統(tǒng),具有以下的優(yōu)點(diǎn):1.存儲(chǔ)方式單一Access管理的對(duì)象有表、查詢、窗體、報(bào)表、頁(yè)、宏和模塊,以上對(duì)象都存放在后綴為(.mdb)的數(shù)據(jù)庫(kù)文件種,便于用戶的操作和管理。2.面向?qū)ο驛ccess是一個(gè)面向?qū)ο蟮拈_(kāi)發(fā)工具,利用面向?qū)ο蟮姆绞綄?shù)據(jù)庫(kù)系統(tǒng)中的各種功能對(duì)象化,將數(shù)據(jù)庫(kù)管理的各種功能封裝在各類對(duì)象中。它將一個(gè)應(yīng)用系統(tǒng)當(dāng)作是由一系列對(duì)象組成的,對(duì)每個(gè)對(duì)象它都定義一組方法和屬性,通過(guò)對(duì)象的方法、屬性完成數(shù)據(jù)庫(kù)的操作和管理,極大地簡(jiǎn)化了用戶的開(kāi)發(fā)工作。3.集成環(huán)境、處理多種數(shù)據(jù)信息Access基于Windows操作系統(tǒng)下的集成開(kāi)發(fā)環(huán)境,該環(huán)境集成了各種向?qū)Ш蜕善鞴ぞ?,極大地提高了開(kāi)發(fā)人員的工作效率,使得建立數(shù)據(jù)庫(kù)、創(chuàng)建表、設(shè)計(jì)用戶界面、設(shè)計(jì)數(shù)據(jù)查詢、報(bào)表打印等可以方便有序地進(jìn)行。4.Access支持ODBC(開(kāi)發(fā)數(shù)據(jù)庫(kù)互連,OpenDataBaseConnectivity)利用Access強(qiáng)大的DDE(動(dòng)態(tài)數(shù)據(jù)交換)和OLE(對(duì)象的聯(lián)接和嵌入)特性,可以在一個(gè)數(shù)據(jù)表中嵌入位圖、聲音、Excel表格、Word文檔,還可以建立動(dòng)態(tài)的數(shù)據(jù)庫(kù)報(bào)表和窗體等。Access還可以將程序應(yīng)用于網(wǎng)絡(luò),并與網(wǎng)絡(luò)上的動(dòng)態(tài)數(shù)據(jù)相聯(lián)接。利用數(shù)據(jù)庫(kù)訪問(wèn)頁(yè)對(duì)象生成HTML文件,輕松構(gòu)建Internet/Intranet的應(yīng)用。1.3程序流程圖圖書借閱管理系統(tǒng)圖書借閱管理系統(tǒng)登錄管理員用戶讀者管理圖書管理系統(tǒng)管理圖書分類 瀏覽用戶添加用戶瀏覽圖書瀏覽身份瀏覽讀者查詢操作用戶登錄圖書查詢借閱查詢修改密碼重新登錄用戶登錄修改密碼重新登錄三、具體設(shè)計(jì)以及程序?qū)崿F(xiàn)3.1程序的各個(gè)模塊的實(shí)現(xiàn)以及代碼和截圖設(shè)計(jì)思路:登錄界面的校驗(yàn)和很多人不一樣,我是先進(jìn)行用戶名,密碼的校驗(yàn)以后,再進(jìn)行操作的選擇。登錄界面中的用戶類型下拉菜單是對(duì)數(shù)據(jù)庫(kù)進(jìn)行查詢后得出的,這樣設(shè)計(jì)對(duì)于管理員的安全性有了很大的提高。在沒(méi)有管理員的用戶類型時(shí),是不能登錄管理員界面的。流程圖:輸入用戶名和密碼輸入用戶名和密碼在數(shù)據(jù)庫(kù)中進(jìn)行查找進(jìn)入相應(yīng)的界面提示用戶名不存在提示密碼不正確登錄成功登錄失敗登錄界面:程序代碼如下:usingSystem;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;usingSystem.Data;usingSystem.Data.OleDb;namespaceLibraryMIS{ publicclass登錄System.Windows.Forms.Form { privateSystem.Windows.Forms.ButtonbtClose; privateSystem.Windows.Forms.ButtonbtAdd; privateSystem.Windows.Forms.TextBoxpassword; privateSystem.Windows.Forms.TextBoxname; privateSystem.Windows.Forms.Labellabel3; privateSystem.Windows.Forms.Labellabel2; privateSystem.Windows.Forms.Labellabel1; privateSystem.Windows.Forms.GroupBoxgroupBox1; privateSystem.Windows.Forms.RadioButtonradioPerson; privateSystem.Windows.Forms.RadioButtonradioManage; privateSystem.ComponentModel.Containercomponents=null; privateOleDbConnectionoleConnection1=null; public登錄() { InitializeComponent(); this.oleConnection1=newOleDbConnection(LibraryMIS.database.dbConnection.connection); } protectedoverridevoidDispose(booldisposing) { if(disposing) { if(components!=null) { components.Dispose(); } } base.Dispose(disposing); } #regionWindows窗體設(shè)計(jì)器生成的代碼 privatevoidInitializeComponent() { this.btClose=newSystem.Windows.Forms.Button(); this.btAdd=newSystem.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); this.btClose.Name="btClose"; this.btClose.TabIndex=20; this.btClose.Text="取消"; this.btClose.Click+=newSystem.EventHandler(this.btClose_Click); this.btAdd.FlatStyle=System.Windows.Forms.FlatStyle.Popup; this.btAdd.ForeColor=System.Drawing.Color.Black; this.btAdd.Location=newSystem.Drawing.Point(46,208); this.btAdd.Name="btAdd"; this.btAdd.TabIndex=19; this.btAdd.Text="確定"; this.btAdd.Click+=newSystem.EventHandler(this.btAdd_Click); this.password.BorderStyle=System.Windows.Forms.BorderStyle.FixedSingle; this.password.Name="password"; this.password.PasswordChar='*'; this.password.TabIndex=18; this.password.Text="admin"; .BorderStyle=System.Windows.Forms.BorderStyle.FixedSingle; .Location=newSystem.Drawing.Point(136,128); .Name="name"; .TabIndex=17; .Text="admin"; } #endregion staticvoidMain() { Application.Run(new登錄()); } privatevoidbtAdd_Click(objectsender,System.EventArgse) { if(name.Text.Trim()==""||password.Text.Trim()=="") MessageBox.Show("請(qǐng)輸入用戶名和密碼","提示"); else { oleConnection1.Open(); OleDbCommandcmd=newOleDbCommand("",oleConnection1); if(radioManage.Checked==true) { stringsql="select*frommanagerwhereMName='"+name.Text.Trim()+"'andMCode='"+password.Text.Trim()+"'"; cmd.CommandText=sql; if(null!=cmd.ExecuteScalar()) { 主界面main=new主界面(); main.Tag=this.FindForm(); OleDbDataReaderdr; cmd.CommandText=sql; dr=cmd.ExecuteReader(); dr.Read(); main.statusBarPanel2.Text=name.Text.Trim(); main.statusBarPanel6.Text="管理員"; main.ShowDialog(); } else MessageBox.Show("用戶名或密碼錯(cuò)誤","警告?"); } elseif(radioPerson.Checked==true) { stringsql="select*frompersonwherePID='"+name.Text.Trim()+"'andPCode='"+password.Text.Trim()+"'"; cmd.CommandText=sql; if(null!=cmd.ExecuteScalar()) { 主界面main=new主界面(); main.Tag=this.FindForm(); OleDbDataReaderdr; cmd.CommandText=sql; dr=cmd.ExecuteReader(); dr.Read(); main.statusBarPanel2.Text=name.Text.Trim(); main.statusBarPanel6.Text="讀者"; main.ShowDialog(); } else MessageBox.Show("用戶名或密碼錯(cuò)誤,警告?"); } } } privatevoidbtClose_Click(objectsender,System.EventArgse) { this.Close(); } }}用戶主界面:程序代碼如下:usingSystem;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;namespaceLibraryMIS{ publicclass主界面:System.Windows.Forms.Form { privateSystem.Windows.Forms.MainMenumainMenu1; publicSystem.Windows.Forms.MenuItemmenuItem1; publicSystem.Windows.Forms.MenuItemmenuItem2; public主界面 { InitializeComponent(); protectedoverridevoidDispose(booldisposing) { if(disposing) { if(components!=null) { components.Dispose(); } } base.Dispose(disposing); } #regionWindows窗體設(shè)計(jì)器生成的代碼 privatevoidInitializeComponent() {this.mainMenu1.MenuItems.AddRange(newSystem.Windows.Forms.MenuItem[]{this.menuItem1.Index=0;this.menuItem1.MenuItems.AddRange(newSystem.Windows.Forms.MenuItem[]{this.menuItem8,this.menuItem16});this.menuItem1.Text="系統(tǒng)管理;this.menuItem16.Click+=newSystem.EventHandler(this.menuItem16_Click);this.menuItem2.Index=1;this.menuItem2.MenuItems.AddRange(newSystem.Windows.Forms.MenuItem[]{this.menuItem2.Text="圖書管理;this.menuItem9.Index=0;this.menuItem9.Text="圖書分類;this.menuItem9.Click+=newSystem.EventHandler(this.menuItem9_Click);this.menuItem20.Click+=newSystem.EventHandler(this.menuItem20_Click);this.menuItem5.Index=4;this.menuItem5.Text="查詢操作";this.menuItem11.Index=0;this.menuItem11.Text="圖書查詢";this.menuItem11.Click+=newSystem.EventHandler(this.menuItem11_Click);this.toolBarButton1.ImageIndex=0;this.toolBarButton1.Text="系統(tǒng)";this.toolBarButton2.ImageIndex=14;this.toolBarButton2.Name="toolBarButton2";this.toolBarButton2.Text="讀者";this.toolBarButton6.ImageIndex=9;this.toolBarButton6.Text="用戶";this.imageList1.ImageStream=this.Name="主界面";this.StartPosition=System.Windows.Forms.FormStartPosition.CenterScreen;this.Text="主界面";this.Load+=newSystem.EventHandler(this.main_Load);this.ResumeLayout(false);this.PerformLayout(); } #endregion privatevoidmenuItem1_Click(objectsender,System.EventArgse) { } 添加用戶addUser; privatevoidmenuItem8_Click(objectsender,System.EventArgse) { addUser=new添加用戶(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } addUser.MdiParent=this; addUser.WindowState=FormWindowState.Maximized; addUser.Show(); } 圖書類型type; privatevoidmenuItem9_Click(objectsender,System.EventArgse) { type=new圖書類型(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } type.MdiParent=this; type.WindowState=FormWindowState.Maximized; type.Show(); } 圖書book; privatevoidmenuItem17_Click(objectsender,System.EventArgse) { book=new圖書|(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } book.MdiParent=this; book.WindowState=FormWindowState.Maximized; book.Show(); } 借閱者信息person; privatevoidmenuItem18_Click(objectsender,System.EventArgse) { person=new借閱者信息(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } person.MdiParent=this; person.WindowState=FormWindowState.Maximized; person.Show(); } 身份identity; privatevoidmenuItem10_Click(objectsender,System.EventArgse) { identity=new身份(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } identity.MdiParent=this; identity.WindowState=FormWindowState.Maximized; identity.Show(); } 借書bookOut; privatevoidmenuItem19_Click(objectsender,System.EventArgse) { bookOut=new借書(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } bookOut.MdiParent=this; bookOut.WindowState=FormWindowState.Maximized; bookOut.Show(); } 還書bookIn; privatevoidmenuItem20_Click(objectsender,System.EventArgse) { bookIn=new還書(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } bookIn.MdiParent=this; bookIn.WindowState=FormWindowState.Maximized; bookIn.Show(); } 圖書查詢bookQuery; privatevoidmenuItem11_Click(objectsender,System.EventArgse) { bookQuery=new圖書查詢(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } bookQuery.MdiParent=this; bookQuery.WindowState=FormWindowState.Maximized; bookQuery.Show(); } 借閱者查詢personQuery; privatevoidmenuItem12_Click(objectsender,System.EventArgse) { personQuery=new借閱者查詢(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } personQuery.MdiParent=this; personQuery.Tag=this.statusBarPanel2.Text.Trim(); personQuery.WindowState=FormWindowState.Maximized; personQuery.Show(); } 修改密碼modifyCode; privatevoidmenuItem13_Click(objectsender,System.EventArgse) { modifyCode=new修改密碼(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } modifyCode.MdiParent=this; modifyCode.Tag=this.statusBarPanel2.Text.Trim(); modifyCode.label5.Text=this.statusBarPanel6.Text.Trim(); modifyCode.WindowState=FormWindowState.Maximized; modifyCode.Show(); } privatevoidmenuItem14_Click(objectsender,System.EventArgse) { ((System.Windows.Forms.Form)this.Tag).Visible=true; this.Close(); } privatevoidmain_Load(objectsender,System.EventArgse) { statusBarPanel1.Text="當(dāng)前登錄用戶"; statusBarPanel3.Text=DateTime.Now.ToString(); statusBarPanel4.Text="作者"; statusBarPanel5.Text="圖書館管理信息系統(tǒng)"; } 用戶列表user; privatevoidmenuItem16_Click(objectsender,System.EventArgse) { user=new用戶列表(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } user.MdiParent=this; user.WindowState=FormWindowState.Maximized; user.Show(); } privatevoidtoolBar1_ButtonClick(objectsender,System.EventArgse) { } privatevoidtoolBar1_ButtonClick(objectsender,System.Windows.Forms.ToolBarButtonClickEventArgse) { switch(toolBar1.Buttons.IndexOf(e.Button)) { case0: FormaddUser=new添加用戶(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } addUser.MdiParent=this; addUser.WindowState=FormWindowState.Maximized; addUser.Show(); break; case1: Formperson=new借閱者信息(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } person.MdiParent=this; person.WindowState=FormWindowState.Maximized; person.Show(); break; case2: FormbookOut=new借書(); for(intx=0;x<this.MdiChildren.Length;x++) { FormtempChild=(Form)this.MdiChildren[x]; tempChild.Close(); } bookOut.MdiParent=this; bookOut.WindowState=FormWindowState.Maximized; bookOut.Show(); break; } } }}運(yùn)行效果如下:usingSystem;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;usingSystem.Data;usingSystem.Data.OleDb;namespaceLibraryMIS{ publicclass借閱者信息:System.Windows.Forms.Form { privateSystem.Windows.Forms.Labellabel1; privateSystem.Windows.Forms.ButtonbtAdd; privateSystem.Windows.Forms.ButtonbtClose; privateSystem.Windows.Forms.ButtonbtDel; privateSystem.Windows.Forms.ButtonbtModify; privateSystem.Windows.Forms.DataGriddataGrid1; privateSystem.ComponentModel.Containercomponents=null; privateOleDbConnectionoleConnection1=null; public借閱者信息() { InitializeComponent(); this.oleConnection1=newOleDbConnection(LibraryMIS.database.dbConnection.connection); protectedoverridevoidDispose(booldisposing) { if(disposing) { if(components!=null) { components.Dispose(); } } base.Dispose(disposing); } #regionWindows窗體設(shè)計(jì)器生成的代碼 privatevoidInitializeComponent() { this.label1=newSystem.Windows.Forms.Label(); this.btAdd=newSystem.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.SuspendLayout(); this.label1.Font=newSystem.Drawing.Font("楷?體??_GB2312",14.25F,System.Drawing.FontStyle.Bold,System.Drawing.GraphicsUnit.Point,((System.Byte)(134))); this.label1.Location=newSystem.Drawing.Point(155,12); this.label1.TabIndex=26; this.label1.Text="借閱者信息"; this.btAdd.FlatStyle=System.Windows.Forms.FlatStyle.Popup; this.btAdd.ForeColor=System.Drawing.Color.Black; this.btAdd.Location=newSystem.Drawing.Point(475,60); this.btAdd.Name="btAdd"; this.btAdd.TabIndex=25; this.btAdd.Text="添加"; this.btClose.Name="btClose"; this.btClose.TabIndex=24; this.btClose.Text="退出"; this.BackColor=System.Drawing.Color.Snow; this.ClientSize=newSystem.Drawing.Size(560,302); this.Name="Person"; this.Text="借閱者信息"; this.Load+=newSystem.EventHandler(this.Person_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); this.ResumeLayout(false); } #endregion DataSetds; privatevoidPerson_Load(objectsender,System.EventArgse) { oleConnection1.Open(); stringsql="selectPIDas借書證編號(hào),PNameas姓名,PSexas性別,PPhoneas電話,PNas身份證,PCodeas密碼" "PMoneyas罰款identityas身份Y,PRemarkas備注fromperson"; OleDbDataAdapteradp=newOleDbDataAdapter(sql,oleConnection1); oleConnection1.Close(); } 添加借閱者addPerson; privatevoidbtAdd_Click(objectsender,System.EventArgse) { addPerson=new添加借閱者(); addPerson.ShowDialog(); } oleConnection1.Open(); stringsql="delete*frompersonwherePID='"+ds.Tables[0].Rows[dataGrid1.CurrentCell.RowNumber][0].ToString().Trim()+"'"; OleDbCommandcmd=newOleDbCommand(sql,oleConnection1); cmd.ExecuteNonQuery(); MessageBox.Show("刪除借閱者?'"+ds.Tables[0].Rows[dataGrid1.CurrentCell.RowNumber][1].ToString().Trim()+"'成功","提示"); } else return; } privatevoidbtClose_Click(objectsender,System.EventArgse) { this.Close(); } }}程序代碼如下;usingSystem;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;usingSystem.Data;usingSystem.Data.OleDb;namespaceLibraryMIS{ publicclass圖書類型:System.Windows.Forms.Form { privateSystem.Windows.Forms.ButtonbtClose; privateSystem.Windows.Forms.ButtonbtDel; privateSystem.Windows.Forms.ButtonbtModify; privateSystem.Windows.Forms.DataGriddataGrid1; privateSystem.Windows.Forms.ButtonbtAdd; privateSystem.ComponentModel.Containercomponents=null; privateSystem.Windows.Forms.Labellabel1; privateOleDbConnectionoleConnection1=null; public圖書類型() { InitializeComponent(); this.oleConnection1=newOleDbConnection(LibraryMIS.database.dbConnection.connection); } protectedoverridevoidDispose(booldisposing) { if(disposing) { if(components!=null) { components.Dispose(); } } base.Dispose(disposing); } #regionWindows窗體設(shè)計(jì)器生成的代碼 privatevoidInitializeComponent() { this.btClose=newSystem.Windows.Forms.Button(); this.btDel=newSystem.Windows.Forms.Button(); this.btModify=newSystem.Windows.Forms.Button(); this.dataGrid1=newSystem.Windows.Forms.DataGrid(); this.btAdd=newSystem.Windows.Forms.Button(); this.label1=newSystem.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); DataSetds; privatevoidType_Load(objectsender,System.EventArgse) { oleConnection1.Open(); stringsql="selecttypeas類型,tRemarkas類型描述,TIDas類型編號(hào)?fromtype"; OleDbDataAdapteradp=newOleDbDataAdapter(sql,oleConnection1); ds=newDataSet(); ds.Clear(); oleConnection1.Close(); } 添加類型addType; privatevoidbtAdd_Click(objectsender,System.EventArgse) { addType=new添加類型(); addType.ShowDialog(); } 修改類型modifyType; privatevoidbtModify_Click(objectsender,System.EventArgse) { if(dataGrid1.DataSource!=null||dataGrid1[dataGrid1.CurrentCell]!=null) { modifyType=new修改類型(); modifyType.textName.Text=ds.Tables["type"].Rows[dataGrid1.CurrentCell.RowNumber][0].ToString().Trim(); modifyType.textRemark.Text=ds.Tables["type"].Rows[dataGrid1.CurrentCell.RowNumber][1].ToString().Trim(); modifyType.Tag=ds.Tables["type"].Rows[dataGrid1.CurrentCell.RowNumber][2].ToString().Trim(); modifyType.Show(); } } privatevoidbtDel_Click(objectsender,System.EventArgse) { if(dataGrid1.CurrentRowIndex>=0&&dataGrid1.DataSource!=null&&dataGrid1[dataGrid1.CurrentCell]!=null) { dr.Close(); sql="delete*fromtypewheretypenotin(selectdistincttypefrombook)andTID""="+ds.Tables["type"].Rows[dataGrid1.CurrentCell.RowNumber][2].ToString().Trim()+""; cmd.CommandText=sql; cmd.ExecuteNonQuery(); MessageBox.Show("刪除類型"+ds.Tables[0].Rows[dataGrid1.CurrentCell.RowNumber][0].ToString().Trim()+"'成功","提示"); } oleConnection1.Close(); } else return; } privatevoidbtClose_Click(objectsender,System.EventArgse) { this.Close(); } }}usingSystem;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;usingSystem.Data;usingSystem.Data.OleDb;namespaceLibraryMIS{ publicclass圖書查詢:System.Windows.Forms.Form { privateSystem.Windows.Forms.DataGriddataGrid1; privateSystem.Windows.Forms.Labellabel9; privateSystem.Windows.Forms.Labellabel1; privateSystem.Windows.Forms.Labellabel2; privateSystem.Windows.Forms.TextBoxtextID; privateSystem.Windows.Forms.TextBoxtextName; privateSystem.ComponentModel.Containercomponents=null; privateOleDbConnectionoleConnection1=null; public圖書查詢() { InitializeComponent(); this.oleConnection1=newOleDbConnection(LibraryMIS.database.dbConnection.connection); } protectedoverridevoidDispose(booldisposing) { if(disposing) { if(components!=null) { components.Dispose(); } } base.Dispose(disposing); } #regionWindows窗體設(shè)計(jì)器生成的代碼 privatevoidInitializeComponent() { this.dataGrid1=newSystem.Windows.Forms.DataGrid(); this.label9=newSystem.Windows.Forms.Label(); this.label9.TabIndex=22; this.label9.Text="圖書編號(hào)?"; this.textID.BorderStyle=System.Windows.Forms.BorderStyle.FixedSingle; this.textID.Location=newSystem.Drawing.Point(111,16); this.textID.Name="textID"; this.label2.Text="作者?"; this.textWriter.BorderStyle=System.Windows.Forms.BorderStyle.FixedSingle; this.textWriter.Location=newSystem.Drawing.Point(416,16); this.textWriter.Name="textWriter"; this.textWriter.TabIndex=27; this.textWriter.Text=""; this.btQuery.FlatStyle=System.Windows.Forms.FlatStyle.Popup; this.btQuery.Location=newSystem.Drawing.Point(104,48); this.btQuery.Name="btQuery"; this.btQuery.TabIndex=28; this.btQuery.Text="查詢"; this.btQuery.Click+=newSystem.EventHandler(this.btQuery_Click); this.AutoScaleBaseSize=newSystem.Drawing.Size(6,14); this.BackColor=System.Drawing.Color.Snow; this.ClientSize=newSystem.Drawing.Size(582,316); this.Name="BookQuery"; this.Text="圖書查詢"; ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); this.ResumeLayout(false); } #endregion privatevoidbtQuery_Click(objectsender,System.EventArgse) { stringsql1="(BNum-(selectcount(*)frombookOutwhere"; { sql1=sql1+"BID="+"'"+textID.Text.Trim()+"'))as庫(kù)存數(shù)量"; sql=sql+sql1+"frombookwhereBID="+"'"+textID.Text.Trim()+"'"; } elseif(textName.Text.Trim()!="") { sql=sql+sql1+"frombookwhereBName="+"'"+textName.Text+"'"; } elseif(textWriter.Text.Trim()!="") { sql=sql+sql1+"frombookwhereBWriter="+"'"+textWriter.Text+"'"; } oleConnection1.Open(); OleDbDataAdapteradp=newOleDbDataAdapter(sql,oleConnection1); DataSetds=newDataSet(); ds.Clear(); adp.Fill(ds,"book"); dataGrid1.DataSource=ds.Tables[0].DefaultView; oleConnection1.Close(); } privatevoidbtClear_Click(objectsender,System.EventArgse) { textID.Text=""; textName.Text=""; textWriter.Text=""; } privatevoidbtClose_Click(objectsender,System.EventArgse) { this.Close(); } }}usingSystem;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;usingSystem.Data;usingSystem.Data.OleDb;namespaceLibraryMIS{ publicclass借閱者查詢:System.Windows.Forms.Form { privateSystem.Windows.Forms.GroupBoxgroupBox1; privateSystem.Windows.Forms.DataGriddataGrid2; privateSystem.Windows.Forms.GroupBoxgroupBox2; privateSystem.Windows.Forms.DataGriddataGrid1; privateSystem.ComponentModel.Containercomponents=null; privateSystem.Windows.Forms.DataGriddataGrid3; privateOleDbConnectionoleConnection1=null; public借閱者查詢() { InitializeComponent(); this.oleConnection1=newOleDbConnection(LibraryMIS.database.dbConnection.co

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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)論