九九热最新网址,777奇米四色米奇影院在线播放,国产精品18久久久久久久久久,中文有码视频,亚洲一区在线免费观看,国产91精品在线,婷婷丁香六月天

歡迎來到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁 裝配圖網(wǎng) > 資源分類 > DOC文檔下載  

圖書管理系統(tǒng)課程設(shè)計報告.doc

  • 資源ID:116524665       資源大?。?span id="24d9guoke414" class="font-tahoma">864.50KB        全文頁數(shù):16頁
  • 資源格式: DOC        下載積分:13積分
快捷下載 游客一鍵下載
會員登錄下載
微信登錄下載
三方登錄下載: 微信開放平臺登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要13積分
郵箱/手機:
溫馨提示:
用戶名和密碼都是您填寫的郵箱或者手機號,方便查詢和重復(fù)下載(系統(tǒng)自動生成)
支付方式: 支付寶    微信支付   
驗證碼:   換一換

 
賬號:
密碼:
驗證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會被瀏覽器默認打開,此種情況可以點擊瀏覽器菜單,保存網(wǎng)頁到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無水印,預(yù)覽文檔經(jīng)過壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標(biāo)題沒有明確說明有答案則都視為沒有答案,請知曉。

圖書管理系統(tǒng)課程設(shè)計報告.doc

管理信息系統(tǒng)實習(xí)報告專 業(yè) 班 級 學(xué) 生 姓 名 指 導(dǎo) 教 師 王 桃 群 時 間 2012.3.132012.3.23 成 績 評 語 一、課程設(shè)計題目 圖書管理系統(tǒng)二、系統(tǒng)需求1.系統(tǒng)的準(zhǔn)備操作系統(tǒng):Windows xp數(shù)據(jù)庫系統(tǒng):SQL Server 2000 或 SQL Server 2005客戶端開發(fā)工具:Visual Studio 2005或其他開發(fā)工具2.知識準(zhǔn)備熟悉SQL Server 2000 或 SQL Server 2005的使用;熟悉C#、ASP.NET或其他語言進行數(shù)據(jù)庫編程。3.系統(tǒng)分析圖書信息包括:每種圖書都有書名、ISBN、一名或多名作者(譯者)、出版社、定價和內(nèi)容簡介等;讀者信息包括:借書證記錄有借閱者的姓名、密碼、所在單位和類別等;讀者憑借書證借書,教師最多借書15本書,借書期限最長為90天,學(xué)生最多借書8本書,借書期限最長為30天。對于超期未還的讀者不能繼續(xù)借書,每本書每超期一天罰款0.05元。三、系統(tǒng)設(shè)計1.體系結(jié)構(gòu)本系統(tǒng)使用c/s模式的兩層結(jié)構(gòu),表示層(USL)和數(shù)據(jù)訪問層(DAL)。表示層(USL):為客戶提供對應(yīng)用程序的訪問,以Windows應(yīng)用程序或Web應(yīng)用程序的形式提供實現(xiàn)的功能。業(yè)務(wù)邏輯層(BLL):實現(xiàn)應(yīng)用程序的業(yè)務(wù)功能,以類庫的形式為表示層提供服務(wù)。數(shù)據(jù)訪問層(DAL):實現(xiàn)整個系統(tǒng)所有的數(shù)據(jù)庫連接、數(shù)據(jù)存取操作,以組件類庫的形式為業(yè)務(wù)邏輯層提供服務(wù)。此外,實體類,簡單地說是描述一個業(yè)務(wù)實體的類。業(yè)務(wù)實體直觀一點的理解就是整個應(yīng)用系統(tǒng)業(yè)務(wù)所涉及的對象,從數(shù)據(jù)存儲來講,業(yè)務(wù)實體就是存儲應(yīng)用系統(tǒng)信息的數(shù)據(jù)表,將數(shù)據(jù)表中的每一個字段定義成屬性,并將這些屬性用一個類封裝,這個類就稱為實體類。2.功能模塊框圖圖 書 管 理借 書圖 書 管 理借書圖書更新圖書刪除圖書查找圖書添加3.數(shù)據(jù)庫設(shè)計1. 讀者類別表(ReaderType)字段名數(shù)據(jù)類型說明rdTypeSmallInt讀者類別【主鍵】rdTypeNameVarchar(8)讀者類別名稱CanLendQtyInt可借書數(shù)量CanLendDayInt可借書天數(shù)CanContinueTimesInt可續(xù)借的次數(shù)PunishRateFloat罰款率(分/天/本)DateValidSmallInt證書有效日期2. 讀者信息表(Reader)字段名數(shù)據(jù)類型說明rdIDInt讀者序號【主鍵】rdNamevarchar(10)讀者姓名rdPwdvarchar (10)讀者密碼,初值為“123”rdSexBit性別,0-男,1-女rdTypeSmallInt讀者類別【外鍵】rdDeptChar(8)單位代碼rdPhonevarchar(25)電話號碼rdEmailvarchar(25)電子郵件rdDateRegsmalldatetime讀者登記日期rdBorrowQtyInt已借書數(shù)量3. 圖書信息表(Book)字段名數(shù)據(jù)類型說明bkIDInt圖書序號【主鍵】bkCodeChar(20)圖書編號bkNameVarchar(50)書名bkAuthorVarchar(30)作者bkPressVarchar(50)出版社bkDatePressSmalldatetime出版日期bkISBNChar(15)書號bkCatalogVarchar(30)分類名bkLanguageSmallInt語言,0-中文,1-英文,2-日文,3-俄文,4-德文,5-法文bkPagesInt頁數(shù)bkPriceMoney價格bkDateInSmallDateTime入館日期bkBriefText內(nèi)容簡介bkCoverVarchar(100) 或image圖書封面照片bkIsInLabChar(4)是否在館4. 借閱信息表(Borrow)字段名數(shù)據(jù)類型說明rdIDInt讀者序號【主鍵】bkIDInt圖書序號【主鍵】ldContinueTimesInt續(xù)借次數(shù)(第一次借時,記為1)ldDateOutSmallDateTime借書日期ldDateRetPlanSmallDateTime應(yīng)還日期ldDateRetActSmallDateTime實際還書日期ldOverDayInt超期天數(shù)ldOverMoneyMoney超期金額ldPunishMoneyMoney罰款金額lsHasReturnBit是否已經(jīng)還書,缺省為0-未還OperatorLendVarChar(10)借書操作員OperatorRetVarChar(10)還書操作員四、系統(tǒng)實現(xiàn) 登錄的代碼實現(xiàn):using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace BooksMng public partial class BookLogin : Form public BookLogin() InitializeComponent(); private void textBox2_TextChanged(object sender, EventArgs e) private void btnlogin_Click(object sender, EventArgs e) /連接數(shù)據(jù)庫 SqlConnection conn = new SqlConnection(server=.;database=Booksmng; integrated security=True); conn.Open(); SqlCommand cmd = conn.CreateCommand(); /cmd.CommandText=select count(*) from Users where userName=+txtName.Text+and userPwd=+txtPwd.Text+; cmd.CommandText = select count(*) from Users where userName=userName and userPwd=userPwd; cmd.Parameters.Add(userName, SqlDbType.VarChar, 20).Value = txtName.Text; cmd.Parameters.Add(userPwd, SqlDbType.VarChar, 20).Value = txtPwd.Text; try int count = Convert.ToInt32(cmd.ExecuteScalar(); if (count != 0) MessageBox.Show(登陸成功!); BookMain frm = new BookMain(); frm.Show(); catch (SqlException ex) /MessageBox.Show(登錄失敗!); MessageBox.Show(ex.Message); private void FrmLogin_Load(object sender, EventArgs e) 圖書管理部分,主要的代碼實現(xiàn)如下:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace BooksMng public partial class BookManage : Form public BookManage() InitializeComponent(); private void Form2_Load(object sender, EventArgs e) DataBind(); private void DataBind() /連接數(shù)據(jù)庫 SqlConnection conn = new SqlConnection(server=.; database=BooksMng;integrated security=True); /SqlConnection conn = new SqlConnection(server=.; database=BooksMng;integrated security=True); conn.Open(); SqlCommand cmd = conn.CreateCommand(); /mandText = select * from Book; cmd.CommandText = select bkID 編號, bkName 書名,bkAuthor 作者,bkPages 頁數(shù),bkPress 出版社 from Book; SqlDataAdapter sda = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); sda.Fill(ds); dgvBooks.DataSource = ds.Tables0; txtName.DataBindings.Clear(); txtAuthor.DataBindings.Clear(); txtPage.DataBindings.Clear(); txtPress.DataBindings.Clear(); txtName.DataBindings.Add(Text,ds.Tables0,書名); txtAuthor.DataBindings.Add(Text,ds.Tables0,作者); txtPage.DataBindings.Add(Text,ds.Tables0,頁數(shù)); txtPress.DataBindings.Add(Text, ds.Tables0, 出版社); /上面的代碼是在窗體Load時,將Books表中的所有記錄,即所有的圖書信息顯示在網(wǎng)格DataGrid空間中。 / /下面是實現(xiàn)添加功能 private void btnAdd_click(object sender, EventArgs e) SqlConnection conn = new SqlConnection(server=.; database=BooksMng;integrated security=True); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = insert into Book(bkName, bkAuthor,bkPages,bkPress) values(bkName,bkAuthor,bkPages,bkPress); cmd.Parameters.Add(bkName, SqlDbType.VarChar, 30).Value = txtName.Text; cmd.Parameters.Add(bkAuthor, SqlDbType.VarChar, 30).Value = txtAuthor.Text; cmd.Parameters.Add(bkPages, SqlDbType.Int).Value =Convert.ToInt32(txtPage.Text);/類型轉(zhuǎn)換 cmd.Parameters.Add(bkPress, SqlDbType.VarChar, 50).Value = txtPress.Text; try cmd.ExecuteNonQuery(); /執(zhí)行上述SQL命令 MessageBox.Show(圖書添加成功!); DataBind(); /重新將數(shù)據(jù)庫綁定到DataGrid catch (SqlException ex) MessageBox.Show(圖書添加失敗); MessageBox.Show(ex.Message); private void btnSearch_Click(object sender, EventArgs e) /連接數(shù)據(jù)庫 SqlConnection conn = new SqlConnection(server=.; database=BooksMng;integrated security=True); conn.Open(); SqlCommand cmd = conn.CreateCommand(); String sql = ; /按作者查找 if (txtAuthor.Text != ) sql += select bkID 編號, bkName 書名,bkPages 頁數(shù),bkPress 出版社 from Book where bkAuthor=bkAuthor; try cmd.CommandText=sql; cmd.Parameters.Add(bkAuthor, SqlDbType.VarChar, 30).Value = txtAuthor.Text; SqlDataAdapter sda=new SqlDataAdapter(cmd); DataSet ds=new DataSet(); sda.Fill(ds); dgvBooks.DataSource = ds.Tables0; catch(SqlException ex) MessageBox.Show(查找失敗); MessageBox.Show(ex.Message); private void btnDelete_Click(object sender, EventArgs e) /連接數(shù)據(jù)庫 SqlConnection conn = new SqlConnection(server=.; database=BooksMng;integrated security=True); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = delete from Book where bkID=bkID; cmd.Parameters.Add(bkID, SqlDbType.Int).Value = Convert.ToInt32(dgvBooks0, dgvBooks.CurrentRow.Index.Value); try if (MessageBox.Show(確定要刪除該圖書嗎?, 確定刪除, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = DialogResult.OK) cmd.ExecuteNonQuery(); MessageBox.Show(刪除成功!); DataBind(); catch (SqlException ex) MessageBox.Show(刪除失敗); MessageBox.Show(ex.Message); /下面做更新圖書信息 private void btnUpdate_Click(object sender, EventArgs e) SqlConnection conn = new SqlConnection(server=.; database=BooksMng;integrated security=True); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = update Book set bkName=bkName, bkAuthor=bkAuthor, bkPages=bkPages,bkPress=bkPress where bkID=bkID; cmd.Parameters.Add(bkID, SqlDbType.Int).Value = Convert.ToInt32(dgvBooks0, dgvBooks.CurrentRow.Index.Value); cmd.Parameters.Add(bkName, SqlDbType.VarChar, 30).Value = txtName.Text; cmd.Parameters.Add(bkAuthor, SqlDbType.VarChar, 30).Value =txtAuthor.Text; cmd.Parameters.Add(bkPages, SqlDbType.Int).Value = Convert.ToInt32(txtPage.Text);/類型轉(zhuǎn)換 cmd.Parameters.Add(bkPress, SqlDbType.VarChar, 50).Value = txtPress.Text; try if (MessageBox.Show(確定要更新圖書信息嗎?, 確認更新, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = DialogResult.OK) cmd.ExecuteNonQuery(); MessageBox.Show(更新成功!); DataBind(); catch (SqlException ex) MessageBox.Show(更新失敗); MessageBox.Show(ex.Message); /圖書可以添加成功借書實現(xiàn)主要代碼如下:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace BooksMng public partial class BookBorrow : Form public BookBorrow() InitializeComponent(); /獲取讀者可借天數(shù) private int GetLendDay(int rdID) SqlConnection conn = new SqlConnection(server=.;database=BooksMng;integrated security=true); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = select CanLendDay from ReaderType where rdType=(select rdType from Reader where rdID= + rdID + ); return Convert.ToInt32(cmd.ExecuteScalar(); private void btnBorrow_Click(object sender, EventArgs e) SqlConnection conn = new SqlConnection(server=.;database=BooksMng;integrated security=true); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = insert into Borrow(rdID,bkID,ldContinueTimes,IdDateOut,ldDateRetPlan,lsHasReturn) values(rdID,bkID,0,IdDateOut,ldDateRetPlan,0); cmd.Parameters.Add(rdID, SqlDbType.Int).Value = Convert.ToInt32(txtrdID.Text); cmd.Parameters.Add(bkID, SqlDbType.Int).Value = Convert.ToInt32(txtbkID.Text);/類型轉(zhuǎn)換 cmd.Parameters.Add(IdDateOut, SqlDbType.DateTime).Value = DateTime.Now;/借書時間為當(dāng)前的系統(tǒng)時間 /應(yīng)還日期為=借書日期+可借天數(shù)cmd.Parameters.Add(ldDateRetPlan, SqlDbType.DateTime).Value = DateTime.Now.AddDays(GetLendDay(Convert.ToInt32(txtrdID.Text); try cmd.ExecuteNonQuery(); MessageBox.Show(借書成功!); catch (SqlException ex) MessageBox.Show(借書失敗); MessageBox.Show(ex.Message); 五、系統(tǒng)運行效果 圖書管理模塊的運行結(jié)果如下:首先,設(shè)計一個用戶登錄界面,以管理員的身份登錄來實現(xiàn)圖書的添加、查找、刪除、更新的功能。 登錄界面的設(shè)計:登錄成功的效果登錄成功以后,跳到圖書管理主界面:圖書管理主界面如下:登錄成功以后,跳到圖書管理的頁面:圖書管理的頁面如下: 此界面可以對圖書實現(xiàn)添加、查找、刪除和信息更新這四個功能。從圖書管理主界面跳到借書界面:六、遇到的問題及解決方法 在實現(xiàn)借書這個功能時,老是借書失敗,并且提示: 憑借這個提示是不可能找到錯誤的,為了找到這個錯誤,我設(shè)置了一個斷點如圖: 然后逐句運行,發(fā)現(xiàn)錯誤在 “catch (SqlException ex)”這句,并且提示:點擊獲取錯誤的幫助,軟件給出的幫助是:我不知道這是什么錯誤,但是我知道錯誤不在“catch (SqlException ex)”這句,因為每當(dāng)執(zhí)行“cmd.ExecuteNonQuery();”這句時,就會跳到“catch (SqlException ex)”這句,并且提示有錯誤。我上網(wǎng)搜索了“cmd.ExecuteNonQuery();”此語句,發(fā)現(xiàn)有這么一段解釋: cmd.Parameters.Add(New OleDbParameter(用戶名, OleDbType.VarChar) 首先你的insertinto這個SQL語句是錯誤的,應(yīng)該是insert into Enternumber(username,password,sex,work,tel,mail) values (用戶名,密碼,性別,職業(yè),電話,郵箱) 其次就是最關(guān)鍵的錯誤,parameters這個方法使用時一定要有這樣一個語句mandtypeCommandType.StoredProcedure這個語句的作用是用存儲方法來傳值的,也就是說在你的數(shù)據(jù)庫中一定要一個存儲過程, parameters方法的使用前面應(yīng)該有,mandtype=commandtype.storedprocedure mandtext=存儲過程 cmd.parameters.add(new oledbparameter(存儲變量的一個變量名,數(shù)值) 此時我終于知道了,是數(shù)據(jù)庫插入于具有問題,經(jīng)過我反復(fù)的比較數(shù)據(jù)庫中的各個鍵的屬性,左最終改掉了所有的錯誤,程序運行正確。七、心得與體會這次的課程設(shè)計主要使用c#和SQL Server這兩種知識來設(shè)計一個圖書管理系統(tǒng),而對于這兩種知識我們曾經(jīng)都開了課程,并且進行了系統(tǒng)的學(xué)習(xí)。我曾經(jīng)自認為SQL Server還學(xué)得不錯,因為書上的東西差不多都弄懂了,然而這次課程設(shè)計我卻發(fā)現(xiàn)書上的東西我?guī)缀跬貌畈欢嗔?,一個很簡單的查詢語句都不知道怎么去寫。我恍然間發(fā)覺自己做的很差,對于已經(jīng)學(xué)的東西沒有很好地進行運用,以至于很多已經(jīng)學(xué)了的東西都已經(jīng)忘記了。雖然如此,但老師仍很耐心的給我們講解,知道我們?nèi)绾我徊揭徊降厝プ?,真的很感謝老師為我們的付出。通過這兩個星期的課程設(shè)計,是我對所學(xué)知識有了更深一步的理解與掌握,理論與實踐也能更好地結(jié)合在一起,這一過程中我遇到了很多困難,但這更使我覺得其中的樂趣和那種戰(zhàn)勝困難后的成就感。同時感到學(xué)無止境,在今后的學(xué)習(xí)和工作中,我會不斷地充實自己。

注意事項

本文(圖書管理系統(tǒng)課程設(shè)計報告.doc)為本站會員(good****022)主動上傳,裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng)(點擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因為網(wǎng)速或其他原因下載失敗請重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!