




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档-倾情为你奉上一系统概述;1设计需求; 现在中国大部分的家庭都喜欢在家里置办属于自己风格的家庭影院。但是,仍然有很多人喜欢到电影院去看电影。因为家里的气氛毕竟不如影院好。所以,现代家庭影院的出现并不会让电影院没有生路。 每个社会服务系统都有自己的一套管理机制。当然,电影院也不除外。其实电影院的管理系统应该来说比其他的社会服务系统的管理要简单一点。电影院不外乎是引进电影,制定播放影片的时间表,买票,检票进场观看,还有就是一些数据管理方面的事。如工作人员管理,票务管理等等。为了工作机制简单有序,必然要引进一套管理系统。2需求分析;具体而言,影院售票系统需要实现以下的需求:(1) 能够对
2、播放电影,工作人员,售票事宜,检票事宜,无用数据进行处理。(2) 售票管理自然有专人负责,要处理各电影的电影票销售问题。当然包括退票问题,还有就是预订电影票其实也就相当于买票。两者可以当一回事处理。(3) 检票管理事宜要完成观众进场时检票的事宜。其中包括了电影票的真假检测问题。(4) 数据管理要处理电影的播放的次序,工作人员的管理,以及过期电影票的处理问题。电影电影号电影名称主演导演生产地上映时间二结构设计座位座位编号座位票价是否售出电影票电影号电影名座位号 价格电影票号上映时间 映时间 验证码职工信息职工号职工类型职工密码三设计说明 1分析与创建数据库; 根据系统的功能分析结果,影
3、院售票管理系统将会使用Microsoft SQL Sever 2000 作为后台的数据库管理系统。本管理系统是应用于电影院中,而且需要和数据库之间进行频繁数据交换,所以采用Microsoft SQL Sever 2000 作为后台的数据库管理系统。在本管理系统中,需要掌握影库充实信息,职工管理信息,票务管理信息,此外,由于要进行职工管理,还需要掌握使用本系统的职工。表1存储硬库信息列表,表2存储了电影院座位的相关数据连接关系,表3存储了电影票销售情况管理,表4存储了系统使用者职工的相关情况的管理列表。表1 影库管理表-MOVIES字段名称数据类型字段属性字段大小作用必填字段索引是否主键Movi
4、e_idsmallint2电影号是有(无重复)是Movie_nameNvarchar50电影名称是无actorNvarchar50导演否无actressNvarchar50主演否无producerNvarchar25制片厂否无palydatedatetime8上映时间是无表2 电影院座位管理表-SEATS字段名称数据类型字段属性字段大小作用必填字段索引是否主键seatidsmallint2座位号是有(无重复)是pricefloat8票价是无soldornotsmallint2是否售出是无表3 电影票信息表-TICKETS字段名称数据类型字段属性字段大小作用必填字段索引是否主键ticketsid
5、smallint2电影票号是有(无重复)是seatidsmallint2座位号是有Movie_idsmallint2电影号是有Movie_nameNvarchar50电影名否无palydatedatetime8上映时间是无pricefloat8价格是无yanzhengmasmallint2验证码是无是表4 职工信息表-WORKERS字段名称数据类型字段属性字段大小作用必填字段索引是否主键workeridsmallint2职工号是无是passwordsmallint2职工密码是无leibiesmallint2职工类型是无根据规范化的设计理念,本管理系统的数据分成上面4个表,减少了数据的冗余,同时
6、在这些表之间又存在着一些关联关系。这四个表之间的这两种关系表现在下图所示的关系: 2创建登陆窗体模块; (1)窗体模块的功能 登陆窗体 (2)窗体界面的设计 在工程中添加一个窗体,命名为“登陆系统”,用来作为系统登陆窗体。界面 的设计如图3所示。 (3)窗体代码 Imports System.Data.SqlClientPublic Class Form1 Inherits System.Windows.Forms.Form Dim navigator As BindingManagerBase '用来对记录导航 Dim mycon As New SqlConnection '
7、连接对象 Dim mycom As New SqlCommand '命令对象 Dim mycom1 As New SqlCommand Dim frm2 As New Form2 Dim frm3 As New Form3Dim frm8 As New Form8Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick StatusBar1.Panels(0).Text = DateTime.Today StatusBar1.Panels
8、(1).Text = DateTime.Now.ToString("T") End Sub Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter If RadioButton1.Checked = True Then RadioButton2.Checked = False RadioButton3.Checked = False ElseIf RadioButton2.Checked = True The
9、n RadioButton1.Checked = False RadioButton3.Checked = False ElseIf RadioButton3.Checked = True Then RadioButton1.Checked = False RadioButton2.Checked = False End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click AxShockwaveFlash1.M
10、ovie = "E:实验运行场VB.NET程序设计电影院票务系统image登陆界面1.swf" AxShockwaveFlash1.Playing = False AxShockwaveFlash1.Stop() Dim tox1 As Int32 Dim tox2 As Int32 Dim mydataadapter As New SqlDataAdapter Dim myds As New DataSet Dim i As Integer Dim j As Integer tox1 = Val(TextBox1.Text) tox2 = Val(TextBox2.Tex
11、t) mycon.ConnectionString = "initial catalog=ticketbooking;user id=sa;password=;" mycom.Connection = mycon '通过 MYCON 连接对象操作数据库 mycom.CommandType = CommandType.Text '设置命令类型 mycom.CommandText = "select * from workers" '设置要执行的命令 Try mycon.Open() mydataadapter.SelectComma
12、nd = mycom Catch ex As Exception MessageBox.Show("连接失败") Finally mycon.Close() End Try mydataadapter.Fill(myds, "workers") For i = 0 To myds.Tables("workers").Rows.Count - 1 If tox1 = Val(myds.Tables("workers").Rows(i).ItemArray(0) Then j = 0 Exit For Else j =
13、 1 End If Next For i = 0 To myds.Tables("workers").Rows.Count - 1 If tox2 = Val(myds.Tables("workers").Rows(i).ItemArray(1) Then j = 0 Exit For Else j = 1 End If Next If j = 1 Then MessageBox.Show("您的工号或者密码错误", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Warn
14、ing) Else Try mycom1.Connection = mycon '通过 MYCON 连接对象操作数据库 mycom1.CommandType = CommandType.Text '设置命令类型 mycom1.CommandText = "select leibie from workers where workerid=" + CStr(tox1) + "and password=" + CStr(tox2) + "" '设置要执行的命令 Dim mydataadapter1 As New S
15、qlDataAdapter mydataadapter1.SelectCommand = mycom1 Dim myds1 As New DataSet mydataadapter1.Fill(myds1, "workers") If RadioButton1.Checked = True And Val(myds1.Tables("workers").Rows(0)("leibie") = 1 Then frm2.Show() Me.Hide() ElseIf RadioButton2.Checked = True And Val(
16、myds1.Tables("workers").Rows(0)("leibie") = 2 Then frm3.Show() Me.Hide() ElseIf RadioButton3.Checked = True And Val(myds1.Tables("workers").Rows(0)("leibie") = 3 Then frm8.Show() Me.Hide() Else MessageBox.Show("您超出职责范围 或未选择服务系统,请重新输入!", "错误提示&qu
17、ot;, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) End If Catch ex As Exception End Try End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AxShockwaveFlash1.Movie = "E:实验运行场VB.NET程序设计电影院票务系统image
18、登陆界面1.swf" AxShockwaveFlash1.Play() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim exitform As New Form7 If exitform.ShowDialog = DialogResult.OK Then exitform.Close() Me.Close() Application.Exit() End If End SubEnd Class3
19、 创建售票窗体模块(1) 窗体模块的功能 为观众提供买票服务。在界面上观众可以看见座位的情况,根据此来选择自己喜欢的座位。不同的座位有不同的价格。此窗体还有退票功能。(2) 窗体界面的设计 在工程中添加一个窗体,命名为“售票系统”,用来作为仓管人员窗体。界面 的设计如下图所示。(3) 代码编写 Imports System.Data.SqlClientPublic Class Form2 Inherits System.Windows.Forms.Form Dim navigator As BindingManagerBase '用来对记录导航 Dim mycon As New Sql
20、Connection '连接对象 Dim mycom As New SqlCommand '命令对象 Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Me.Show() AxShockwaveFlash1.Movie = "E:实验运行场VB.NET程序设计电影院票务系统image销售界面.swf" AxShockwaveFlash1.Play() AxShockwaveFlash2.Movi
21、e = "E:实验运行场VB.NET程序设计电影院票务系统image检票界面下.swf" AxShockwaveFlash2.Play() Dim mydataadapter As New SqlDataAdapter Dim myds As New DataSet Dim i As Integer Dim j As Integer Dim strrow As String Dim dt As New DataTable mycon.ConnectionString = "initial catalog=ticketbooking;user id=sa;passw
22、ord=;" mycom.Connection = mycon '通过 MYCON 连接对象操作数据库 mycom.CommandType = CommandType.Text '设置命令类型 mycom.CommandText = "select * from Movies" '设置要执行的命令" Try mycon.Open() mydataadapter.SelectCommand = mycom mydataadapter.Fill(myds, "Movies") Catch ex As Excepti
23、on MessageBox.Show("连接失败") Finally mycon.Close() End Try Try For i = 0 To myds.Tables("Movies").Rows.Count - 1 strrow = myds.Tables("Movies").Rows(i)("movie_name") ComboBox1.Items.Add(strrow) Next Catch ex As Exception MessageBox.Show(ex.ToString) End Try End
24、Sub Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Integer Dim tickethao As Integer Dim moviehao As Integer Dim suiji As Integer Dim mydataadapter3 As New SqlDataAdapter Dim myds3 As New DataSet Dim dt3 As New DataTable Dim myco
25、m3 As New SqlCommand Dim mycon3 As New SqlConnection Randomize() suiji = Int(9000 * Rnd() + 1000) Try tickethao = tickets_id() moviehao = movieid() mycon3.ConnectionString = "initial catalog=ticketbooking;user id=sa;password=;" mycom3.Connection = mycon3 '通过 MYCON 连接对象操作数据库 mycom3.Comm
26、andType = CommandType.Text '设置命令类型 Catch ex As Exception MessageBox.Show(ex.ToString) End Try If tickethao = 0 Then Try MessageBox.Show("此座位已售出,请重新选择!", "错误") ComboBox1.Text = "" TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = ""
27、TextBox4.Text = "" TextBox5.Text = "" Catch ex As Exception MessageBox.Show(ex.ToString) End Try Else Try mycon3.Open() mycom3.CommandText = "insert into tickets (ticketsid,seatid,movie_id,movie_name,palydate,price,yanzhengma) values (" + CStr(tickethao) + ","
28、 + TextBox4.Text + "," + CStr(moviehao) + ",'" + TextBox2.Text + "','" + TextBox1.Text + "'," + TextBox5.Text + "," + CStr(suiji) + ")" Dim sql As String sql = "insert into tickets (ticketsid,seatid,movie_id,movie_name,
29、palydate,price,yanzhengma) values (" + CStr(tickethao) + "," + TextBox4.Text + "," + CStr(moviehao) + ",'" + TextBox2.Text + "','" + TextBox3.Text + "'," + TextBox5.Text + "," + CStr(suiji) + ")" mydataadapter
30、3.InsertCommand = mycom3 Try mycom3.ExecuteNonQuery() MessageBox.Show("售票成功!", "谢谢观看") Catch ex As Exception MsgBox(ex.ToString) End Try Catch ex As Exception MessageBox.Show(ex.ToString) End Try mycon3.Close() ComboBox1.Text = "" TextBox1.Text = "" TextBox2.T
31、ext = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" End If revoke_seat() End Sub Private Sub ComboBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged revoke_seat() Dim myd
32、ataadapter1 As New SqlDataAdapter Dim mydataadapter11 As New SqlDataAdapter Dim myds1 As New DataSet Dim myds11 As New DataSet Dim dt1 As New DataTable Dim dt11 As New DataTable Dim mycom1 As New SqlCommand Dim mycom11 As New SqlCommand mycon.ConnectionString = "initial catalog=ticketbooking;us
33、er id=sa;password=;" mycom1.Connection = mycon '通过 MYCON 连接对象操作数据库 mycom1.CommandType = CommandType.Text '设置命令类型 mycom11.Connection = mycon mycom11.CommandType = CommandType.Text Try mycon.Open() mycom11.CommandText = "select palydate from Movies where movie_name= '" + Com
34、boBox1.Text + "'" mycom1.CommandText = "select * from tickets where movie_name= '" + ComboBox1.Text + "'" mydataadapter1.SelectCommand = mycom1 mydataadapter11.SelectCommand = mycom11 mydataadapter1.Fill(myds1, "tickets") mydataadapter11.Fill(myds1
35、1, "Movies") dt1 = myds1.Tables("tickets") dt11 = myds11.Tables("Movies") Catch ex As Exception MessageBox.Show(ex.ToString) End Try Try If dt1.Rows.Count = 0 Then MessageBox.Show("还未出售!") TextBox1.Text = dt11.Rows(0)("palydate") revoke_seat() Else S
36、howSellInfo(dt1) TextBox1.Text = dt11.Rows(0)("palydate") End If Catch ex As Exception End Try mycon.Close() End Sub Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim tickethao As Integer Dim mydataadapter4 As New SqlDataAdapt
37、er Dim myds4 As New DataSet Dim dt4 As New DataTable Dim mycom4 As New SqlCommand Dim mycon4 As New SqlConnection Try mycon4.ConnectionString = "initial catalog=ticketbooking;user id=sa;password=;" mycom4.Connection = mycon4 '通过 MYCON 连接对象操作数据库 mycom4.CommandType = CommandType.Text
38、9;设置命令类型 tickethao = tuipiao() Catch ex As Exception MessageBox.Show(ex.ToString) End Try If tickethao = 0 Then MessageBox.Show("座位号输入错误,请重新输入!", "错误") Else Try mycon4.Open() mycom4.CommandText = "delete from tickets where ticketsid=" + CStr(tickethao) + "" Tr
39、y mycom4.ExecuteNonQuery() MessageBox.Show("退票成功!", "谢谢观看") Catch ex As Exception MsgBox(ex.ToString) End Try Catch ex As Exception MsgBox(ex.ToString) End Try End If mycon4.Close() TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Te
40、xt = "" TextBox5.Text = "" ComboBox1.Text = "" revoke_seat() End Sub Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox2.Text = ComboBox1.Text TextBox3.Text = TextBox1.Text If TextBox4.Text = ""
41、; Then MessageBox.Show("请输入座位号!", "提示") End I Dim mydataadapter2 As New SqlDataAdapter Dim myds2 As New DataSet Dim dt2 As New DataTable Dim mycom2 As New SqlCommand mycon.ConnectionString = "initial catalog=ticketbooking;user id=sa;password=;" mycom2.Connection = mycon
42、 '通过 MYCON 连接对象操作数据库 mycom2.CommandType = CommandType.Text '设置命令类型 Try mycon.Open() mycom2.CommandText = "select * from seats where seatid=" + TextBox4.Text + "" mydataadapter2.SelectCommand = mycom2 mydataadapter2.Fill(myds2, "seats") dt2 = myds2.Tables("s
43、eats") Catch ex As Exception MessageBox.Show(ex.ToString) End Try TextBox5.Text = dt2.Rows(0)("price") mycon.Close() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim exitform As New Form7 If exitform.ShowDialog = D
44、ialogResult.OK Then exitform.Close() Me.Close() Application.Exit() End If End Sub End Class4 创建检票界面(1)创建模块的功能对进场观众检票,如果发现有假票或无票观众不允许入内。(2)创建模块的窗体 在工程中添加一个窗体,命名为“检票系统”,用来作为检票系统窗体。界面 的设计如下图所示。(3)代码编写 Imports System.Data.SqlClientPublic Class Form3Inherits System.Windows.Forms.Form Dim ds1 As New DataSet Dim sqlda1 As New SqlDataAdapter Dim RecordCount As Integer Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AxShockwaveFlash1.Mo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 食品配送合同简单范本
- 房屋共建合同四邻协议范本
- 新版离婚合同变更范文
- 首席财务官的劳动合同样本
- 地质勘查设备在钾长石矿勘查中的技术应用考核试卷
- 搪瓷制品的产品生命周期评估考核试卷
- 体育外交政策与实践考核试卷
- 文化产业中涂层的耐磨损性能研究考核试卷
- 工业设计中的产品生命周期管理考核试卷
- 信托公司业务流程标准化考核试卷
- 《大学生创新创业教程》高职大学生创新创业课程全套教学课件
- 中医肝与胆课件
- 钢结构用户需求分析报告
- 3月8日国际妇女节主题班会致敬了不起的她母爱是生命的摇篮课件
- 围挡施工方案装配式铁马
- 同步课件:古代非洲与美洲
- 2024年德州职业技术学院单招职业适应性测试题库各版本
- 外阴炎及阴道炎症课件
- JC-T 746-2023 混凝土瓦标准规范
- 统编版语文三年级下册全册同步分层作业课课练(含答案)
- 口腔科普知识问答
评论
0/150
提交评论