《.NET技术》课程设计报告网上书店管理系统.doc

上传人:土8路 文档编号:10385174 上传时间:2021-05-13 格式:DOC 页数:15 大小:349.50KB
返回 下载 相关 举报
《.NET技术》课程设计报告网上书店管理系统.doc_第1页
第1页 / 共15页
《.NET技术》课程设计报告网上书店管理系统.doc_第2页
第2页 / 共15页
《.NET技术》课程设计报告网上书店管理系统.doc_第3页
第3页 / 共15页
《.NET技术》课程设计报告网上书店管理系统.doc_第4页
第4页 / 共15页
《.NET技术》课程设计报告网上书店管理系统.doc_第5页
第5页 / 共15页
点击查看更多>>
资源描述

《《.NET技术》课程设计报告网上书店管理系统.doc》由会员分享,可在线阅读,更多相关《《.NET技术》课程设计报告网上书店管理系统.doc(15页珍藏版)》请在三一文库上搜索。

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 & ,

28、& ComboBox1.SelectedItem & , & TextBox3.Text & , & TextBox4.Text & , & TextBox5.Text & , & TextBox6.Text & , & DateTimePicker1.Value.Date & ) comm.Connection = conn comm.CommandType = CommandType.Text comm.CommandText = str da.SelectCommand = comm da.Fill(ds, 图书信息表) If Me.ds.Tables.Count 0 Then comm

29、.Connection = conn comm.CommandType = CommandType.Text comm.CommandText = select * from 图书信息表 da.SelectCommand = comm da.Fill(ds, 图书信息表) MessageBox.Show(新增图书信息成功, 提示信息) TextBox1.Text = TextBox2.Text = TextBox3.Text = ComboBox1.Text = TextBox4.Text = TextBox5.Text = TextBox6.Text = TextBox1.Focus() E

30、lse End If If conn.State = ConnectionState.Open Then conn.Close() End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged End SubEnd Clas界面:4. 结束语VB的学习过程应该是一个快乐的过程,要充分的体会它的可视化编程的魅力。将枯燥的后台代码和前面的窗体联系起来。多读代码,而不是复制、粘贴代码。5. 参考文献1 黄梯云,管理信息系统,高等教育出版社,2003年5月2 冯玉才,数据库系统基础,华中理工大学出版社,2008年1月

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1