![圖書館管理系統(tǒng)設(shè)計(jì)附帶源代碼_第1頁(yè)](http://file4.renrendoc.com/view/0b91cda9a2c3bef06cdaa6a081d35fa1/0b91cda9a2c3bef06cdaa6a081d35fa11.gif)
![圖書館管理系統(tǒng)設(shè)計(jì)附帶源代碼_第2頁(yè)](http://file4.renrendoc.com/view/0b91cda9a2c3bef06cdaa6a081d35fa1/0b91cda9a2c3bef06cdaa6a081d35fa12.gif)
![圖書館管理系統(tǒng)設(shè)計(jì)附帶源代碼_第3頁(yè)](http://file4.renrendoc.com/view/0b91cda9a2c3bef06cdaa6a081d35fa1/0b91cda9a2c3bef06cdaa6a081d35fa13.gif)
![圖書館管理系統(tǒng)設(shè)計(jì)附帶源代碼_第4頁(yè)](http://file4.renrendoc.com/view/0b91cda9a2c3bef06cdaa6a081d35fa1/0b91cda9a2c3bef06cdaa6a081d35fa14.gif)
![圖書館管理系統(tǒng)設(shè)計(jì)附帶源代碼_第5頁(yè)](http://file4.renrendoc.com/view/0b91cda9a2c3bef06cdaa6a081d35fa1/0b91cda9a2c3bef06cdaa6a081d35fa15.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
畢業(yè)設(shè)計(jì)_圖書管理系統(tǒng)一、數(shù)據(jù)庫(kù)設(shè)計(jì)數(shù)據(jù)庫(kù)設(shè)CREATE DATABASE TSGLGOUSE TSGLGOCREATE TABLE Bmanage(bIdvarchar(10) PRIMARY KEY,bName varchar(50),
--添加圖書--圖書編號(hào)--書名bNumber
varchar(10),
--書數(shù)目)GO
bSore varchar(50)
--分類CREATE TABLE Madmin(mName varchar(10)PRIMARY KEY,mPwd varchar(25),mAge varchar(8),mSex varchar(4),mNumber varchar(15),mrole varchar(8))GO
--圖書員管理--圖書管理員姓名--圖書管理員密碼--圖書管理員年齡--圖書管理員性別--圖書管理員--圖書管理員角色CREATE TABLE Reader(rSno varchar(10) PRIMARY KEY,rName varchar(10),rPwd varchar(25),rAge varchar(8),rSex varchar(4),rState varchar(8),rNumber varchar(15),rEmail varchar(25),
--讀者信息表reader--讀者號(hào)--姓名--密碼--年齡--性別--狀態(tài)--號(hào)碼--電子郵件rAdress
varChar(50),
--地址)GO
rGrade varChar(15),rClass varchar(15),rRole varchar(8)
--年級(jí)--班級(jí)--角色CREATE TABLE Rrecord(rSno varchar(10) PRIMARY KEY,rName varChar(10),bIdvarchar(10),bName varChar(50),bTime varchar(10),bBackTime varchar(10))GOCREATE TABLE SysSet(rRole varchar(8)PRIMARY KEY,rState varchar(8),Fine float(25),rDay varchar(8)
--讀者編號(hào)學(xué)號(hào)--讀者姓名--圖書編號(hào)--圖書名稱--借書時(shí)間--還書時(shí)間--讀者角色--讀者可借書數(shù)--過期罰款設(shè)置--可借書天數(shù))二、界面截圖及闡明1) 登錄窗口(實(shí)現(xiàn)管理員和館長(zhǎng)旳登陸)2) 管理員窗口3) 館長(zhǎng)窗口4) 有關(guān)窗口5) 新增圖書窗口6) 新增管理員、查找及修改窗口7) 新增讀者、查找及修改窗口8) 圖書旳查找及修改窗口9) 借閱窗口10)系統(tǒng)設(shè)置窗口三、重要代碼重要代1) 登錄窗口(實(shí)現(xiàn)管理員和館長(zhǎng)旳登陸)登陸檢查:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Data;usingprjTSGL.ClassLib.DBAccess;namespaceprjTSGL.ClassLib.Logic{class clsLoginCheck{public static DataTableCheckLogin(stringUserId,stringPWD){{stringSQLstmt="selectmName,mPwd,mRolefromMadminwheremName='"+UserId+"'andmPwd='"+PWD+"'";DataTabledt=clsGlobalVar.GetDataTable(SQLstmt);returndt;}}}}登陸:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingprjTSGL.ClassLib.Logic;namespaceprjTSGL.TSGL_UI{public partial class frmLogin:Form{publicfrmLogin(){InitializeComponent();}private voidbtnLogin_Click(objectsender,EventArgse){stringstrUserID=loginid.Text.Trim();stringstrPWD=loginpwd.Text.Trim();stringtype="";try{DataTabledt=clsLoginCheck.CheckLogin(strUserID,strPWD);if(dt.Rows.Count==0){MessageBox.Show("登陸失敗,請(qǐng)重新輸入!");loginpwd.Focus();return;}else{type=dt.Rows[0]["mRole"].ToString().Trim();if(cboLT.Text.Trim()=="館長(zhǎng)"){if(type=="館長(zhǎng)"){this.Hide();frmManagerobjManager=new frmManager();objManager.Show();}else{MessageBox.Show("您沒有權(quán)限!");loginpwd.Focus();return;}}else{if(type=="管理員"){this.Hide();frmAdminobjAdmin=new frmAdmin();objAdmin.Show();}else{MessageBox.Show("您沒有權(quán)限!");loginpwd.Focus();return;}}}}catch(Exceptionex){throwex;}}private voidbtnExit_Click(objectsender,EventArgse){this.Close();}}}2) 管理員窗口usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceprjTSGL.TSGL_UI{public partial class frmAdmin:Form{publicfrmAdmin(){InitializeComponent();}private voidShowForm(FormfrmToShow){this.Cursor=Cursors.WaitCursor;foreach(FormfrmChildin this.MdiChildren){if(frmChild.GetType()==frmToShow.GetType()){frmToShow.Dispose();frmChild.Activate();this.Cursor=Cursors.Default;return;}}frmToShow.MdiParent=this;frmToShow.Show();this.Cursor=Cursors.Default;}private void讀者信息修改ToolStripMenuItem_Click(objectsender,EventArgse){ShowForm(new frmUpdateReader());}private void新增圖書ToolStripMenuItem_Click(objectsender,EventArgse){ShowForm(new frmAddNewBook());}private void圖書旳查找和修改ToolStripMenuItem_Click(objectsender,EventArgse){ShowForm(new frmUpdateBook());}private void流通管理ToolStripMenuItem_Click(objectsender,EventArgse){ShowForm(new frmBorrow());}private void協(xié)助ToolStripMenuItem_Click(objectsender,EventArgse){ShowForm(new frmAbout());}private void退出ToolStripMenuItem_Click(objectsender,EventArgse){Application.Exit();}}}3) 館長(zhǎng)窗口usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceprjTSGL.TSGL_UI{public partial class frmManager:Form{publicfrmManager(){InitializeComponent();}private voidShowForm(FormfrmToShow){this.Cursor=Cursors.WaitCursor;foreach(FormfrmChildin this.MdiChildren){if(frmChild.GetType()==frmToShow.GetType()){frmToShow.Dispose();frmChild.Activate();this.Cursor=Cursors.Default;return;}}frmToShow.MdiParent=this;frmToShow.Show();this.Cursor=Cursors.Default;}private voidfrmManager_FormClosed(objectsender,FormClosedEventArgse){Application.Exit();}private void管理員信息管理ToolStripMenuItem_Click_1(objectsender,EventArgse){ShowForm(new frmSelectAdmin());}private void系統(tǒng)設(shè)置ToolStripMenuItem_Click_1(objectsender,EventArgse){ShowForm(new frmSys());}private void有關(guān)ToolStripMenuItem_Click(objectsender,EventArgse){ShowForm(new frmAbout());}private void退出ToolStripMenuItem_Click_1(objectsender,EventArgse){Application.Exit();}}}4) 有關(guān)窗口usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceprjTSGL.TSGL_UI{public partial class frmAbout:Form{publicfrmAbout(){InitializeComponent();}private voidbutton1_Click(objectsender,EventArgse){this.Close();}}}5) 新增圖書窗口usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingprjTSGL.ClassLib.DBAccess;namespaceprjTSGL.TSGL_UI{public partial class frmAddNewBook:Form{publicfrmAddNewBook(){InitializeComponent();}private boolValidatInput(){if(textBox1.Text==""){MessageBox.Show("請(qǐng)輸入圖書編號(hào)!","輸入提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);textBox1.Focus();return false;}if(textBox2.Text==""){MessageBox.Show("請(qǐng)輸入圖書名稱!","輸入提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);textBox2.Focus();return false;}if(textBox3.Text==""){MessageBox.Show("請(qǐng)輸入圖書數(shù)目!","輸入提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);textBox3.Focus();return false;}if(comboBox1.Text==""){MessageBox.Show("請(qǐng)選擇圖書類別!","輸入提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);textBox3.Focus();return false;}return true;}private voidbtnOK_Click_1(objectsender,EventArgse){if(ValidatInput()){//stringid=textBox1.Text;//stringname=textBox2.Text;//stringNumber=textBox3.Text;//stringsore=comboBox1.Text;stringsql="SELECT*FROMBmanageWHEREbId='"+textBox1.Text.Trim()+"'";DataTabledt=clsGlobalVar.GetDataTable(sql);if(dt.Rows.Count==0){stringSQL="insertintoBmanage(bId,bName,bNumber,bSore)values('"+textBox1.Text.Trim()+"','"+textBox2.Text.Trim()+"','"+textBox3.Text.Trim()+"','"+comboBox1.Text.Trim()+"')";try{boolresult=clsGlobalVar.ExecSQL(SQL);if(result){MessageBox.Show("添加成功!","操作提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);textBox1.Text="";textBox2.Text="";textBox3.Text="";comboBox1.Text="";textBox1.Focus();}else{MessageBox.Show("添加失敗!","操作提醒",MessageBoxButtons.OK,MessageBoxIcon.Error);}}catch(Exceptionex){MessageBox.Show("操作數(shù)據(jù)庫(kù)出錯(cuò)!","操作演示",MessageBoxButtons.OK,MessageBoxIcon.Error);Console.WriteLine(ex.Message);}}else{MessageBox.Show("圖書編號(hào)已存在!","操作提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);textBox1.Focus();}}}private voidbtnCancel_Click(objectsender,EventArgse){this.Close();}}}6) 新增管理員、查找及修改窗口usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingprjTSGL.ClassLib.DBAccess;namespaceprjTSGL.TSGL_UI{public partial class frmSelectAdmin:Form{publicfrmSelectAdmin(){InitializeComponent();}stringname="";stringSQL="";stringPWD="";stringAge="";stringSex="";stringTel="";stringRole="";private voidSelectAdmin(){stringstrfilter="";stringSQL="selectmNameAS顧客名,mPwdAS密碼,mAgeAS年齡,mSexAS性別,mNumberAS,mRoleAS角色fromMadmin";if(txtName.Text=="")strfilter="";elsestrfilter="wheremName='"+txtName.Text.Trim()+"'";try{DataTabledt=clsGlobalVar.GetDataTable(SQL+strfilter);intintIndex=0;if(dt.Rows.Count==0){MessageBox.Show("抱歉,沒有您要找旳顧客!","成果提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);txtName.Text="";txtPWD.Text="";txtAge.Text="";cboSex.Text="";txtTel.Text="";cboRole.Text="";}else{{LV.Columns.Clear();LV.Items.Clear();LV.Columns.Add("序號(hào)",100,HorizontalAlignment.Center);for(intintJ=0;intJ<dt.Columns.Count;intJ++){LV.Columns.Add(dt.Columns[intJ].ColumnName,200,HorizontalAlignment.Center);}for(intintI=0;intI<dt.Rows.Count;intI++){intIndex=intI+1;LV.Items.Add(intIndex.ToString());LV.Items[intI].SubItems.Add(dt.Rows[intI]["顧客名"].ToString().Trim());LV.Items[intI].SubItems.Add(dt.Rows[intI]["密碼"].ToString().Trim());LV.Items[intI].SubItems.Add(dt.Rows[intI]["年齡"].ToString().Trim());LV.Items[intI].SubItems.Add(dt.Rows[intI]["性別"].ToString().Trim());LV.Items[intI].SubItems.Add(dt.Rows[intI][""].ToString().Trim());LV.Items[intI].SubItems.Add(dt.Rows[intI]["角色"].ToString().Trim());}}}}//連接數(shù)據(jù)庫(kù),將數(shù)據(jù)讀取出放入MadminDatacatch(Exceptionex){MessageBox.Show("查詢數(shù)據(jù)庫(kù)出錯(cuò)!","提醒",MessageBoxButtons.OK,MessageBoxIcon.Error);Console.WriteLine(ex.Message);}}private voidbtnSearch_Click(objectsender,EventArgse){SelectAdmin();//調(diào)用函數(shù)}//實(shí)現(xiàn)修改功能private voidbtnUpdata_Click(objectsender,EventArgse){if(txtName.Text==""||cboRole.Text==""){MessageBox.Show("請(qǐng)選擇要修改旳顧客!");}else{SQL="UPDATEMadminSETmName='"+txtName.Text.Trim()+"',mPwd='"+txtPWD.Text.Trim()+"',mAge='"+txtAge.Text.Trim()+"',mSex='"+cboSex.Text.Trim()+"',mNumber='"+txtTel.Text.Trim()+"',mRole='"+cboRole.Text.Trim()+"'wheremName='"+name+"'ANDmPwd='"+PWD+"'ANDmAge='"+Age+"'ANDmSex='"+Sex+"'ANDmNumber='"+Tel+"'ANDmRole='"+Role+"'";try{boolresult=clsGlobalVar.ExecSQL(SQL);if(result){//txtName.Text="";txtPWD.Text="";txtAge.Text="";cboSex.Text="";txtTel.Text="";cboRole.Text="";MessageBox.Show("修改已成功");SelectAdmin();}else{MessageBox.Show("更新失??!","操作提醒",MessageBoxButtons.OK,MessageBoxIcon.Error);}}catch(Exceptionex){MessageBox.Show("操作數(shù)據(jù)庫(kù)出錯(cuò)!","操作演示",MessageBoxButtons.OK,MessageBoxIcon.Error);Console.WriteLine(ex.Message);}}}private voidbtnExit_Click(objectsender,EventArgse){this.Close();}private voidLV_SelectedIndexChanged_1(objectsender,EventArgse){txtName.Text=LV.FocusedItem.SubItems[1].Text.Trim();txtPWD.Text=LV.FocusedItem.SubItems[2].Text.Trim();txtAge.Text=LV.FocusedItem.SubItems[3].Text.Trim();cboSex.Text=LV.FocusedItem.SubItems[4].Text.Trim();txtTel.Text=LV.FocusedItem.SubItems[5].Text.Trim();cboRole.Text=LV.FocusedItem.SubItems[6].Text.Trim();name=LV.FocusedItem.SubItems[1].Text.Trim();PWD=LV.FocusedItem.SubItems[2].Text.Trim();Age=LV.FocusedItem.SubItems[3].Text.Trim();Sex=LV.FocusedItem.SubItems[4].Text.Trim();Tel=LV.FocusedItem.SubItems[5].Text.Trim();Role=LV.FocusedItem.SubItems[6].Text.Trim();}private voidfrmSelectAdmin_Load(objectsender,EventArgse){this.btnSearch_Click(sender,e);}private voidbtnAdd_Click(objectsender,EventArgse){if(txtName.Text==""||txtPWD.Text==""||txtAge.Text==""||cboSex.Text==""||txtTel.Text==""||cboRole.Text==""){}
MessageBox.Show("請(qǐng)至少輸入顧客名,密碼和角色!");else{SQL="SELECTmName,mPwd,mAge,mSex,mNumber,mRolefromMadminWHEREmName='"+txtName.Text.Trim()+"'";DataTabledt=clsGlobalVar.GetDataTable(SQL);if(dt.Rows.Count==0){SQL="INSERTINTOMadminVALUES('"+txtName.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("成功添加新管理員!");SelectAdmin();}else{Exceptionex=new Exception();MessageBox.Show(ex.Message.ToString());}}else{MessageBox.Show("顧客名已存在,請(qǐng)選擇其他顧客名!","成果提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);txtName.Text="";}}}private voidbtnDelete_Click(objectsender,EventArgse){if(txtName.Text==""||cboRole.Text==""){MessageBox.Show("請(qǐng)選擇要?jiǎng)h除旳管理員顧客!");}else{DialogResultdr=MessageBox.Show("此操作不可撤銷,確定要?jiǎng)h除此顧客信息嗎?","提醒",MessageBoxButtons.YesNo,MessageBoxIcon.Question);if(dr==DialogResult.Yes){SQL="DELETEFROMMadminWHEREmName='"+name+"'ANDmPwd='"+PWD+"'ANDmAge='"+Age+"'ANDmSex='"+Sex+"'ANDmNumber='"+Tel+"'ANDmRole='"+Role+"'";if(clsGlobalVar.ExecSQL(SQL)==true){MessageBox.Show("成功刪除此管理信息!");SelectAdmin();}else{Exceptionex=new Exception();MessageBox.Show(ex.Message.ToString());}}}}private voidbtnReset_Click(objectsender,EventArgse){txtName.Text="";txtPWD.Text="";txtAge.Text="";cboSex.Text="";txtTel.Text="";cboRole.Text="";}}}7) 新增讀者、查找及修改窗口usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingprjTSGL.ClassLib.DBAccess;namespaceprjTSGL.TSGL_UI{public partial class frmUpdateReader:Form{publicfrmUpdateReader(){InitializeComponent();}stringSno="";stringPwd="";stringAge="";stringname="";stringSex="";stringState="";stringAdress="";stringNumber="";stringEmail="";stringGrade="";stringClass="";stringRole="";//查找學(xué)生讀者private voidSelectStudent(){stringstrfilter="";stringSQL="selectrSnoAS讀者編號(hào),rNameAS讀者姓名,rPwdAS密碼,rAgeAS年齡,rSexAS性別,rStateAS借書狀態(tài),rAdressAS地址,rNumberAS,rEmailAS郵箱,rGradeAS年級(jí),rClassAS班級(jí),rRoleAS角色fromReader";if(txtReaderName.Text=="")strfilter="";elsestrfilter="whererName='"+txtReaderName.Text.Trim()+"'";try{DataTabledt=clsGlobalVar.GetDataTable(SQL+strfilter);intintIndex=0;if(dt.Rows.Count==0){MessageBox.Show("抱歉,沒有您要找旳讀者信息!","成果提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);}else{LV.Columns.Clear();LV.Items.Clear();LV.Columns.Add("序號(hào)",100,HorizontalAlignment.Center);for(intintJ=0;intJ<dt.Columns.Count;intJ++){LV.Columns.Add(dt.Columns[intJ].ColumnName,200,HorizontalAlignment.Center);}for(intintI=0;intI<dt.Rows.Count;intI++){intIndex=intI+1;LV.Items.Add(intIndex.ToString());for(intj=1;j<dt.Columns.Count;j++){LV.Items[intI].SubItems.Add(dt.Rows[intI][j].ToString());}//LV.Items[intI].SubItems.Add(dt.Rows[intI]["讀者編號(hào)"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["讀者姓名"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["密碼"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["年齡"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["性別"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["借書狀態(tài)"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["地址"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI][""].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["郵箱"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["年級(jí)"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["班級(jí)"].ToString());//LV.Items[intI].SubItems.Add(dt.Rows[intI]["角色"].ToString());}}}catch(Exceptionex){MessageBox.Show("查詢數(shù)據(jù)庫(kù)出錯(cuò)!","提醒",MessageBoxButtons.OK,MessageBoxIcon.Error);Console.WriteLine(ex.Message);}}//實(shí)現(xiàn)查找功能private voidbtnSearch_Click(objectsender,EventArgse){SelectStudent();}//實(shí)現(xiàn)修改功能private voidbtnUpdata_Click(objectsender,EventArgse){if(textBox2.Text==""){MessageBox.Show("請(qǐng)選擇要修改旳顧客!");}else//stringsql="SELECT*fromReaderWHERErSno='"+textBox2.Text.Trim()+"'";//DataTabledt=clsGlobalVar.GetDataTable(sql);//if(dt.Rows.Count==0)//{{stringSQL="UPDATEReaderSETrSno='"+textBox2.Text.Trim()+"',rPwd='"+textBox3.Text.Trim()+"',rAge='"+textBox1.Text.Trim()+"',rName='"+txtReaderName.Text.Trim()+"',rSex='"+cboSex.Text.Trim()+"',rState='"+textBox4.Text.Trim()+"',rAdress='"+textBox5.Text.Trim()+"',rNumber='"+textBox6.Text.Trim()+"',rEmail='"+textBox7.Text.Trim()+"',rGrade='"+textBox8.Text.Trim()+"',rClass='"+textBox9.Text.Trim()+"',rRole='"+cboRole.Text.Trim()+"'";stringstrfilter="whererSno='"+Sno+"'";try{boolresult=clsGlobalVar.ExecSQL(SQL+strfilter);if(result){textBox2.Text="";textBox3.Text="";textBox1.Text="";cboSex.Text="";textBox4.Text="";textBox5.Text="";textBox6.Text="";textBox7.Text="";textBox8.Text="";textBox9.Text="";cboRole.Text="";MessageBox.Show("修改已成功");SelectStudent();}else{MessageBox.Show("讀者信息不存在!","操作提醒",MessageBoxButtons.OK,MessageBoxIcon.Error);}}catch(Exceptionex){MessageBox.Show("操作數(shù)據(jù)庫(kù)出錯(cuò)!","操作演示",MessageBoxButtons.OK,MessageBoxIcon.Error);Console.WriteLine(ex.Message);}}//}//else//{//MessageBox.Show("顧客名已存在,請(qǐng)選擇其他顧客名!","成果提醒",MessageBoxButtons.OK,MessageBoxIcon.Information);//textBox2.Text="";//}}private voidbtnExit_Click(objectsender,EventArgse){}
this.Close();private voidLV_SelectedIndexChanged(objectsender,EventArgse){textBox2.Text=LV.FocusedItem.SubItems[1].Text.Trim();txtReaderName.Text=LV.FocusedItem.SubItems[2].Text.Trim();textBox3.Text=LV.FocusedItem.SubItems[3].Text.Trim();textBox1.Text=LV.FocusedItem.SubItems[4].Text.Trim();cboSex.Text=LV.FocusedItem.SubItems[5].Text.Trim();textBox4.Text=LV.FocusedItem.SubItems[6].Text.Trim();textBox5.Text=LV.FocusedItem.SubItems[7].Text.Trim();textBox6.Text=LV.FocusedItem.SubItems[8].Text.Trim();textBox7.Text=LV.FocusedItem.SubItems[9].Text.Trim();textBox8.Text=LV.FocusedItem.SubItems[10].Text.Trim();textBox9.Text=LV.FocusedItem.SubItems[11].Text.Trim();cboRole.Text=LV.FocusedItem.SubItems[12].Text.Trim();Sno=LV.FocusedItem.SubItems[1].Text.Trim();name=LV.FocusedItem.SubItems[2].Text.Trim();Pwd=LV.FocusedItem.SubItems[3].Text.Trim();Age=LV.FocusedItem.SubItems[4].Text.Trim();Sex=LV.FocusedItem.SubItems[5].Text.Trim();State=LV.FocusedItem.SubItems[6].Text.Trim();Adress=LV.FocusedItem.SubItems[7].Text.Trim();Number=LV.FocusedItem.SubItems[8].Text.Trim();Email=LV.FocusedItem.SubItems[9].Text.Trim();Grade=LV.FocusedItem.SubItems[10].Text.Trim();Class=LV.FocusedItem.SubItems[11].Text.Trim();Role=LV.FocusedItem.SubItems[12].Text.Trim();}private voidbtnReset_Click(objectsender,EventArgse){textBox2.Text="";textBox3.Text="";txtReaderName.Text="";textBox1.Text="";cboSex.Text="";textBox4.Text="";textBox5.Text="";textBox6.Text="";textBox7.Text="";textBox8.Text="";textBox9.Text="";cboRole.Text="";}private voidbtnAdd_Click(objectsender,EventArgse){stringSQL="";if(textBox2.Text==""||textBox3.Text==""||txtReaderName.Text==""||textBox4.Text==""||textBox5.Text==""){MessageBox.Show("請(qǐng)至少輸入讀者姓名,顧客名,密碼,借書狀態(tài)和角色!");}else{stringsql="SELECT*fromReaderWHERErSno='"+textBox2.Text.Trim()+"'";DataTabledt=clsGlobalVar.GetDataTable(sql);if(dt.Rows.Count==0){if(cboRole.Text.Trim()=="教師")SQL="INSERTINTOReader(rSno,rPwd,rName,rAge,rSex,rState,rAdress,rNumber,rEmail,rGrade,rClass,rRole)VALUES('"+textBox2.Text.Trim()+"','"+textBox3.Text.Trim()+"','"+txtReaderName.Text.Trim()+"','"+textBox1.Text.Trim()+"','"+cboSex.Text.Trim()+"','"+textBox4.Text.Trim()+"','"+textBox5.Text.Trim()+"','"+textBox6.Text.Trim()+"','"+textBox7.Text.Trim()+"','"+"NULL"+"','"+"NULL"+"','"+cboRole.Text.Trim()+"')";elseSQL="INSERTINTOReader(rSno,rPwd,rName,rAge,rSex,rState,rAdress,rNumber,rEmail,rGrade,rClass,rRole)VALUES('"+textBox2.Text.Trim()+"','"+textBox3.Text.Trim()+"','"+txtReaderName.Text.Trim()+"','"+textBox1.Text.Trim()+"','"+cboSex.Text.Trim()+"','"+textBox4.Text.Trim()+"','"+textBox5.Text.Trim()+"','"+textBox6.Text.Trim()+"','"+textBox7.Text.Trim()+"','"+textBox8.Text.Trim()+"','"+textBox9.Text.Trim()+"','"+cboRole.Text.Trim()+"')";if(clsGlobalVar.ExecSQL(SQL)==true){textBox2.Text="";textBox3.Text="";textBox1.Text="";cboSex.Text="";textBox4.Text="";textBox5.Text="";textBox6.Text="";textBox7.Text="";textBox8.Text="";textBox9.Text="";cboRole.Text="";MessageBox.Show("成功添加此顧客!");SelectStu
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝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ù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 科技發(fā)展與學(xué)科教育的互促關(guān)系研究
- 科技教育編程教育的普及與推廣
- DB4453T 30-2025廣藿香組培苗生產(chǎn)技術(shù)規(guī)程
- DB35T 2232-2024海峽兩岸共通 火龍果生產(chǎn)技術(shù)規(guī)程
- 東莞企業(yè)勞動(dòng)合同范本
- 個(gè)人貸款房屋抵押合同模板大全
- 業(yè)務(wù)經(jīng)營(yíng)權(quán)轉(zhuǎn)讓合同
- 個(gè)人車位共有權(quán)買賣合同
- 臨時(shí)倉(cāng)儲(chǔ)合同范本
- 兩人股權(quán)轉(zhuǎn)讓合同范本
- 義務(wù)教育數(shù)學(xué)課程標(biāo)準(zhǔn)(2022年版)重點(diǎn)
- 2021上海春考作文題解析及范文(怎樣做與成為什么樣人)
- 2024-2030年全球及中國(guó)水楊酸行業(yè)市場(chǎng)現(xiàn)狀供需分析及市場(chǎng)深度研究發(fā)展前景及規(guī)劃可行性分析研究報(bào)告
- 體育館改造裝修工程施工組織設(shè)計(jì)
- 137案例黑色三分鐘生死一瞬間事故案例文字版
- 【魔鏡洞察】2024藥食同源保健品滋補(bǔ)品行業(yè)分析報(bào)告
- 2024-2030年中國(guó)潤(rùn)滑油行業(yè)發(fā)展趨勢(shì)與投資戰(zhàn)略研究報(bào)告
- 鋼結(jié)構(gòu)工程施工(第五版) 課件 2項(xiàng)目四 高強(qiáng)度螺栓
- 機(jī)票預(yù)訂行業(yè)營(yíng)銷策略方案
- 大學(xué)生就業(yè)指導(dǎo)(高等院校學(xué)生學(xué)習(xí)就業(yè)指導(dǎo)課程)全套教學(xué)課件
- 《實(shí)驗(yàn)診斷學(xué)》課件
評(píng)論
0/150
提交評(píng)論