用数据库设计影院售票管理系统Word文件下载.docx

上传人:b****1 文档编号:461069 上传时间:2023-04-29 格式:DOCX 页数:44 大小:463.68KB
下载 相关 举报
用数据库设计影院售票管理系统Word文件下载.docx_第1页
第1页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第2页
第2页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第3页
第3页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第4页
第4页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第5页
第5页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第6页
第6页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第7页
第7页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第8页
第8页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第9页
第9页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第10页
第10页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第11页
第11页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第12页
第12页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第13页
第13页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第14页
第14页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第15页
第15页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第16页
第16页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第17页
第17页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第18页
第18页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第19页
第19页 / 共44页
用数据库设计影院售票管理系统Word文件下载.docx_第20页
第20页 / 共44页
亲,该文档总共44页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

用数据库设计影院售票管理系统Word文件下载.docx

《用数据库设计影院售票管理系统Word文件下载.docx》由会员分享,可在线阅读,更多相关《用数据库设计影院售票管理系统Word文件下载.docx(44页珍藏版)》请在冰点文库上搜索。

用数据库设计影院售票管理系统Word文件下载.docx

表1影库管理表---MOVIES

字段名称

数据类型

字段属性

字段大小

作用

必填字段

索引

是否主键

Movie_id

smallint

2

电影号

有(无重复)

Movie_name

Nvarchar

50

电影名称

actor

导演

actress

主演

producer

25

制片厂

palydate

datetime

8

上映时间

表2电影院座位管理表---SEATS

seatid

座位号

price

float

票价

soldornot

是否售出

表3电影票信息表---TICKETS

ticketsid

电影票号

电影名

价格

yanzhengma

验证码

表4职工信息表---WORKERS

workerid

职工号

password

职工密码

leibie

职工类型

根据规范化的设计理念,本管理系统的数据分成上面4个表,减少了数据的冗余,同时在这些表之间又存在着一些关联关系。

这四个表之间的这两种关系表现在下图所示的关系:

2.创建登陆窗体模块;

(1)窗体模块的功能

登陆窗体

(2)窗体界面的设计

在工程中添加一个窗体,命名为“登陆系统”,用来作为系统登陆窗体。

界面

的设计如图3所示。

(3)窗体代码

ImportsSystem.Data.SqlClient

PublicClassForm1

InheritsSystem.Windows.Forms.Form

DimnavigatorAsBindingManagerBase'

用来对记录导航

DimmyconAsNewSqlConnection'

连接对象

DimmycomAsNewSqlCommand'

命令对象

Dimmycom1AsNewSqlCommand

Dimfrm2AsNewForm2

Dimfrm3AsNewForm3

Dimfrm8AsNewForm8

PrivateSubTimer1_Tick(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesTimer1.Tick

StatusBar1.Panels(0).Text=DateTime.Today

StatusBar1.Panels

(1).Text=DateTime.Now.ToString("

T"

EndSub

PrivateSubGroupBox1_Enter(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesGroupBox1.Enter

IfRadioButton1.Checked=TrueThen

RadioButton2.Checked=False

RadioButton3.Checked=False

ElseIfRadioButton2.Checked=TrueThen

RadioButton1.Checked=False

ElseIfRadioButton3.Checked=TrueThen

EndIf

PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click

AxShockwaveFlash1.Movie="

E:

\实验运行场\VB.NET程序设计\电影院票务系统\image\登陆界面1.swf"

AxShockwaveFlash1.Playing=False

AxShockwaveFlash1.Stop()

Dimtox1AsInt32

Dimtox2AsInt32

DimmydataadapterAsNewSqlDataAdapter

DimmydsAsNewDataSet

DimiAsInteger

DimjAsInteger

tox1=Val(TextBox1.Text)

tox2=Val(TextBox2.Text)

mycon.ConnectionString="

initialcatalog=ticketbooking;

userid=sa;

password=;

"

mycom.Connection=mycon'

通过MYCON连接对象操作数据库

mycom.CommandType=CommandType.Text'

设置命令类型

mycom.CommandText="

select*fromworkers"

'

设置要执行的命令

Try

mycon.Open()

mydataadapter.SelectCommand=mycom

CatchexAsException

MessageBox.Show("

连接失败"

Finally

mycon.Close()

EndTry

mydataadapter.Fill(myds,"

workers"

Fori=0Tomyds.Tables("

).Rows.Count-1

Iftox1=Val(myds.Tables("

).Rows(i).ItemArray(0))Then

j=0

ExitFor

Else

j=1

Next

Iftox2=Val(myds.Tables("

).Rows(i).ItemArray

(1))Then

Ifj=1Then

您的工号或者密码错误"

"

错误提示"

MessageBoxButtons.OK,MessageBoxIcon.Warning)

mycom1.Connection=mycon'

mycom1.CommandType=CommandType.Text'

mycom1.CommandText="

selectleibiefromworkerswhereworkerid="

+CStr(tox1)+"

andpassword="

+CStr(tox2)+"

Dimmydataadapter1AsNewSqlDataAdapter

mydataadapter1.SelectCommand=mycom1

Dimmyds1AsNewDataSet

mydataadapter1.Fill(myds1,"

IfRadioButton1.Checked=TrueAndVal(myds1.Tables("

).Rows(0)("

leibie"

))=1Then

frm2.Show()

Me.Hide()

ElseIfRadioButton2.Checked=TrueAndVal(myds1.Tables("

))=2Then

frm3.Show()

ElseIfRadioButton3.Checked=TrueAndVal(myds1.Tables("

))=3Then

frm8.Show()

您超出职责范围或未选择服务系统,请重新输入!

MessageBoxButtons.OK,MessageBoxIcon.Warning,MessageBoxDefaultButton.Button1)

PrivateSubForm1_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

AxShockwaveFlash1.Play()

PrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.Click

DimexitformAsNewForm7

Ifexitform.ShowDialog=DialogResult.OKThen

exitform.Close()

Me.Close()

Application.Exit()

EndClass

3.创建售票窗体模块

(1)窗体模块的功能

为观众提供买票服务。

在界面上观众可以看见座位的情况,根据此来选择自己喜欢的座位。

不同的座位有不同的价格。

此窗体还有退票功能。

(2)窗体界面的设计

在工程中添加一个窗体,命名为“售票系统”,用来作为仓管人员窗体。

的设计如下图所示。

(3)代码编写

PublicClassForm2

命令对象

PrivateSubForm2_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

Me.Show()

\实验运行场\VB.NET程序设计\电影院票务系统\image\销售界面.swf"

AxShockwaveFlash2.Movie="

\实验运行场\VB.NET程序设计\电影院票务系统\image\检票界面下.swf"

AxShockwaveFlash2.Play()

DimstrrowAsString

DimdtAsNewDataTable

select*fromMovies"

设置要执行的命令"

Movies"

strrow=myds.Tables("

).Rows(i)("

movie_name"

ComboBox1.Items.Add(strrow)

MessageBox.Show(ex.ToString)

PrivateSubButton1_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click

DimtickethaoAsInteger

DimmoviehaoAsInteger

DimsuijiAsInteger

Dimmydataadapter3AsNewSqlDataAdapter

Dimmyds3AsNewDataSet

Dimdt3AsNewDataTable

Dimmycom3AsNewSqlCommand

Dimmycon3AsNewSqlConnection

Randomize()

suiji=Int(9000*Rnd()+1000)

tickethao=tickets_id()

moviehao=movieid()

mycon3.ConnectionString="

mycom3.Connection=mycon3'

mycom3.CommandType=CommandType.Text'

设置命令类型

Iftickethao=0Then

此座位已售出,请重新选择!

错误"

ComboBox1.Text="

TextBox1.Text="

TextBox2.Text="

TextBox3.Text="

TextBox4.Text="

TextBox5.Text="

mycon3.Open()

mycom3.CommandText="

insertintotickets(ticketsid,seatid,movie_id,movie_name,palydate,price,yanzhengma)values("

+CStr(tickethao)+"

"

+TextBox4.Text+"

+CStr(moviehao)+"

'

+TextBox2.Text+"

'

+TextBox1.Text+"

+TextBox5.Text+"

+CStr(suiji)+"

)"

DimsqlAsString

sql="

+TextBox3.Text+"

mydataadapter3.InsertCommand=mycom3

mycom3.ExecuteNonQuery()

售票成功!

谢谢观看"

MsgBox(ex.ToString)

mycon3.Close()

revoke_seat()

PrivateSubComboBox1_SelectedIndexChanged_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesComboBox1.SelectedIndexChanged

Dimmydataadapter11AsNewSqlDataAdapter

Dimmyds11AsNewDataSet

Dimdt1AsNewDataTable

Dimdt11AsNewDataTable

Dimmycom11AsNewSqlCommand

mycom11.Connection=mycon

mycom11.CommandType=CommandType.Text

mycom11.CommandText="

selectpalydatefromMovieswheremovie_name='

+ComboBox1.Text+"

mycom1.

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

当前位置:首页 > 初中教育 > 语文

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2