版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、畢業(yè)設(shè)計(jì)_圖書(shū)管理系統(tǒng) 一、數(shù)據(jù)庫(kù)設(shè)計(jì)數(shù)據(jù)庫(kù)設(shè)CREATEDATABASETSGL GO USETSGL GO CREATETABLEBmanage( bId varchar(10)PRIMARYKEY,bNamevarchar(50),-添加圖書(shū)-圖書(shū)編號(hào)-書(shū)名bNumbervarchar(10),-書(shū)數(shù)目) GO bSorevarchar(50)-分類CREATETABLEMadmin( mNamevarchar(10)PRIMARYKEY,mPwdvarchar(25),mAgevarchar(8),mSexvarchar(4),mNumbervarchar(15),mrolevarch
2、ar(8) GO -圖書(shū)員管理-圖書(shū)管理員姓名-圖書(shū)管理員密碼-圖書(shū)管理員年齡-圖書(shū)管理員性別-圖書(shū)管理員 -圖書(shū)管理員角色CREATETABLEReader( rSnovarchar(10)PRIMARYKEY,rNamevarchar(10),rPwdvarchar(25),rAgevarchar(8),rSexvarchar(4),rStatevarchar(8),rNumbervarchar(15),rEmailvarchar(25),-讀者信息表reader -讀者號(hào)-姓名-密碼-年齡-性別-狀態(tài)- 號(hào)碼-電子郵件rAdressvarChar(50),-地址) GO rGradeva
3、rChar(15),rClassvarchar(15),rRolevarchar(8)-年級(jí)-班級(jí)-角色CREATETABLERrecord( rSnovarchar(10)PRIMARYKEY,rNamevarChar(10),bId varchar(10),bNamevarChar(50),bTimevarchar(10),bBackTimevarchar(10) GO CREATETABLESysSet( rRolevarchar(8)PRIMARYKEY,rStatevarchar(8),Finefloat(25),rDayvarchar(8)-讀者編號(hào)學(xué)號(hào)-讀者姓名-圖書(shū)編號(hào)-圖書(shū)名
4、稱-借書(shū)時(shí)間-還書(shū)時(shí)間-讀者角色-讀者可借書(shū)數(shù)-過(guò)期罰款設(shè)置-可借書(shū)天數(shù))二、界面截圖及說(shuō)明1)登錄窗口實(shí)現(xiàn)管理員和館長(zhǎng)的登陸 2)管理員窗口 3)館長(zhǎng)窗口 4)關(guān)于窗口 5)新增圖書(shū)窗口 6)新增管理員、查找及修改窗口 7)新增讀者、查找及修改窗口 8)圖書(shū)的查找及修改窗口 9)借閱窗口 10)系統(tǒng)設(shè)置窗口 三、主要代碼主要代1)登錄窗口實(shí)現(xiàn)管理員和館長(zhǎng)的登陸 登陸檢查: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using
5、prjTSGL.ClassLib.DBAccess; namespaceLib.Logic classclsLoginCheck publicstaticDataTable CheckLogin(string UserId, string PWD) string SQLstmt = select mName,mPwd,mRole from Madmin where mName= + UserId + and mPwd= + PWD + ; DataTable dt = clsGlobalVar.GetDataTable(SQLstmt); return dt; 登陸: using System
6、; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using prjTSGL.ClassLib.Logic; namespace publicpartialclassfrmLogin : Form public frmLogin() InitializeComponent(); privatevoid b
7、tnLogin_Click(object sender, EventArgs e) string strUserID = loginid.Text.Trim(); string strPWD = loginpwd.Text.Trim(); string type = ; try DataTable dt = clsLoginCheck.CheckLogin(strUserID, strPWD); if (dt.Rows.Count = 0) MessageBox.Show(登陸失敗,請(qǐng)重新輸入!); loginpwd.Focus(); return; else type = dt.Rows0m
8、Role.ToString().Trim(); if (cboLT.Text.Trim()=館長(zhǎng) ) if (type = 館長(zhǎng)) this.Hide(); frmManager objManager = newfrmManager(); objManager.Show(); else MessageBox.Show(您沒(méi)有權(quán)限!); ocus(); return; else if (type =管理員) this.Hide(); frmAdmin objAdmin = newfrmAdmin(); objAdmin.Show(); else MessageBox.Show(您沒(méi)有權(quán)限!);
9、loginpwd.Focus(); return; catch (Exception ex) throw ex; privatevoid btnExit_Click(object sender, EventArgs e) this.Close(); 2)管理員窗口 using System; using System.Collections.Generic; usingponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.F
10、orms; namespace prjTSGL.TSGL_UI publicpartialclassfrmAdmin : Form public frmAdmin() InitializeComponent(); privatevoid ShowForm(Form frmToShow) this.Cursor = Cursors.WaitCursor; foreach (Form frmChild inthis.MdiChildren) if (frmChild.GetType() = frmToShow.GetType() frmToShow.Dispose(); frmChild.Acti
11、vate(); this.Cursor = Cursors.Default; return; frmToShow.MdiParent = this; frmToShow.Show(); this.Cursor = Cursors.Default; privatevoid 讀者信息修改ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmUpdateReader(); privatevoid 新增圖書(shū)ToolStripMenuItem_Click(object sender, EventArgs e) ShowFor
12、m(newfrmAddNewBook(); privatevoid 圖書(shū)的查找和修改ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmUpdateBook(); privatevoid 流通管理ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmBorrow(); privatevoid 幫助ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmAbo
13、ut(); privatevoid 退出ToolStripMenuItem_Click(object sender, EventArgs e) Application.Exit(); 3)館長(zhǎng)窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace prjTSGL
14、.TSGL_UI publicpartialclassfrmManager : Form public frmManager() InitializeComponent(); privatevoid ShowForm(Form frmToShow) this.Cursor = Cursors.WaitCursor; foreach (Form frmChild inthis.MdiChildren) if (frmChild.GetType() = frmToShow.GetType() frmToShow.Dispose(); frmChild.Activate(); this.Cursor
15、 = Cursors.Default; return; frmToShow.MdiParent = this; frmToShow.Show(); this.Cursor = Cursors.Default; privatevoid frmManager_FormClosed(object sender, FormClosedEventArgs e) Application.Exit(); privatevoid 管理員信息管理ToolStripMenuItem_Click_1(object sender, EventArgs e) ShowForm(newfrmSelectAdmin();
16、privatevoid 系統(tǒng)設(shè)置ToolStripMenuItem_Click_1(object sender, EventArgs e) ShowForm(newfrmSys(); privatevoid 關(guān)于ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmAbout(); privatevoid 退出ToolStripMenuItem_Click_1(object sender, EventArgs e) Application.Exit(); 4)關(guān)于窗口 using System; using Sys
17、tem.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace prjTSGL.TSGL_UI publicpartialclassfrmAbout : Form public frmAbout() InitializeComponent(); privatevoid button1_Click(object sende
18、r, EventArgs e) this.Close(); 5)新增圖書(shū)窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using prjTSGL.ClassLib.DBAccess; namespace prjTSGL.TSGL_UI publicpartialclass
19、frmAddNewBook : Form public frmAddNewBook() InitializeComponent(); privatebool ValidatInput() if (textBox1.Text = ) MessageBox.Show(請(qǐng)輸入圖書(shū)編號(hào)!, 輸入提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Focus(); returnfalse; if (textBox2.Text = ) MessageBox.Show(請(qǐng)輸入圖書(shū)名稱!, 輸入提示, MessageBoxButton
20、s.OK, MessageBoxIcon.Information); textBox2.Focus(); returnfalse; if (textBox3.Text = ) MessageBox.Show(請(qǐng)輸入圖書(shū)數(shù)目!, 輸入提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox3.Focus(); returnfalse; if (comboBox1.Text = ) MessageBox.Show(請(qǐng)選擇圖書(shū)類別!, 輸入提示, MessageBoxButtons.OK, MessageBoxIcon.Inform
21、ation); textBox3.Focus(); returnfalse; returntrue; privatevoid btnOK_Click_1(object sender, EventArgs e) if (ValidatInput() /string id = textBox1.Text; /string name = textBox2.Text; /string Number = textBox3.Text; /string sore = comboBox1.Text; string sql = SELECT *FROM Bmanage WHERE bId= + textBox1
22、.Text.Trim() + ; DataTable dt = clsGlobalVar.GetDataTable(sql); if (dt.Rows.Count = 0) string SQL = insert into Bmanage(bId,bName,bNumber,bSore)values( + textBox1.Text.Trim() + ,() + , + textBox3.Text.Trim() + ,+ comboBox1.Text.Trim() + ); try bool result = clsGlobalVar.ExecSQL(SQL); if (result) Mes
23、sageBox.Show(添加成功!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Text = ; textBox2.Text = ; textBox3.Text = ; comboBox1.Text = ; textBox1.Focus(); else MessageBox.Show(添加失??!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Error); catch (Exception ex) MessageBox.Show(操作數(shù)據(jù)庫(kù)出錯(cuò)!, 操作演示,
24、MessageBoxButtons.OK, MessageBoxIcon.Error); Console.WriteLine(ex.Message); else MessageBox.Show(圖書(shū)編號(hào)已存在!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Focus(); privatevoid btnCancel_Click(object sender, EventArgs e) this.Close(); 6)新增管理員、查找及修改窗口 using System; using System.Colle
25、ctions.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using prjTSGL.ClassLib.DBAccess; namespace prjTSGL.TSGL_UI publicpartialclassfrmSelectAdmin : Form public frmSelectAdmin() InitializeComponent(); st
26、ring name = ; string SQL = ; string PWD = ; string Age = ; string Sex = ; string Tel = ; string Role = ; privatevoid SelectAdmin() string strfilter = ; string SQL = select mName AS 用戶名,mPwd AS 密碼,mAge AS 年齡 ,mSex AS 性別,mNumber AS ,mRole AS 角色 from Madmin ; if (txtName.Text = ) strfilter = ; else str
27、filter = where mName= + txtName.Text.Trim() + ; try DataTable dt = clsGlobalVar.GetDataTable(SQL + strfilter); int intIndex = 0; if (dt.Rows.Count = 0) MessageBox.Show(抱歉,沒(méi)有您要找的用戶!, 結(jié)果提示, MessageBoxButtons.OK, MessageBoxIcon.Information); txtName.Text = ; txtPWD.Text = ; txtAge.Text = ; cboSex.Text
28、= ; txtTel.Text = ; cboRole.Text = ; else LV.Columns.Clear(); LV.Items.Clear(); LV.Columns.Add(序號(hào), 100, HorizontalAlignment.Center); for (int intJ = 0; intJ dt.Columns.Count; intJ+) LV.Columns.Add(dt.ColumnsintJ.ColumnName, 200, HorizontalAlignment.Center); for (int intI = 0; intI dt.Rows.Count; int
29、I+) intIndex = intI + 1; LV.Items.Add(intIndex.ToString(); LV.ItemsintI.SubItems.Add(dt.RowsintI用戶名.ToString().Trim(); LV.ItemsintI.SubItems.Add(dt.RowsintI密碼.ToString().Trim(); LV.ItemsintI.SubItems.Add(dt.RowsintI年齡.ToString().Trim(); temsintI.SubItems.Add(dt.RowsintI性別.ToString().Trim(); LV.Items
30、intI.SubItems.Add(dt.RowsintI .ToString().Trim(); LV.ItemsintI.SubItems.Add(dt.RowsintI角色.ToString().Trim(); /連接數(shù)據(jù)庫(kù),將數(shù)據(jù)讀取出放入MadminData catch (Exception ex) MessageBox.Show(查詢數(shù)據(jù)庫(kù)出錯(cuò)!, 提示, MessageBoxButtons.OK, MessageBoxIcon.Error); Console.WriteLine(ex.Message); privatevoid btnSearch_Click(object sen
31、der, EventArgs e) SelectAdmin();/調(diào)用函數(shù) /實(shí)現(xiàn)修改功能 privatevoid btnUpdata_Click(object sender, EventArgs e) if (txtName.Text = | cboRole.Text=) MessageBox.Show(請(qǐng)選擇要修改的用戶!); else SQL = UPDATE Madmin SET mName= + txtName.Text.Trim() + ,mPwd= + txtPWD.Text.Trim() + ,mAge=ext.Trim() + ,mSex= + cboSex.Text.Tri
32、m() + ,mNumber= + txtTel.Text.Trim() + ,mRole= + cboRole.Text.Trim() + where mName= + name + AND mPwd= + PWD + AND mAge= + Age + AND mSex= + Sex + AND mNumber= + Tel + AND mRole= + Role + ; try bool result = clsGlobalVar.ExecSQL(SQL); if (result) /txtName.Text = ; txtPWD.Text = ; txtAge.Text = ; cbo
33、Sex.Text = ; txtTel.Text = ; cboRole.Text = ; MessageBox.Show(修改已成功); SelectAdmin(); else MessageBox.Show(更新失??!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Error); catch (Exception ex) MessageBox.Show(操作數(shù)據(jù)庫(kù)出錯(cuò)!, 操作演示, MessageBoxButtons.OK, MessageBoxIcon.Error); Console.WriteLine(ex.Message); private
34、void btnExit_Click(object sender, EventArgs e) this.Close(); privatevoid LV_SelectedIndexChanged_1(object sender, EventArgs e) txtName.Text = LV.FocusedItem.SubItems1.Text.Trim(); txtPWD.Text = LV.FocusedItem.SubItems2.Text.Trim(); txtAge.Text = LV.FocusedItem.SubItems3.Text.Trim(); cboSex.Text = LV
35、.FocusedItem.SubItems4.Text.Trim(); txtTel.Text = LV.FocusedItem.SubItems5.Text.Trim(); cboRole.Text = LV.FocusedItem.SubItems6.Text.Trim(); name = LV.FocusedItem.SubItems1.Text.Trim(); PWD = LV.FocusedItem.SubItems2.Text.Trim(); Age = LV.FocusedItem.SubItems3.Text.Trim(); Sex = LV.FocusedItem.SubIt
36、ems4.Text.Trim(); Tel = LV.FocusedItem.SubItems5.Text.Trim(); Role = LV.FocusedItem.SubItems6.Text.Trim(); privatevoid frmSelectAdmin_Load(object sender, EventArgs e) this.btnSearch_Click(sender, e); privatevoid btnAdd_Click(object sender, EventArgs e) if (txtName.Text = | txtPWD.Text = | txtAge.Tex
37、t = |cboSex.Text = | txtTel.Text= |cboRole.Text = ) MessageBox.Show(請(qǐng)至少輸入用戶名,密碼和角色!); else SQL = SELECT mName,mPwd,mAge ,mSex,mNumber,mRole from Madmin WHERE mName= + txtName.Text.Trim() + ; DataTable dt = clsGlobalVar.GetDataTable(SQL); if (dt.Rows.Count = 0) SQL = INSERT INTO Madmin VALUES ( + txt
38、Name.Text.Trim() + , + txtPWD.Text.Trim() + , + txtAge.Text.Trim() + , + cboSex.Text.Trim() + , + txtTel.Text.Trim() + , + cboRole.Text.Trim() + ); if (clsGlobalVar.ExecSQL(SQL) = true) /txtName.Text = ; txtPWD.Text = ; txtAge.Text = ; cboSex.Text = ; txtTel.Text = ; cboRole.Text = ; MessageBox.Show
39、(成功添加新管理員!); SelectAdmin(); else Exception ex = newException(); MessageBox.Show(ex.Message.ToString(); else MessageBox.Show(用戶名已存在,請(qǐng)選擇其他用戶名!, 結(jié)果提示, MessageBoxButtons.OK, MessageBoxIcon.Information); txtName.Text = ; privatevoid btnDelete_Click(object sender, EventArgs e) if (txtName.Text = | cboRole
40、.Text = ) MessageBox.Show(請(qǐng)選擇要?jiǎng)h除的管理員用戶!); else DialogResult dr = MessageBox.Show(此操作不可撤銷(xiāo),確定要?jiǎng)h除此用戶信息嗎?, 提示, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr = DialogResult.Yes) SQL = DELETE FROM Madmin WHERE mName= + name + AND mPwd= + PWD + AND mAge= + Age + AND mSex= + Sex + AND mNumber= +
41、 Tel + AND mRole= + Role + ; if (clsGlobalVar.ExecSQL(SQL) = true) MessageBox.Show(成功刪除此管理信息!); SelectAdmin(); else Exception ex = newException(); MessageBox.Show(ex.Message.ToString(); privatevoid btnReset_Click(object sender, EventArgs e) txtName.Text = ; txtPWD.Text = ; txtAge.Text = ; cboSex.Tex
42、t = ; txtTel.Text = ; cboRole.Text = ; 7)新增讀者、查找及修改窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using prjTSGL.ClassLib.DBAccess; namespace prjTSGL.TSGL_UI pub
43、licpartialclassfrmUpdateReader : Form public frmUpdateReader() InitializeComponent(); string Sno = ; string Pwd = ; string Age = ; string name = ; string Sex = ; string State = ; string Adress = ; string Number = ; string Email = ; string Grade = ; string Class = ; string Role = ; /查找學(xué)生讀者 privatevoi
44、d SelectStudent() string strfilter = ; string SQL = select rSno AS 讀者編號(hào),rName AS 讀者姓名,rPwd AS 密碼,rAge AS 年齡,rSex AS 性別,rState AS 借書(shū)狀態(tài),rAdress AS 地址,rNumber AS ,rEmail AS 郵箱,rGrade AS 年級(jí),rClass AS 班級(jí),rRole AS 角色 from Reader ; if (txtReaderName.Text = ) strfilter = ; else strfilter = where rName= + tx
45、tReaderName.Text.Trim() + ; try DataTable dt = clsGlobalVar.GetDataTable(SQL + strfilter); int intIndex = 0; if (dt.Rows.Count=0) MessageBox.Show(抱歉,沒(méi)有您要找的讀者信息!, 結(jié)果提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else LV.Columns.Clear(); LV.Items.Clear(); LV.Columns.Add(序號(hào), 100, HorizontalAlig
46、nment.Center); for (int intJ = 0; intJ dt.Columns.Count; intJ+) LV.Columns.Add(dt.ColumnsintJ.ColumnName, 200, HorizontalAlignment.Center); for (int intI = 0; intI dt.Rows.Count; intI+) intIndex = intI + 1; LV.Items.Add(intIndex.ToString(); for (int j=1; j 0 & state3 0) state3-; string a = state3.To
47、String().Trim(); string SQL = UPDATE Bmanage SET bNumber= + a + WHERE bId= + txtBookId.Text + ; clsGlobalVar.ExecSQL(SQL); / / MessageBox.Show(更新成功!); / state1+; string b = state1.ToString().Trim(); string sql = UPDATE Reader SET rState= + b + WHERE rSno= + txtReader.Text.Trim() + ; clsGlobalVar.Exe
48、cSQL(sql); / / MessageBox.Show(更新成功!); / /DateTime.Now.ToShortTimeString(); DateTime dt = DateTime.Now; string time = dt.ToShortDateString().ToString().Trim(); DateTime beBackTime = dt.AddDays(Day); string strsql = INSERT INTO Rrecord(rSno,rName,bId,bName,bTime,beBackTime)VALUES( + txtReader.Text.Tr
49、im() + , + txtReaderName.Text.Trim() + , + txtBookId.Text.Trim() + , + txtBookName.Text.Trim() + , + time + , + beBackTime.ToShortDateString().ToString().Trim() + ); if (clsGlobalVar.ExecSQL(strsql) MessageBox.Show(借書(shū)成功!); txtBorrowDate.Text = time; this.btnSearch_Click(sender, e); this.btnBookSelec
50、t_Click(sender, e); else MessageBox.Show(借書(shū)失敗!); privatevoid btnBackBook_Click(object sender, EventArgs e) if (txtBookId.Text = ) MessageBox.Show(讀者編號(hào)和圖書(shū)編號(hào)不能為空!); else this.btnSearch_Click(sender, e); this.btnBookSelect_Click(sender, e); state3+; string a = state3.ToString().Trim(); string SQL = UPD
51、ATE Bmanage SET bNumber= + a + WHERE bId= + txtBookId.Text + ; clsGlobalVar.ExecSQL(SQL); / / MessageBox.Show(更新成功!); / state1-; string b = state1.ToString().Trim(); string sql = UPDATE Reader SET rState= + b + WHERE rSno= + txtReader.Text.Trim() + ; clsGlobalVar.ExecSQL(sql); / / MessageBox.Show(更新
52、成功!); / string strsql1 = SELECT S.Fine AS Fine,S.rDay AS rDay ,Rr.bTime AS bTime FROM SysSet S INNER JOIN (Reader R INNER JOIN Rrecord Rr ON R.rSno=Rr.rSno) ON S.rRole=R.rRole WHERE R.rSno= + txtReader.Text.Trim() + AND Rr.bId= + txtBookId.Text.Trim() + ; DataTable ds = clsGlobalVar.GetDataTable(str
53、sql1); if (ds.Rows.Count = 0) MessageBox.Show(查詢錯(cuò)誤!); else x = float.Parse(ds.Rows0Fine.ToString().Trim(); y = Int32.Parse(ds.Rows0rDay.ToString().Trim(); txtBorrowDate.Text = ds.Rows0bTime.ToString().Trim(); DateTime time = DateTime.Now; string T = time.ToShortDateString().ToString().Trim(); txtBac
54、kDate.Text = T; TimeSpan span = time.Subtract(DateTime.Parse(txtBorrowDate.Text); int i = span.Days; string strsql = DELETE FROM Rrecord WHERE rSno= + txtReader.Text.Trim() + AND bId= + txtBookId.Text.Trim() + ; if (clsGlobalVar.ExecSQL(strsql) if (i y) z = x * (i - y); txtFine.Text = z.ToString().T
55、rim(); MessageBox.Show(還書(shū)成功,請(qǐng)交罰款 + txtFine.Text.Trim() + 元!); /MessageBox.Show(還書(shū)成功!); this.btnSearch_Click(sender, e); this.btnBookSelect_Click(sender, e); /txtBorrowDate.Text = ; /txtBackDate.Text = ; else MessageBox.Show(還書(shū)成功!); this.btnSearch_Click(sender, e); this.btnBookSelect_Click(sender, e)
56、; /txtBorrowDate.Text = ; /txtBackDate.Text = ; else MessageBox.Show(還書(shū)失敗!); privatevoid button4_Click(object sender, EventArgs e) this.Close(); privatevoid btnReset_Click(object sender, EventArgs e) txtReader.Text = ; txtReaderName.Text = ; txtBookId.Text = ; txtBookName.Text = ; txtBorrowDate.Text
57、 = ; txtBackDate.Text = ; txtFine.Text = ; txtState.Text = ; txtBooksState.Text = ; privatevoid btnQuery_Click(object sender, EventArgs e) if (txtReader.Text = ) MessageBox.Show(讀者編號(hào)不能為空,請(qǐng)重新輸入); else string SQL = SELECT rSno AS 讀者編號(hào),rName AS 讀者姓名,bId AS 圖書(shū)編號(hào),bName AS 圖書(shū)名稱,bTime AS 借書(shū)日期,beBackTime AS
58、 到期日期 FROM Rrecord WHERE rSno= + txtReader.Text.Trim() + ; try DataTable dt = clsGlobalVar.GetDataTable(SQL); if (dt.Rows.Count = 0) MessageBox.Show(無(wú)借閱信息!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Error); else DG.DataSource = dt; catch (Exception ex) MessageBox.Show(操作數(shù)據(jù)庫(kù)出錯(cuò)!, 操作演示, MessageBoxButt
59、ons.OK, MessageBoxIcon.Error); Console.WriteLine(ex.Message); 10)系統(tǒng)設(shè)置窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using prjTSGL.ClassLib.DBAccess; namespace p
60、rjTSGL.TSGL_UI publicpartialclassfrmSys : Form public frmSys() InitializeComponent(); privatevoid btnCancel_Click(object sender, EventArgs e) this.Close(); privatevoid btnOK_Click(object sender, EventArgs e) if (txtMoney.Text.Trim() = & txtNumber.Text.Trim() = & txtDay.Text.Trim() = | cboRole.Text.T
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 樂(lè)山師范學(xué)院《人類與醫(yī)學(xué)遺傳學(xué)實(shí)驗(yàn)》2023-2024學(xué)年第一學(xué)期期末試卷
- 江漢大學(xué)《工程經(jīng)濟(jì)與管理》2023-2024學(xué)年第一學(xué)期期末試卷
- 華北電力大學(xué)《航空材料雙語(yǔ)》2023-2024學(xué)年第一學(xué)期期末試卷
- 湖南環(huán)境生物職業(yè)技術(shù)學(xué)院《碳纖維材料》2023-2024學(xué)年第一學(xué)期期末試卷
- 湖北財(cái)稅職業(yè)學(xué)院《應(yīng)用隨機(jī)過(guò)程》2023-2024學(xué)年第一學(xué)期期末試卷
- 自貢職業(yè)技術(shù)學(xué)院《化工原理(2)》2023-2024學(xué)年第一學(xué)期期末試卷
- 周口師范學(xué)院《行政倫理學(xué)》2023-2024學(xué)年第一學(xué)期期末試卷
- 浙江師范大學(xué)行知學(xué)院《口譯實(shí)訓(xùn)》2023-2024學(xué)年第一學(xué)期期末試卷
- 鄭州衛(wèi)生健康職業(yè)學(xué)院《數(shù)控車(chē)床實(shí)訓(xùn)》2023-2024學(xué)年第一學(xué)期期末試卷
- 玉溪職業(yè)技術(shù)學(xué)院《云南少數(shù)民族題材電影賞析》2023-2024學(xué)年第一學(xué)期期末試卷
- 2023年小學(xué)科學(xué)教研組教研工作總結(jié)(5篇)
- 三年級(jí)上冊(cè)遞等式計(jì)算練習(xí)300題及答案
- 政治畫(huà)像品德操守自我評(píng)價(jià)3篇
- 奶茶督導(dǎo)述職報(bào)告
- 山東萊陽(yáng)核電項(xiàng)目一期工程水土保持方案
- 白熊效應(yīng)(修訂版)
- 視頻監(jiān)控維保項(xiàng)目投標(biāo)方案(技術(shù)標(biāo))
- 社會(huì)組織能力建設(shè)培訓(xùn)
- 立項(xiàng)報(bào)告蓋章要求
- 2022年睪丸腫瘤診斷治療指南
- 被執(zhí)行人給法院執(zhí)行局寫(xiě)申請(qǐng)范本
評(píng)論
0/150
提交評(píng)論