《.NET技术》课程设计报告网上书店管理系统_第1页
《.NET技术》课程设计报告网上书店管理系统_第2页
《.NET技术》课程设计报告网上书店管理系统_第3页
《.NET技术》课程设计报告网上书店管理系统_第4页
《.NET技术》课程设计报告网上书店管理系统_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 课程设计报告 系(部、中心) 计算机科学与工程学院 姓 名 胡威 学 号 20091612 专 业 网络工程 班 级 2班 同组人员 杨江荣、廖雄劲 课程名称 .net技术 设计题目名称 网上书店管理系统后台子系统设计与实现 起止时间 2010年11月25日2010年12月22日 成 绩 指导教师签名 张学琴 北方民族大学教务处制目 录1. 系统总体分析与设计31.1 系统体系结构3本系统采用客户/服务器(client/server)模式。简述c/s结构特点。31.2 系统功能结构32. 系统数据库设计与实现43. 系统功能详细设计与实现53. 1 登录子系统53.2 会员管理子系统103.

2、3 图书管理子系统124. 结束语145. 参考文献141. 系统总体分析与设计1.1 系统体系结构本系统采用客户/服务器(client/server)模式。简述c/s结构特点。图1 系统体系结构图1.2 系统功能结构:图2 系统功能模块图2. 系统数据库设计与实现描述数据库表的结构及相关约束,如下表:管理员信息表: 会员信息表: 图书信息表:sql server(access)数据库实现:图3 数据库实现关系图(注意:图有图题)3. 系统功能详细设计与实现3. 1 登录子系统代码:imports system.data.sqlclientpublic class frmuser inheri

3、ts system.windows.forms.form#region windows 窗体设计器生成的代码 public sub new() mybase.new() 该调用是windows 窗体设计器所必需的。 initializecomponent() 在initializecomponent() 调用之后添加任何初始化 end sub 窗体重写dispose 以清理组件列表。 protected overloads overrides sub dispose(byval disposing as boolean) if disposing then if not (components

4、 is nothing) then components.dispose() end if end if mybase.dispose(disposing) end sub windows 窗体设计器所必需的 private components as system.componentmodel.icontainer 注意: 以下过程是windows 窗体设计器所必需的 可以使用windows 窗体设计器修改此过程。 不要使用代码编辑器修改它。 friend withevents label1 as system.windows.forms.label friend withevents la

5、bel2 as system.windows.forms.label friend withevents textbox1 as system.windows.forms.textbox friend withevents textbox2 as system.windows.forms.textbox friend withevents button1 as system.windows.forms.button friend withevents button2 as system.windows.forms.button friend withevents label3 as syste

6、m.windows.forms.label private sub initializecomponent() me.label1 = new system.windows.forms.label me.label2 = new system.windows.forms.label me.textbox1 = new system.windows.forms.textbox me.textbox2 = new system.windows.forms.textbox me.button1 = new system.windows.forms.button me.button2 = new sy

7、stem.windows.forms.button me.label3 = new system.windows.forms.label me.suspendlayout() label1 me.label1.location = new system.drawing.point(32, 56) me.label1.name = label1 me.label1.size = new system.drawing.size(56, 24) me.label1.tabindex = 0 me.label1.text = 用户名: label2 me.label2.location = new s

8、ystem.drawing.point(32, 104) me.label2.name = label2 me.label2.size = new system.drawing.size(56, 24) me.label2.tabindex = 1 me.label2.text = 密 码: textbox1 me.textbox1.location = new system.drawing.point(88, 56) me.textbox1.name = textbox1 me.textbox1.size = new system.drawing.size(136, 21) me.textb

9、ox1.tabindex = 2 textbox2 me.textbox2.location = new system.drawing.point(88, 104) me.textbox2.name = textbox2 me.textbox2.passwordchar = global.microsoft.visualbasic.chrw(42) me.textbox2.size = new system.drawing.size(136, 21) me.textbox2.tabindex = 3 button1 me.button1.location = new system.drawin

10、g.point(40, 168) me.button1.name = button1 me.button1.size = new system.drawing.size(56, 24) me.button1.tabindex = 4 me.button1.text = 登 陆 button2 me.button2.location = new system.drawing.point(136, 168) me.button2.name = button2 me.button2.size = new system.drawing.size(56, 24) me.button2.tabindex

11、= 5 me.button2.text = 取 消 label3 me.label3.forecolor = system.drawing.color.blue me.label3.location = new system.drawing.point(32, 16) me.label3.name = label3 me.label3.size = new system.drawing.size(208, 24) me.label3.tabindex = 6 me.label3.text = 初始用户名和密码都为:admin frmuser me.autoscalebasesize = new

12、 system.drawing.size(6, 14) me.backcolor = system.drawing.systemcolors.activeborder me.clientsize = new system.drawing.size(256, 230) me.controls.add(me.label3) me.controls.add(me.button2) me.controls.add(me.button1) me.controls.add(me.textbox2) me.controls.add(me.textbox1) me.controls.add(me.label2

13、) me.controls.add(me.label1) me.name = frmuser me.startposition = system.windows.forms.formstartposition.centerscreen me.text = 登陆窗口 me.resumelayout(false) me.performlayout() end sub#end region public user as string public password as string dim conn as new sqlconnection(server=.; & _ database=viboo

14、k; & _ integrated security=sspi ) dim comm as new sqlcommand dim ds as new dataset dim da as new sqldataadapter private sub button1_click(byval sender as system.object, byval e as system.eventargs) handles button1.click user = textbox1.text password = textbox2.text dim str as string str = select * f

15、rom 管理员信息where 姓名= & user & and 密码= & password & comm.connection = conn comm.commandtype = commandtype.text comm.commandtext = str da.selectcommand = comm try conn.open() da.fill(ds) if ds.tables(0).rows.count 0 then dim frm2 as new frmmain frm2.show() me.hide() else messagebox.show(密码或用户名错误,请重新输入,

16、提示信息) textbox1.text = textbox2.text = textbox1.focus() end if catch ex as exception messagebox.show(登陆失败, 提示信息) end try end sub private sub button2_click(byval sender as system.object, byval e as system.eventargs) handles button2.click me.close() application.exit() end sub private sub textbox2_keypr

17、ess(byval sender as object, byval e as system.windows.forms.keypresseventargs) handles textbox2.keypress if e.keychar = microsoft.visualbasic.chrw(13) _ and textbox2.text then me.button1_click(nothing, nothing) end if end sub private sub frmuser_load(byval sender as system.object, byval e as system.

18、eventargs) handles mybase.load end subend class界面:3.2 会员管理子系统代码:imports system.data.sqlclientpublic class frmxzdz inherits system.windows.forms.form dim conn as new sqlconnection(server=.;database=vibook;integrated security=sspi) dim comm as new sqlcommand dim ds as new dataset friend withevents tex

19、tbox4 as system.windows.forms.textbox friend withevents textbox6 as system.windows.forms.textbox friend withevents textbox5 as system.windows.forms.textbox dim da as new sqldataadapter private sub frmxzdz_load(byval sender as object, byval e as system.eventargs) handles mybase.load if conn.state = c

20、onnectionstate.closed then conn.open() end if comm.connection = conn comm.commandtype = commandtype.text comm.commandtext = select * from 会员信息表 da.selectcommand = comm dim da as new sqldataadapter(select * from 学生信息表) da.fill(ds, 会员信息表) datagrid1.datasource = ds.tables(会员信息表) if conn.state = connect

21、ionstate.open then conn.close() end if end sub private sub button1_click(byval sender as system.object, byval e as system.eventargs) handles button1.click ds.clear() if conn.state = connectionstate.closed then conn.open() end if dim str as string str = insert into 会员信息表(会员编号,会员姓名,会员性别,密码,已买书数,电话) va

22、lues ( & textbox1.text & , & textbox2.text & , & combobox1.selecteditem & , & textbox4.text & , & textbox5.text & , & textbox6.text & ) comm.connection = conn comm.commandtype = commandtype.text comm.commandtext = str da.selectcommand = comm da.fill(ds, 会员信息表) if me.ds.tables.count 0 then comm.conne

23、ction = conn comm.commandtype = commandtype.text comm.commandtext = select * from 会员信息表 da.selectcommand = comm待添加的隐藏文字内容2 da.fill(ds, 会员信息表) messagebox.show(新增会员信息成功, 提示信息) textbox1.text = textbox2.text = combobox1.text = textbox4.text = textbox5.text = textbox6.text = textbox1.focus() else end if

24、end sub private sub button2_click(byval sender as system.object, byval e as system.eventargs) handles button2.click me.close() end subend class界面:3.3 图书管理子系统代码:imports system.data.sqlclientpublic class frmxzsj inherits system.windows.forms.form dim conn as new sqlconnection(server=.;database=vibook;

25、integrated security=sspi) dim comm as new sqlcommand dim ds as new dataset dim da as new sqldataadapter dim reader1 as sqldatareader private sub frmxzsj_load(byval sender as object, byval e as system.eventargs) handles mybase.load if conn.state = connectionstate.closed then conn.open() end if comm.c

26、onnection = conn comm.commandtype = commandtype.text comm.commandtext = select * from 图书信息表 da.selectcommand = comm dim da as new sqldataadapter(select * from 学生信息表) da.fill(ds, 图书信息表) datagrid1.datasource = ds.tables(图书信息表) if conn.state = connectionstate.open then conn.close() end if end sub priva

27、te sub button1_click(byval sender as system.object, byval e as system.eventargs) handles button1.click ds.clear() if conn.state = connectionstate.closed then conn.open() end if dim str as string str = insert into 图书信息表(图书编号,图书类别,书名,作者,出版社,价格,册数,出版日期) values ( & textbox1.text & , & textbox2.text & , & combobox1.selecteditem & , & textbox3.text & , & textbox4.text & , & textbox5.text & , & textbox6.text & , & datetimepicker1.value.date & ) comm.connection = conn comm.commandtype = comma

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论