数据库课程设计报告设备管理系统

上传人:z**** 文档编号:113121969 上传时间:2022-06-24 格式:DOC 页数:11 大小:427.50KB
返回 下载 相关 举报
数据库课程设计报告设备管理系统_第1页
第1页 / 共11页
数据库课程设计报告设备管理系统_第2页
第2页 / 共11页
数据库课程设计报告设备管理系统_第3页
第3页 / 共11页
亲,该文档总共11页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
景德镇陶瓷学院科技艺术学院工程系数据库课程设计报告设备管理系统专 业:计算机科学与技术班级:10计科学 号:201030457135 姓名:刘世雨指导教师:何福保、胡开华2012年12月10日、系统功能:通过对某企业或单位设备管理相关流程进行分析,完成具有对设备进行基本信息管理和 信息检索等基本功能的设备管理系统的分析、设计与实现。在这个设备管理系统中,基本做到了指导老师要求的“增、删、改”对于实验指导书要求的六大项,因为个人学业水平有限,所以暂时才完成了以下四项:1、实现设备的录入、删除、修改等基本操作。2、实现国家标准设备代码的维护。3、能够对设备进行方便的检索。4、能够输出设备分类明细表。用户表:戸表:表用户名密码性址Emailj卜11112234322444:=li1ti i nslJjti i n124wu123江西748866qq. comWWWWWW1ingdezhen123456Sqq. com管理员表:设备管理表:S设备管理表:表设备漏兰12_3_%56设备毛厂商 I 数量 丨 备注lnov ?hpacerdellappl h2CC:50030C:60C:400700设备信息表:设备編E谡蚤喀FW仓库号备注i1联想lenovo001200九成新10沿见y:TLi i :=lTl010999暂无2-惠普hp002500全新3.-宏基acer003300全新4dill004600全新5华硕:=lEUE005400全新6苹果appl e006700全新7东芝toshiba007100全新8神州Hasse0081000全新9索尼sony009350*浏览器中数据库预览截图:ID仓库号管巒备注1001中华区绿湖街正常2002中华区勤奋街小王正常3003中华区柳荫街小李g7*s正常400斗中华区才子後小朱251*aa*正常用户注册:用户名: 密 码: 鹹翹S 址: Email画用户名: 原: 新詡: 确认密码:设备塢号:仙设备名:左见厂商:yanjian备注:暫无仓阵号:010设备扁号厂商仓库号备注1lenovo001200扎端弟辑围涂2主& 事.曰hp002500绘滁3宏基日匚er003300显辑箍涂4dell004600整辑理涂5asus0054006苹果apple006700出涂7toshiba007100定辑珀除8神弼Hasse0081000泊辑理涂9MSsony009350F T亠口 科耳嗣除设备管理流程图:三、功能界面设计1、系统登录界面ffip权限:用户名:-密码:201030467135源代码:if (DropDownListl.SelectedVaiue =管理员)if (TextBoxl.Text = II TextBox2.Text =)Labell.Text =用户名和密码不能为空。;elsestring sql;string DBName = ConfigurationManager.AppSettings.Get(DBName).ToString();从配置文件中得到数据库驱动string DBDriver = ConfigurationManager.AppSettings.Get(DBDriver).ToString();得到数据库连接字符串stringDBConnectionString=DBDriver+HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath + /App_Data/) + DBName;/建立数据库连接对象OleDbConnection OleDbConn = new OleDbConnection(DBConnectionString);OleDbConn.Open();/sql = select * from 用户表 where 用户名=kaihua and 密码=kaihua;建立sql查询语句 sql = select * from 管理员表 where 用户名=+ TextBox1.Text.Trim() + and 密码=+ TextBox2.Text.Trim() +;/建 立 sql 查询语句OleDbCommand cmd = new OleDbCommand(sql, OleDbConn);执行SQL查询语句OleDbDataReader mydata = cmd.ExecuteReader();if (mydata.Read()判断查询结果是否为空this.Label1.Text =登入成功! ”;/Sessionusername = this.username.Text;Response.Redirect(zhuye.aspx);elsethis.Label1.Text =用户不存在,请检测用户名和密码是否正确! ”;else if (DropDownListl.SelectedValue =用户)if (TextBox1.Text = | TextBox2.Text =)Label1.Text =账号和密码不能为空。;elsestring sql;string DBName = ConfigurationManager.AppSettings.Get(DBName).ToString();从配置文件中得到数据库驱动string DBDriver = ConfigurationManager.AppSettings.Get(DBDriver).ToString();得到数据库连接字符串stringDBConnectionString=DBDriver+HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath + /App_Data/) + DBName;/建立数据库连接对象OleDbConnection OleDbConn = new OleDbConnection(DBConnectionString);OleDbConn.Open();/sql = select * from 用户表 where 用户名=kaihua and 密码=kaihua;建立sql查询语句 sql = select * from 用户表 where 用户名=+ TextBox1.Text.Trim() + and 密码=+ TextBox2.Text.Trim() +;/建 立 sql 查询语句OleDbCommand cmd = new OleDbCommand(sql, OleDbConn);执行SQL查询语句OleDbDataReader mydata = cmd.ExecuteReader();if (mydata.Read()判断查询结果是否为空this.Label1.Text =登入成功! ”;/Sessionusername = this.username.Text;Response.Redirect(zhuye.aspx);elsethis .Label1.Text =用户不存在,请检测用户名和密码是否正确!2、增删改信息:设曲询:学i设备編号:*谿名:*ni:ir仓库号:*数S:*备注:设备编号设备名厂商仓库号IS备注1联想lenovo001200册除2hp002500册除3宏基acer003300斗戴尔dell004600全删除5asus005400鏈谢除6苹果apple006700黑辑册除7toshiba007100鈿8神州Hasse0081000全新更新取消9sony009350册除增加源代码:if (this.TextBoxlO.Text = II this.TextBoxll.Text = II this.TextBoxl2.Text = II this.TextBoxl3.Text = IIthis.TextBox14.Text = II this.TextBox15.Text =)Response.Write(alert(带*号的信息为必填。);elsestring DBName = ConfigurationManager.AppSettings.Get(DBName).ToString();string DBDriver = ConfigurationManager.AppSettings.Get(DBDriver).ToString();stringDBConnectionString=DBDriver+HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath + /App_Data/) + DBName;OleDbConnection con = new OleDbConnection(DBConnectionString);OleDbCommand cmd = con.CreateCommand();cmd.CommandText = insert into设备信息表(设备编号,设备名,厂商,仓库号,数量,备注) values( + this.TextBoxlO.Text + , + this .TextBoxll.Text + , + this.TextBox12.Text + , + this.TextBox13.Text +, + this .TextBox14.Text +, + this.TextBox15.Text +);cmd.Connection = con;con.Open();cmd.ExecuteNonQuery();con.Close();GridViewBind();protected void Button3_Click(object sender, EventArgs e)TextBox10.Text =;TextBoxll.Text =;TextBox12.Text =;TextBox13.Text =;TextBoxl4.Text =;TextBoxl5.Text =;删除源代码:string cid = GridView1.DataKeyse.RowIndex.Values0.ToString();string SqlStr = delete from 设备信息表 where 设备编号=+ cid + ;string DBName = ConfigurationManager.AppSettings.Get(DBName).ToString();从配置文件中得到数据库驱动string DBDriver = ConfigurationManager.AppSettings.Get(DBDriver).ToString();得到数据库连接字符串stringDBConnectionString=DBDriver+HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath + /App_Data/) + DBName;建立数据库连接对象OleDbConnection conn = new OleDbConnection(DBConnectionString);conn.Open();/OleDbConnectionconn=newOleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings1.ConnectionString);conn.Open();/OleDbConnection conn = new OleDbConnection(DBConnectionString);conn.Open();OleDbCommand comm = new OleDbCommand(SqlStr, conn);comm.ExecuteNonQuery();comm.Dispose();if (conn.State.ToString() = Open) conn.Close();GridView1.EditIndex = -1;GridViewBind();修改源代码:/string Cid = (TextBox)GridView1.Rowse.RowIndex.Cells0.Controls0).Text.ToString();string Cid = GridView1.DataKeyse.RowIndex.Vhlues0.ToString();/string Cname = GridView1.DataKeyse.RowIndex.Values0.ToString();string Cname = (TextBox)GridView1.Rowse.RowIndex.Cells1.Controls0).Text.ToString();string Cadress = (TextBo )GridView1.Rowse.RowIndex.Cells2.Controls0).Text.ToString();string Positions = (TextBo )GridView1.Rowse.RowIndex.Cells3.Controls0).Text.ToString();string Cphone = (TextBo )GridView1.Rowse.RowIndex.Cells4.Controls0).Text.ToString();string Cgrade = (TextBox)GridView1.Rowse.RowIndex.Cells5.Controls0).Text.ToString();/string Cname = (TextBox)GridView1.Rowse.RowIndex.FindControl(Cname).Text;/string Cadress = (TextBox)GridView1.Rowse.RowIndex.FindControl(Cadress).Text;/string Position = (TextBox)GridView1.Rowse.RowIndex.FindControl(Position).Text;/string Cphone = (TextBox)GridView1.Rowse.RowIndex.FindControl(Cphone).Text;/string Cgrade = (TextBox)GridView1.Rowse.RowIndex.FindControl(Cgrade).Text;string DBName = ConfigurationManager.AppSettings.Get(DBName).ToString();/从配置文件中得到数据库驱动string DBDriver = ConfigurationManager.AppSettings.Get(DBDriver).ToString();得到数据库连接字符串stringDBConnectionString=DBDriver+HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath + /App_Data/) + DBName;建立数据库连接对象OleDbConnection conn = new OleDbConnection(DBConnectionString);conn.Open();string SqlStr = update 设备信息表 set 设备名=+ Cname + ,厂商=+ Cadress + ,仓库号=+ Positions + ,数量=+ Cphone + ,备注= + Cgrade + where 设备编号=+ Cid + ;/string SqlStr = update company set Cname=lll,Positions=llllwhere Cid=as;用户相关 设脅换作 设备管理 信息查询 菅理输诲源代码:mpmenu1=new mMenu(用户相关,self,);mpmenu1.addltem(new mMenuItem(用户注册,yonghuzhuce.aspx,it,false,用户登录,null,); mpmenu1.addltem(new mMenuItem(密码修改,mimaxiugai.aspx,it,false,用户登录,null,);mpmenu2=new mMenu(设备操作,”,self,”,”,”,”);mpmenu2.addltem(new mMenuItem(mpmenu2.addltem(new mMenuItem(mpmenu2.addltem(new mMenuItem(mpmenu2.addltem(new mMenuItem(增加设备,shebeicaozao.aspx,it,false,增加设备,null,);删除设备,shebeicaozao.aspx,it,false,删除设备null,);修改设备,shebeicaozao.aspx,it,false,修改设备,null,);查找设备,shebeicaozao.aspx,it,false,查找设备,null,);mpmenu3=new mMenu(设备管理,self,);mpmenu3.addltem(new mMenuItem(折旧管理,jsjjczs.aspx,blank,false,折旧管理,null,);mpmenu3.addltem(new mMenuItem(维修管理,windowsjc.aspx,blank,false,维修管理,null,); mpmenu4=new mMenu(信息查询,self,);mpmenu4.addltem(new mMenuItem(仓库信 息查询 ,cangkuxinxichaxun.aspx,it ,false,仓库信 息查询,null,);mpmenu4.addltem(new mMenuItem( 设备信 息查询,shebeixinxichaxun.aspx,it ,false,设备信 息查询,null,);mpmenu5=new mMenu(管理简介,self,);mpmenu5.addltem(new mMenuItem(设备管 理简介 ,shenbeiguanlijianjie.aspx,it,false,仓库信 息查询,null,);课程设计总结这次课程设计使我熟悉了系统设计的整体步骤。系统设计大体可分为需求分析、概念 设计、逻辑设计、物理设计、数据库的实施及调试测试六大步骤。其中,让我感触最深的 是需求分析阶段,在这个阶段,必须对所要设计的系统有总体的构思和了解,知道自己要 做什么,要实现什么,并且要实际的进行相关的调查,不能凭想象或自己的了解,这样会 在后续的工作中遇到很多的问题。这次课程设计加深了我对数据库系统概论相关知识和SQL SERVER相关功能的理解。 例如对建立基本表、视图、索引、存储过程、触发器等,都比以前更加的熟练。并在解决 遇到的各种问题的过程中,学到了很多新的知识。比如在导入导出数据时,由于外键约束 的存在,经常会出现错误,这就要注意各个表导入的顺序问题。一般是先导入主键表,后 导入外键表,这样可以避免很多的错误。我进一步掌握了相关的SQL语句方面的知识。不但纠正了以前的错误认识和理解,而 且学会了建立存储过程和触发器。通过查阅资料,我还明白了存储过程是编译后放在服务 器端的程序,它可以被别的模块调用,且不需要重新编译,这样就大大减轻了客户端的负 担,且有效的提咼了系统执行的效率。当然,在实习的过程中也存在一些问题。由于需求分析阶段的工作完成的不是很充分, 在后面的设计过程中,前后时常会出现矛盾,不一致现象,因此要反复的修改前面的结果, 导致整个工作进行的不是很顺利。
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 活动策划


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!