《信息系统与数据库技术》课程设计_第1页
《信息系统与数据库技术》课程设计_第2页
《信息系统与数据库技术》课程设计_第3页
《信息系统与数据库技术》课程设计_第4页
《信息系统与数据库技术》课程设计_第5页
已阅读5页,还剩49页未读 继续免费阅读

下载本文档

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

文档简介

1、信息系统与数据库技术课程设计设计题目:网上书店信息系统设计者;黄闪浪1系统目标:本系统支持等图书商品管理、图书销售、客户分析3个方面的功能,并具有信息管理、事务处理和决策支持的系统特点。2需求分析(1业务需求酒店客房预订管理系统主要有三类用户角色:客户、店员、店长。他们各自的主要业务处理需求如下:1.客户在系统中完成对酒店房间的浏览和预订。主要业务和流程包括:查询、浏览图书商品选择放入购物车选择支付方式、发货方式和填写个人信息生成和提交订单。2.店员在系统中完成商品管理、订单处理等:商品上架、下架;商品折扣管理;商品汇总。3.店长在系统中获得商品和营销分析、客户分析以制订营销策略:客房汇总(包

2、括分类汇总:营业状况分析(包括按时间、图书类别、客户类别等汇总;客户分析(按客户重要性、忠诚度分析等。(2数据处理需求系统涉及的数据源有图书数据、客户数据、客户购买数据,产生图书信息表、客户信息表、订单、客户分析表、销售分析等各项表单。结合业务处理需求,系统数据流图如图一所示。 客户信息管理购书管理图书信息管理营销分析客户基本信息图书信息订单信息客户数据图书数据购买数据1234客户店员客户店长客户店员客户分析表销售分析表订单客户信息表图书信息表图一: 系统数据流图3系统总体设计 (1系统结构网络书店的客户散落在不同地域,凡是可以接入互联网的用户都可以成为书店的客户。我们从系统安全、快速访问等方

3、面考虑,可以采用客户机/服务器结构(C/S 。(2系统技术方案系统前台开发工具:面向客户、店员、店长的C/S 应用程序采用VB.NET 语言开发。 后台数据库采用Microsoft SQL Server 。(3系统功能结构根据需求分析所获得的业务需求,可以定义系统的详细功能说明如表所示。用户主要功能客户店员店长客户信息管理注册、维护个人信息;查看个人入住记录等查询、浏览、汇总客户信息;查询、浏览、汇总客户信息;图书信息管理图书查询、预订查询图书信息;查看图书优惠政策使用情况图书汇总;查询图书信息;查看图书优惠政策使用情况购书管理预订图书查看订单,修改订单查看、汇总订单营销分析按时间、图书类别、

4、地域等汇总销售情况,查询和生成相关信息报表;客户新兴趣分析、忠诚度分析客户信息维护订单管理查询、浏览图书客户信息表客户信息汇总购物车管理销售情况分析客户信息管理购书管理营销分析客户分析网上书店客户分类管理图书折扣管理图书信息汇总图书信息管理图书信息维护图二:网上书店系统功能结构4数据库设计(1数据库概念设计(2 系统主要实体有图书和客户两个,她们通过订购活动建立联系,分析定义各实体的属性,建立实体间的联系模型的E-R 图如下客户号姓名客户订购图书书号书名n职业所在省区Email性别生日联系电话客户等级忠诚度数量出版社出版时间内容简介价格支付方式m发货方式发货地址作者订货时间折扣订单号类别图三:

5、网上书店E-R 图(3 数据库逻辑设计1 将数据库的概念模式转化为如下四个基本关系模式客户(客户号,姓名,性别,职业,生日,所在省区,联系电话,E-mail ,客户等级,忠诚度图书(书号,书名,作者,出版社,出版时间,类别,内容简介,价格,折扣订单(订单号,客户号,支付方式,发货方式,发货地址,订货时间2数据库Bookstore的关系图如下 3数据库物理设计1下面给出SQL Server 下的网上书店数据库物理设计的关系模型设计、完整性约束设计和索引选择。2Customer 客户表,用于存储客户基本信息,如下图所示 Customer 客户表3Book 图书表,用于存储图书基本情况 Book 图

6、书表4BookOrder 订单表,用于存储订单的基本情况 BookOrder 订单表5OrderDetail 订单详细情况表,用于存储订单的详细情况 5数据库应用对象设计可以充分利用SQL Server所提供的数据库应用对象来支持应用程序开发,这样,可以提高程序开发效率和系统运行效率并且可以加强系统的安全性。如下面示例1示图设计示图设计是一个虚拟表,可以简化客户端程序和提高访问安全性*视图V_Customer and Suppliers by CityV_Customer and Suppliers by City支持客户和供应商的城市情况的查询。视图的定义语句如下create view &q

7、uot;Customer and Suppliers by City" ASSELECT City, CompanyName, ContactName, 'Customers' AS RelationshipFROM CustomersUNION SELECT City, CompanyName, ContactName, 'Suppliers'FROM Suppliers-ORDER BY City, CompanyName视图如下 *视图"V_Orders Qry"视图"V_Orders Qry"的定义语句如

8、下create view "Orders Qry" ASSELECT Orders.OrderID, Orders.CustomerID, Orders.EmployeeID, Orders.OrderDate, Orders.RequiredDate,Orders.ShippedDate, Orders.ShipVia, Orders.Freight, Orders.ShipName, Orders.ShipAddress, Orders.ShipCity,Orders.ShipRegion, Orders.ShipPostalCode, Orders.ShipCount

9、ry,Customers.CompanyName, Customers.Address, Customers.City, Customers.Region, Customers.PostalCode, Customers.CountryFROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID视图"V_Orders Qry"如下 2储存过程设计.储存过程建立在SQL_Server服务器端,在数据库应用程序中使用存储过程可以简化客户端程序,提供系统运行效率,加强安全性并且减少网络信息

10、传输量。*储存过程proc_SearchBookproc_SearchBook按书名(BookName实现模糊查询CREATE TRIGGER tri_BookOrderDe1bookname VarChar(60ASSELECT*FROM Book WHERE BookName LIKE “%” + bookname + ”%”6系统开发设计系统开发设计设计很多详细的设计内容,限于篇幅,这里只给出一般性说明和要求。(1子系统设计按照系统结构设计,本系统是C/S系统。(2界面设计要求1以菜单集成各功能窗口。2各窗口界面整齐美观,恰当地使用各种窗体控件,便于用户使用。3有用户登录界面,即进行身份

11、验证,根据用户信息使用不同的功能。4报表要简洁清晰,布局合理。功能;查询功能:用户登录界面,提供客户信息查询,添加图书查询,删除图书查询。 功能:客户信息查询。 功能:添加图书 功能:删除图书。 功能:查询订房情况表的详细内容。(3程序设计注意事项1注意输入有效性的检查,即编写程序检验用户输入的数据是否符合数据类型或格式的需求,如果不合适,提醒其重新输入,从而保证与数据库的正确交互及保证数据库信息的有效性。2过程和函数的使用。将一些具有独立功能的程序段编写为过程或函数,这样不仅使程序结构模块化,而且可以通过过程或函数多次调用共享代码。3全局变量或过程的使用。因为系统中含有多个窗体和模块文件,为

12、了数据处理需要,可以使用一些全局变量或全局过程,这样可以简化程序,减少代码量,提高系统效率,因此可以将它们放在模块文件中。4存储过程建立在SQL SERVER 服务器端,在数据库应用程序中使用存储过程可以简化客户端程序,提供系统运行效率,并且减少网络信息传输量。5视图建立在SQL SERVER 服务器端,可以简化客户端程序和提高访问安全性。6触发器建立在数据表上。当有对数据库更新操作时,自动执行,可以维护数据的一致性,如果一般性的关系完整性约束规则无法实现的数据约束,则可使用触发器实现。(4程序代码* Form1Imports System.DataPublic Class Form1Publ

13、ic mybind As BindingManagerBase#Region " Windows 窗体设计器生成的代码 "Public Sub New(MyBase.New('该调用是 Windows 窗体设计器所必需的。InitializeComponent('在 InitializeComponent( 调用之后添加任何初始化End Sub'Button1'''Button2'''Button3'''Button4'''Button5''

14、;'Button6'''Button7'''Button8''Button9'''Label1'''Label2'''Label3'''Label4'''Label5'''Label6'''Label7'''Label8'''Label9'''Label10'Form1'

15、Me.Name = "Form1"Me.Text = "Form1"Me.ResumeLayout(FalseEnd SubPrivate Sub SqlDataAdapter1_RowUpdated(ByVal sender As System.Object, ByVal e AsEnd SubPrivate Sub DataGrid1_Navigate(ByVal sender As System.Object, ByVal ne AsEnd SubPrivate Sub Button7_Click(ByVal sender As System.Ob

16、ject, ByVal e As System.EventArgs Handles Button7.Clickmybind.AddNew(End SubPrivate Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs Handles TextBox1.TextChangedEnd SubPrivate Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs Handl

17、es TextBox5.TextChangedEnd SubPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs Handles MyBase.Load SqlDataAdapter1.Fill(DataSet11.Customermybind = BindingContext(DataSet11, "Customer"DataGrid1.DataSource = DataSet11.CustomerEnd SubPrivate Sub Button2_Click(

18、ByVal sender As System.Object, ByVal e As System.EventArgs HandlesButton2.Clickmybind.Position = 0DataGrid1.CurrentRowIndex = mybind.PositionEnd SubPrivate Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs HandlesButton4.Clickmybind.RemoveAt(mybind.PositionEnd SubPrivate S

19、ub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs HandlesButton1.Clickmybind.EndCurrentEdit(SqlDataAdapter1.Update(DataSet11.CustomerEnd SubPrivate Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs HandlesButton6.Clickmybind.CancelCurrentEdit(End

20、SubPrivate Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs HandlesButton5.Clickmybind.Position = mybind.Position - 1DataGrid1.CurrentRowIndex = mybind.PositionEnd SubPrivate Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs HandlesButton8.Click

21、mybind.Position = mybind.Position + 1DataGrid1.CurrentRowIndex = mybind.PositionPrivate Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs Handles Button3.Clickmybind.Position = mybind.Count - 1DataGrid1.CurrentRowIndex = mybind.PositionEnd SubPrivate Sub Label6_Click(ByVal

22、 sender As System.Object, ByVal e As System.EventArgs Handles Label6.ClickEnd SubEnd Class*Form2Imports System.DataPublic Class Form2#Region " Windows 窗体设计器生成的代码 "Public Sub New(MyBase.New('该调用是 Windows 窗体设计器所必需的。InitializeComponent('在 InitializeComponent( 调用之后添加任何初始化End Sub'窗体

23、重写 dispose 以清理组件列表。Protected Overloads Overrides Sub Dispose(ByVal disposing As BooleanIf disposing ThenIf Not (components Is Nothing Thencomponents.Dispose(End IfEnd IfMyBase.Dispose(disposingEnd Sub'Button1''Button2'''Button3'''Button4'''Button5'

24、''Button6'''Button7'''Button8'''Button9'''Button10''Button11''Form2'Me.Name = "Form2"Me.Text = "添加图书"Me.ResumeLayout(FalseEnd Sub#End RegionPrivate Sub TextBox7_TextChanged(ByVal sender As System.Object,

25、ByVal e As System.EventArgs Handles TextBox7.TextChangedEnd SubPrivate Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs Handles MyBase.LoadEnd SubPrivate Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs HandlesButton7.ClickDim hsl As SqlConnection

26、hsl = New SqlConnectionhsl.ConnectionString = "Initial Catalog=Bookstore; Data Source=.; User ID=sa; Password=;"Dim wbl As SqlCommandwbl = New SqlCommandwbl.CommandText = "insert into Book values ('" & TextBox1.Text & "', '" & TextBox2.Text &

27、 "', '" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "'," & TextBox8.Text & &qu

28、ot;," & TextBox9.Text & ""wbl.Connection = hslhsl.Open(wbl.ExecuteNonQuery(hsl.Close(End SubPrivate Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs Handles Button11.ClickEndEnd SubEnd Class*Form3Imports System.dataPublic Class Form3#Region "

29、Windows 窗体设计器生成的代码 "Public Sub New(MyBase.New('该调用是 Windows 窗体设计器所必需的。InitializeComponent('在 InitializeComponent( 调用之后添加任何初始化End Sub'Button1'''Button2'Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs Handles MyBase.Load Dim hsl As Sql

30、Connectionhsl = New SqlConnectionhsl.ConnectionString = "Initial Catalog=Bookstore; Data Source=.; User ID=sa; Password=;"Dim sql As Stringsql = " select Bookcode from Book"Dim mycommand As SqlCommandmycommand = New SqlCommandmycommand.CommandText = sqlmycommand.Connection = hslD

31、im myadapter As SqlDataAdaptermyadapter = New SqlDataAdaptermyadapter.SelectCommand = mycommandDim mydataset As DataSetmydataset = New DataSetmyadapter.Fill(mydataset, "Bookcode"ComboBox1.DataSource = mydataset.Tables("bookcode"ComboBox1.DisplayMember = mydataset.Tables("boo

32、kcode".Columns(0.ToString End SubPrivate Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs HandlesButton2.ClickDim hsl As SqlConnectionhsl = New SqlConnectionhsl.ConnectionString = "Initial Catalog=Bookstore; Data Source=.; User ID=sa; Password=;"Dim wbl As

33、SqlCommandwbl = New SqlCommandwbl.CommandText = "delete from Book where Bookcode= '" & ComboBox1.Text & "'"wbl.Connection = hslhsl.Open(wbl.ExecuteNonQuery(hsl.Close(End SubPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs Handle

34、sButton1.ClickEndEnd SubPrivate Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs Dim hsl As SqlConnectionhsl = New SqlConnectionhsl.ConnectionString = "Initial Catalog=Bookstore; Data Source=.; User ID=sa; Password=;"Dim sql As Stringsql = "

35、; select Bookname,author from Book where bookcode='" & ComboBox1.Text & "'"Dim mycommand As SqlCommandmycommand = New SqlCommandmycommand.CommandText = sqlmycommand.Connection = hslDim myread As SqlDataReaderhsl.Open(myread = mycommand.ExecuteReadermyread.Read(TextBox1

36、.Text = myread.Item(0TextBox2.Text = myread.Item(1myread.Close(hsl.Close(End SubPrivate Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs Handles ComboBox1.SelectedIndexChangedDim hsl As SqlConnectionhsl = New SqlConnectionhsl.ConnectionString = "Init

37、ial Catalog=Bookstore; Data Source=.; User ID=sa; Password=;"Dim sql As Stringsql = " select Bookname,author from Book where bookcode='" & ComboBox1.Text & "'"Dim mycommand As SqlCommandmycommand = New SqlCommandmycommand.CommandText = sqlmycommand.Connection

38、 = hslDim myread As SqlDataReaderhsl.Open(myread = mycommand.ExecuteReadermyread.Read(TextBox1.Text = myread.Item(0TextBox2.Text = myread.Item(1myread.Close(hsl.Close(End SubEnd Class*Form4Imports System.dataPublic Class Form4#Region " Windows 窗体设计器生成的代码 "Public Sub New(MyBase.New('该调用是 Windows

温馨提示

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

评论

0/150

提交评论