C#图书管理系统 C#课程设计 图书管理系统(6)

2019-01-10 12:17

try { }

catch(System.Exception E) { } finally { }

this.sqlConnection1.Close(); Console.WriteLine(E.ToString()); this.sqlConnection1.Open(); this.sqlCommand1.ExecuteNonQuery();

} } }

6.4 读者信息模块

读者信息模块包含了读者信息和读者信息查询两个子模块

读者信息:添加新读者的读者号,姓名,性别,所在系,年龄并将修改后的信息入库保存

读者信息查询:可按照读者号,姓名,性别,所在系,年龄五种类型进行查询,可删除读者的信息并将修改后的信息保存,如图6.4。

读者信息 读者信息 读者信息查询 添加 重置 查询 重置 全部 删除 退出

图6.4 读者信息

26

黄淮学院计算机科学系课程设计说明书

代码: namespace 登陆

{

class duzhe {

private SqlConnection sqlConnection1 = null; private SqlCommand sqlCommand1 = null; private string strSql = null; public duzhe() {

this.sqlConnection1 = new SqlConnection(dbconnection.connection); this.sqlCommand1 = new SqlCommand();

this.sqlCommand1.CommandType = CommandType.Text; this.sqlCommand1.Connection = this.sqlConnection1;

// TODO: 在此处添加构造函数逻辑 // }

public void dz_add(string Rno, string Rname, string Rsex, string Rdep, int Rage) {

//DateTime Ldate = Convert.ToDateTime(DateTime.Now.ToString(\ this.strSql = \ +

\ + Rno + \ + Rname + \ + Rsex + \ + Rdep + \ + Rage + \; 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 dz_del(string Rno) {

this.strSql = \ + \ + Rno + \; this.sqlCommand1.CommandText = this.strSql; try

27

{

this.sqlConnection1.Open(); this.sqlCommand1.ExecuteNonQuery(); }

catch (System.Exception E) {

Console.WriteLine(E.ToString()); } finally {

this.sqlConnection1.Close(); } } } }

7 系统测试

具体操作如下:

(1)打开数据库SQL Service 2005,数据库右键选择‘附加’,选择要添加的数据库,如图

图1 添加数据库

28

黄淮学院计算机科学系课程设计说明书

(2)打开VS 2008 选择 文件>打开->文件,如图2

图2 用VS 2008打开登陆文件

(3)编译后可进入登陆界面,输入用户名及密码就可以进入图书管理系统了见图3和图4

29

图3 登陆界面

图4 图书借阅管理界面

(4)进人 图书信息->图书入库 界面,可以向管理系统中添加新的图书,如图5-1

30


C#图书管理系统 C#课程设计 图书管理系统(6).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2016-2020年中国瘦客户机市场调研及投资价值分析报告目录

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: