黄淮学院计算机科学系课程设计说明书
this.label1.TabIndex = 0;
this.label1.Text = \图书管理系统\; // // label2 //
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font(\宋体\, 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(34, 78); this.label2.Name = \;
this.label2.Size = new System.Drawing.Size(368, 32); this.label2.TabIndex = 1;
this.label2.Text = \打开SQL Server企业管理器,启动SQL相关服务,\\r\\n连接数据库。\\r\\n\; // // label3 //
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font(\宋体\, 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(34, 140); this.label3.Name = \;
this.label3.Size = new System.Drawing.Size(400, 64); this.label3.TabIndex = 2;
this.label3.Text = \鼠标右键点击【数据库】->【附加(A)...】,然后\\r\\n单击【...】按钮,选择本程序所在文件夹下的中的\\r\\nDataBase文件夹下的Library.mdf文\ + \件,其他采用默认设\\r\\n置,然后单击【确定】按钮\; // // label4 //
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font(\宋体\, 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(34, 233); this.label4.Name = \;
this.label4.Size = new System.Drawing.Size(272, 16); this.label4.TabIndex = 3;
this.label4.Text = \如需帮助请登http://www.google.com\;
this.label4.Click += new System.EventHandler(this.label4_Click); // // Help //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Olive;
21
this.ClientSize = new System.Drawing.Size(472, 349); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Name = \; this.Text = \; this.ResumeLayout(false); this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; }
}
6.2图书信息模块
图书信息模块包含图书入库和图书查询两个子模块 图书入库:添加新的图书并保存信息。
图书查询:可按图书代码,图书名称,作者,出版日期,出版社五项进行查询,可删除一些废弃图书的信息,并将修改后的数据入库保存,如图6.2。
图书信息 图书入库 图书查询 添加 重置 查询 删除 重置 退出
图6.2 图书信息 代码:namespace 登陆
22
黄淮学院计算机科学系课程设计说明书
{
class LibraryManage {
private SqlConnection sqlConnection1 = null; private SqlCommand sqlCommand1 = null; private string strSql = null; public LibraryManage() {
this.sqlConnection1 = new SqlConnection(dbconnection.connection); this.sqlCommand1 = new SqlCommand();
this.sqlCommand1.CommandType = CommandType.Text; this.sqlCommand1.Connection = this.sqlConnection1;
// TODO: 在此处添加构造函数逻辑 // }
public void Library_add(string Lno, string Lname, string Wr, string Lpress, string Lbz) {
DateTime Ldate = Convert.ToDateTime(DateTime.Now.ToString(\)); this.strSql = \ +
\ + Lno + \ + Lname + \ + Wr + \ + Ldate + \ + Lpress + \ + Lbz + \;
this.sqlCommand1.CommandText = this.strSql; try {
this.sqlConnection1.Open(); this.sqlCommand1.ExecuteNonQuery(); //Lno_add(Lno); }
catch (System.Exception E) {
Console.WriteLine(E.ToString()); } finally {
this.sqlConnection1.Close(); } }
public void ts_del(string Lno) {
this.strSql = \ + \ + Lno + \; this.sqlCommand1.CommandText = this.strSql; try
23
{
this.sqlConnection1.Open(); this.sqlCommand1.ExecuteNonQuery(); }
catch (System.Exception E) {
Console.WriteLine(E.ToString()); } finally {
this.sqlConnection1.Close(); } } }
}
6.3 借阅信息模块
图书信息模块包含借阅情况和借阅查询两个子模块。
借阅情况:添加新的借阅信息,将读者号,图书号,借书日期和应还书日期保存。 借阅查询:可更具读者号和图书编号进行查询,还书时在此模块中删除该读者的借阅信息,并将修改后的信息保存,如图6.3。
借阅信息 借阅情况 借阅查询 添加 重置 查询 重置 全部 删除 退出
图6.3 图书信息 代码:namespace 登陆
{
class jieyue
24
黄淮学院计算机科学系课程设计说明书
{
private SqlConnection sqlConnection1 = null; private SqlCommand sqlCommand1 = null; private string strSql = null; public jieyue() {
this.sqlConnection1 = new SqlConnection(dbconnection.connection); this.sqlCommand1 = new SqlCommand();
this.sqlCommand1.CommandType = CommandType.Text; this.sqlCommand1.Connection = this.sqlConnection1;
// TODO: 在此处添加构造函数逻辑 // }
public void Jieyue_add(string Rno, string Lno) {
DateTime Date = Convert.ToDateTime(DateTime.Now.ToString(\)); DateTime Redate = Convert.ToDateTime(DateTime.Now.ToString(\)); this.strSql = \ +
\ + Rno + \ + Lno + \ + Date + \ + Redate + \; this.sqlCommand1.CommandText = this.strSql; try {
this.sqlConnection1.Open(); this.sqlCommand1.ExecuteNonQuery(); //Lno_add(Lno); }
catch (System.Exception E) {
Console.WriteLine(E.ToString()); } finally {
this.sqlConnection1.Close(); } }
public void jieyue_del(string Lno)
{
this.strSql = \ + \ + Lno + \; //this.strSql = \
this.sqlCommand1.CommandText=this.strSql;
25
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库C#图书管理系统 C#课程设计 图书管理系统(5)在线全文阅读。
相关推荐: