用数据库设计影院售票管理系统_第1页
用数据库设计影院售票管理系统_第2页
用数据库设计影院售票管理系统_第3页
用数据库设计影院售票管理系统_第4页
用数据库设计影院售票管理系统_第5页
已阅读5页,还剩35页未读 继续免费阅读

下载本文档

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

文档简介

用数据库设计影院售票治理系统用数据库设计影院售票治理系统10/26一.系统概述;1.设计需求;很多人宠爱到电影院去看电影。由于家里的气氛到底不如影院好。所以,现代家庭影院的消灭并不会让电影院没有生路。每个社会效劳系统都有自己的一套治理机制。固然,电影院也不除外。其实电影院的治理系统应当来说比其他的社会效劳系统的治理要简洁一点。电影院不外乎是引进电影,制定播放影片的时间表,买票,检票进场观看,还有就是一些数据治理方面的事。如工作人员治理,票务治理等等。为了工作机制简洁有序,必定要引进一套治理系统。需求分析;具体而言,影院售票系统需要实现以下的需求:能够对播放电影,工作人员,售票事宜,检票事宜,无用数据进展处理。售票治理自然有专人负责,要处理各电影的电影票销售问题。固然包括退票问题,还有就是预订电影票其实也就相当于买票。两者可以当一回事处理。检票治理事宜要完成观众进场时检票的事宜。其中包括了电影票的真假检测问题。电影座位电影座位电影号上映时间座位编号是否售出电影名称导演主演生产地座位票价电影票电影票验证码价格电影号电影名座位号上映时间电影票号职工信息职工类型职工号职工密码字段属性三.设计说明字段属性MicrosoftSQLSever2023作为后台的数据库治理系统。本治理系统是应用于电影院中,而且需要和数据库之间进展频繁数据交换,所以承受MicrosoftSQLSever2023作为后台的数据库治理系统。在本治理系统中,需要把握影库充实信息,职工治理信息,票务治理信息,此外,由于要进展职工治理,还需要把握使用本系统的职工。表1存储硬库信息列表,表2存储了电影院座位的相关数据连接关系,表34存储了系统使用者职工的相关状况的治理列表。字段属性表1 影库治理表---MOVIES字段属性字段名称数据类型字段大小 作用 必填 索引是否主字段键Movie_idsmallint2 电影号 是 有〔无重复〕是Movie_nameNvarchar50 电影名称 是 无actorNvarchar50 导演 否 无actressNvarchar50 主演 否 无producerNvarchar25 制片厂 否 无palydatedatetime8 上映时间 是 无表2 电影院座位治理表---SEATS字段名称字段名称数据类型字段大小作用字段属性必填字段索引是否主键seatidpricesoldornotsmallintfloatsmallint282座位号票价是否售出是是是有〔无重复〕无无是表3 电影票信息表---TICKETS字段名称数据类型字段大小作用必填索引是否主键字段ticketsidsmallint2电影票号是有〔无重复〕是seatidsmallint2座位号是有Movie_idsmallint2电影号是有Movie_nameNvarchar50电影名否无palydatedatetime8上映时间是无pricefloat8价格是无yanzhengmasmallint2验证码是无是字段名称workeridpassword字段名称workeridpasswordleibie数据类型smallintsmallintsmallint字段大小222作用职工号职工密码职工类型字段属性必填字段是是是索引无无无是否主键是依据标准化的设计理念,本治理系统的数据分成上面4个表,削减了数据的冗余,同时系:2.创立登陆窗体模块;窗体模块的功能登陆窗体窗体界面的设计在工程中添加一个窗体,命名为“登陆系统”,用来作为系统登陆窗体。界面3窗体代码ImportsSystem.Data.SqlClientPublicClassForm1InheritsSystem.Windows.Forms.FormDimnavigatorAsBindingManagerBase 录导航DimmyconAsNewSqlConnection ”连接对象DimmycomAsNewSqlCommand Dimmycom1AsNewSqlCommandDimfrm2AsNewForm2Dimfrm3AsNewForm3Dimfrm8AsNewForm8PrivateSubTimer1_Tick(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesTimer1.TickStatusBar1.Panels(0).Text=DateTime.TodayStatusBar1.Panels(1).Text=DateTime.Now.ToString(“T“)EndSubPrivateSubGroupBox1_Enter(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesGroupBox1.EnterIfRadioButton1.Checked=TrueThenRadioButton2.Checked=FalseRadioButton3.Checked=FalseElseIfRadioButton2.Checked=TrueThenRadioButton1.Checked=FalseRadioButton3.Checked=FalseElseIfRadioButton3.Checked=TrueThenRadioButton1.Checked=FalseRadioButton2.Checked=FalseEndIfEndSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickAxShockwaveFlash1.Movie“E:\试验运行场\VB.NET程序设计\电影院票务系统\image\登陆界面1.swf“

AxShockwaveFlash1.Playing=FalseAxShockwaveFlash1.StopDimtox1AsInt32Dimtox2AsInt32DimmydataadapterAsNewSqlDataAdapterDimmydsAsNewDataSetDimiAsIntegerDimjAsIntegertox1=Val(TextBox1.Text)tox2=Val(TextBox2.Text)mycon.ConnectionString=“initialcatalog=ticketbooking;userid=sa;password=;“mycom.Connection=mycon ”通过MYCON连接对象操作数据库mycommandType=CommandType.Text ”设置命令类型mycommandText=“select*fromworkers“ Trymycon.Openmydataadapter.SelectCommand=mycomCatchexAsExceptionMessageBox.Show(“连接失败“)Finallymycon.CloseEndTrymydataadapter.Fill(myds,“workers“)Fori=0Tomyds.Tables(“workers“).Rows.Count-1Iftox1=Val(myds.Tables(“workers“).Rows(i).ItemArray(0))Thenj=0ExitForElsej=1EndIfNextFori=0Tomyds.Tables(“workers“).Rows.Count-1Iftox2=Val(myds.Tables(“workers“).Rows(i).ItemArray(1))Thenj=0ExitForElsej=1EndIfNextIfj=1ThenMessageBox.Show(MessageBoxButtons.OK,MessageBoxIcon.Warning)ElseTrymycom1.Connection=mycon ”通过MYCON连接对象操作数据库mycom1mandType=CommandType.Text ”设置命令类型mycom1mandText=“selectleibiefromworkerswhereworkerid=“+CStr(tox1)“andpassword=“+CStr(tox2)+““”设置要执行的命令Dimmydataadapter1AsNewSqlDataAdaptermydataadapter1.SelectCommand=mycom1Dimmyds1AsNewDataSetmydataadapter1.Fill(myds1,“workers“)IfRadioButton1.Checked=TrueAndVal(myds1.Tables(“workers“).Rows(0)(“leibie“))=1Thenfrm2.ShowMe.HideElseIfRadioButton2.Checked=TrueAndVal(myds1.Tables(“workers“).Rows(0)(“leibie“))=2Thenfrm3.ShowMe.HideElseIfRadioButton3.Checked=TrueAndVal(myds1.Tables(“workers“).Rows(0)(“leibie“))=3Thenfrm8.ShowMe.HideElseMessageBox.Show(示“,MessageBoxButtons.OK,MessageBoxIcon.Warning,MessageBoxDefaultButton.Button1)EndIfCatchexAsExceptionEndTryEndIfEndSubByValeAsSystem.EventArgs)HandlesMyBase.LoadAxShockwaveFlash1.Movie“E:\试验运行场\VB.NET程序设计\电影院票务系统\image\登陆界面1.swf“AxShockwaveFlash1.PlayEndSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickDimexitformAsNewForm7Ifexitform.ShowDialog=DialogResult.OKThenexitform.CloseMe.CloseApplication.ExitEndIfEndSubEndClass创立售票窗体模块窗体模块的功能为观众供给买票效劳。在界面上观众可以观看座位的状况,依据此来选择自己宠爱的座位。不同的座位有不同的价格。此窗体还有退票功能。窗体界面的设计在工程中添加一个窗体,命名为“售票系统”,用来作为仓管人员窗体。界面的设计如以以下图所示。代码编写ImportsSystem.Data.SqlClientPublicClassForm2InheritsSystem.Windows.Forms.FormDimnavigatorAsBindingManagerBase 录导航DimmyconAsNewSqlConnection ”连接对象DimmycomAsNewSqlCommand PrivateSubForm2_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load”Me.ShowAxShockwaveFlash1.Movie=“E:\试验运行场\VB.NET程序设计\电影院票务系统\image\销售界面.swf“下.swf“

AxShockwaveFlash1.Play“E:\试验运行场\VB.NET程序设计\电影院票务系统\image\检票界面AxShockwaveFlash2.PlayDimmydataadapterAsNewSqlDataAdapterDimmydsAsNewDataSetDimiAsIntegerDimjAsIntegerDimstrrowAsStringDimdtAsNewDataTablemycon.ConnectionString=“initialcatalog=ticketbooking;userid=sa;password=;“mycom.Connection=mycon ”通过MYCON连接对象操作数据库mycommandType=CommandType.Text ”设置命令类型mycommandText=“select*fromMovies“ Trymycon.Openmydataadapter.SelectCommand=mycommydataadapter.Fill(myds,“Movies“)CatchexAsExceptionMessageBox.Show(“连接失败“)Finallymycon.CloseEndTryTryFori=0Tomyds.Tables(“Movies“).Rows.Count-1strrow=myds.Tables(“Movies“).Rows(i)(“movie_name“)ComboBox1.Items.Add(strrow)NextCatchexAsExceptionMessageBox.Show(ex.ToString)EndTryEndSubPrivateSubButton1_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimiAsIntegerDimtickethaoAsIntegerDimmoviehaoAsIntegerDimsuijiAsIntegerDimmydataadapter3AsNewSqlDataAdapterDimmyds3AsNewDataSetDimdt3AsNewDataTableDimmycom3AsNewSqlCommandDimmycon3AsNewSqlConnectionRandomizesuiji=Int(9000*Rnd+1000)Trytickethao=tickets_idmoviehao=movieidmycon3.ConnectionString=“initialcatalog=ticketbooking;userid=sa;password=;“mycom3.Connection=mycon3 ”通过MYCON连接对象操作数据库mycom3mandType=CommandType.Text ”设置命令类型CatchexAsExceptionMessageBox.Show(ex.ToString)EndTryIftickethao=0ThenTryMessageBox.Show(ComboBox1.Text=““TextBox1.Text=““TextBox2.Text=““TextBox3.Text=““TextBox4.Text=““TextBox5.Text=““CatchexAsExceptionMessageBox.Show(ex.ToString)EndTryElseTrymycon3.Openmycom3mandText=“insertintoticketsvalues(“+CStr(tickethao)+“,“+TextBox4.Text+“,“+CStr(moviehao)+“,”“+TextBox2.Text+“”,”“+TextBox1.Text+“”,“+TextBox5.Text+“,“+CStr(suiji)+“)“DimsqlAsStringsql=“insertintoticketsvalues(“+CStr(tickethao)+“,“+TextBox4.Text+“,“+CStr(moviehao)+“,”“+TextBox2.Text+“”,”“+TextBox3.Text+“”,“+TextBox5.Text+“,“+CStr(suiji)+“)“mydataadapter3.InsertCommand=mycom3Trymycom3.ExecuteNonQueryMessageBox.Show(CatchexAsExceptionMsgBox(ex.ToString)EndTryCatchexAsExceptionMessageBox.Show(ex.ToString)EndTrymycon3.CloseComboBox1.Text=““TextBox1.Text=““TextBox2.Text=““TextBox3.Text=““TextBox4.Text=““TextBox5.Text=““EndIfrevoke_seatEndSubPrivateSubComboBox1_SelectedIndexChanged_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesComboBox1.SelectedIndexChangedrevoke_seatDimmydataadapter1AsNewSqlDataAdapterDimmydataadapter11AsNewSqlDataAdapterDimmyds1AsNewDataSetDimmyds11AsNewDataSetDimdt1AsNewDataTableDimdt11AsNewDataTableDimmycom1AsNewSqlCommandDimmycom11AsNewSqlCommandmycon.ConnectionString=“initialcatalog=ticketbooking;userid=sa;password=;“mycom1.Connection=mycon ”通过MYCON连接对象操作数据库mycom1mandType=CommandType.Text ”设置命令类型mycom11.Connection=myconmycom11mandType=CommandType.TextTrymycon.Openmycom11mandText=“selectpalydatefromMovieswhere movie_name=”“+ComboBox1.Text+“”“mycom1mandText=“select*fromticketswheremovie_name=”“+ComboBox1.Text+“”“

mydataadapter1.SelectCommand=mycom1mydataadapter11.SelectCommand=mycom11mydataadapter1.Fill(myds1,“tickets“)mydataadapter11.Fill(myds11,“Movies“)dt1=myds1.Tables(“tickets“)dt11=myds11.Tables(“Movies“)CatchexAsExceptionMessageBox.Show(ex.ToString)EndTryTryIfdt1.Rows.Count=0ThenMessageBox.Show(“还未出售!“)TextBox1.Text=dt11.Rows(0)(“palydate“)revoke_seatElseShowSellInfo(dt1)TextBox1.Text=dt11.Rows(0)(“palydate“)EndIfCatchexAsExceptionEndTrymycon.CloseEndSubPrivateSubButton2_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickDimtickethaoAsIntegerDimmydataadapter4AsNewSqlDataAdapterDimmyds4AsNewDataSetDimdt4AsNewDataTableDimmycom4AsNewSqlCommandDimmycon4AsNewSqlConnectionTrymycon4.ConnectionString=“initialcatalog=ticketbooking;userid=sa;password=;“mycom4.Connection=mycon4 ”通过MYCON连接对象操作数据库mycom4mandType=CommandType.Text ”设置命令类型tickethao=tuipiaoCatchexAsExceptionMessageBox.Show(ex.ToString)EndTryIftickethao=0ThenMessageBox.Show(ElseTry+““

mycon4.Openmycom4mandText=“deletefromticketswhereticketsid=“+CStr(tickethao)Trymycom4.ExecuteNonQueryMessageBox.Show(CatchexAsExceptionMsgBox(ex.ToString)EndTryCatchexAsExceptionMsgBox(ex.ToString)EndTryEndIfmycon4.CloseTextBox1.Text=““TextBox2.Text=““TextBox3.Text=““TextBox4.Text=““TextBox5.Text=““ComboBox1.Text=““revoke_seatEndSubPrivateSubButton3_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickTextBox2.Text=ComboBox1.TextTextBox3.Text=TextBox1.TextIfTextBox4.Text=““ThenMessageBox.Show(EndIDimmydataadapter2AsNewSqlDataAdapterDimmyds2AsNewDataSetDimdt2AsNewDataTableDimmycom2AsNewSqlCommandmycon.ConnectionString=“initialcatalog=ticketbooking;userid=sa;password=;“mycom2.Connection=mycon ”通过MYCON连接对象操作数据库mycom2mandType=CommandType.Text ”设置命令类型Trymycon.Openmycom2mandText=“select*fromseatswhereseatid=“+TextBox4.Text+““mydataadapter2.SelectCommand=mycom2mydataadapter2.Fill(myds2,“seats“)dt2=myds2.Tables(“seats“)CatchexAsExceptionMessageBox.Show(ex.ToString)EndTryTextBox5.Text=dt2.Rows(0)(“price“)mycon.CloseEndSubButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton4.ClickDimexitformAsNewForm7Ifexitform.ShowDialog=DialogResult.OKThenexitform.CloseMe.CloseApplication.ExitEndIfEndSubEndClass创立检票界面创立模块的功能对进场观众检票,假设觉察有假票或无票观众不允许入内。创立模块的窗体在工程中添加一个窗体,命名为“检票系统”,用来作为检票系统窗体。界面的设计如以以下图所示。代码编写ImportsSystem.Data.SqlClientPublicClassForm3InheritsSystem.Windows.Forms.FormDimds1AsNewDataSetDimsqlda1AsNewSqlDataAdapterDimRecordCountAsIntegerPrivateSubForm3_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadAxShockwaveFlash1.Movie=“E:\试验运行场\VB.NET程序设计\电影院票务系统\image\检票界面.swf“下.swf“

AxShockwaveFlash1.Play“E:\试验运行场\VB.NET程序设计\电影院票务系统\image\检票界面AxShockwaveFlash2.PlayDimsqlcmd1AsNewSqlCommandDimstr1AsString=“select*fromtickets“sqlcmd1.Connection=sqlcn1sqlcmd1mandText=str1sqlda1.SelectCommand=sqlcmd1Trysqlcn1.Opensqlcmd1.ExecuteNonQueryCatchexAsSqlExceptionMsgBox(ex.Message)Finallysqlcn1.CloseEndTryTrysqlda1.Fill(ds1)CatchexAsSqlExceptionMsgBox(ex.Message)EndTryRecordCount=ds1.Tables(0).Rows.CountTextBox6.Text=RecordCountEndSubPrivateSubButton1_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimiAsIntegerDimflagAsBoolean=FalseIfTextBox1.Text=““ThenTextBox7.TextTextBox1.FocusExitSubEndIfIfTextBox2.Text=““ThenTextBox7.TextTextBox2.FocusExitSubEndIfFori=0ToRecordCount-1IfTextBox1.Text=CStr(ds1.Tables(0).Rows(i)(“ticketsid“))AndTextBox2.Text=CStr(ds1.Tables(0).Rows(i)(“yanzhengma“))Thenflag=TrueExitForEndIfNextIfflag=TrueThenTryTextBox3.Text=ds1.Tables(0).Rows(i)(“seatid“)TextBox4.Text=ds1.Tables(0).Rows(i)(“movie_name“)TextBox5.Text=ds1.Tables(0).Rows(i)(“price“)CatchexAsExceptionMsgBox(ex.Message)EndTryTextBox7.TextElseTextBox7.TextEndIfTextBox6.Text=RecordCountEndSubPrivateSubButton2_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickTextBox1.Text=““TextBox2.Text=““TextBox3.Text=““TextBox4.Text=““TextBox5.Text=““TextBox6.Text=““TextBox7.Text=““TextBox1.FocusEndSubPrivateSubButton3_Click_1(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickDimexitformAsNewForm7Ifexitform.ShowDialog=DialogResult.OKThenexitform.CloseMe.CloseApplication.ExitEndIfEndSubEndClass创立维护界面创立模块的功能给数据库维护工作人员选择维护的系统数据库创立模块的设计在工程中添加一个窗体,命名为“维护系统”,用来作为维护系统窗体。界面的设计如以以下图所示。代码编写PublicClassForm8InheritsSystem.Windows.Forms.FormPrivateSubForm8_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadAxShockwaveFlash1.Movie=“E:\试验运行场\VB.NET程序设计\电影院票务系统\image\登陆界面.swf“AxShockwaveFlash1.PlayEndSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickDimfrm4AsNewForm4frm4.ShowMe.HideEndSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickDimfrm6AsNewForm6frm6.ShowMe.HideEndSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickDimfrm9AsNewForm9frm9.ShowMe.HideEndSubButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton4.ClickDimexitformAsNewForm7Ifexitform.ShowDialog=DialogResult.OKThenexitform.CloseMe.CloseApplication.ExitEndIfEndSubEndClass创立影库界面创立模块的功能对电影库播放列表的治理创立模块的设计在工程中添加一个窗体,命名为“影库系统”,用来作为影库系统窗体。界面的设计如以以下图所示。代码编写DimsqlAdapterAsNewSqlDataAdapterDimmovieRowAsDataRowDimRecordCountAsIntegerDimiAsInteger=0Dimidnum(2023)AsIntegerDimCurrentPositionAsIntegerSubShowPositionRecordCount=DataSet11.Movies.Rows.CountIfRecordCount=0ThenTextBox1.TextElseCurrentPosition=Me.BindingContext(DataSet11,“Movies“).PositionmovieRow=DataSet11.Movies.Rows(CurrentPosition)TextBox1.Text=movieRow.Item(“movie_id“)idnum(i)=TextBox1.Texti+=1TextBox2.Text=movieRow.Item(“movie_name“)TextBox3.Text=movieRow.Item(“actor“)TextBox4.Text=movieRow.Item(“actress“)TextBox5.Text=movieRow.Item(“producer“)TextBox6.Text=movieRow.Item(“palydate“)TextBox7.Text=CurrentPosition+1&“/“&RecordCountEndIfEndSubByValeAsSystem.EventArgs)HandlesMyBase.LoadDataSet11.ClearMe.SqlDataAdapter1.Fill(DataSet11)ShowPositionEndSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfMe.BindingContext(DataSet11,“Movies“).Position>0ThenMe.BindingContext(DataSet11,“Movies“).Position-=1ShowPositionElseMessageBox.Show(EndIfEndSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickIfMe.BindingContext(DataSet11,“Movies“).Position<RecordCount-1ThenMe.BindingContext(DataSet11,“Movies“).Position+=1ShowPositionElseMessageBox.Show(EndIfEndSubButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton4.ClickMe.BindingContext(DataSet11,“Movies“).Position=RecordCount-1ShowPositionEndSubButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton5.Click”添加数据DimjAsIntegerDimflagAsBoolean=TrueForj=0ToiIfTextBox1.Text=CStr(idnum(j))Thenflag=FalseMessageBox.Show(“IDEndIfNextIfflag=TrueThenDimMyNewDataAsDataRowMyNewData=DataSet11.Movies.NewRowTryWithMyNewData.BeginEditIfTextBox1.Text<>““Then.Item(“movie_id“)=TextBox1.TextElseMessageBox.Show(“编号不能为空“)ReturnEndIf.Item(“movie_name“)=TextBox2.Text.Item(“actor“)=TextBox3.Text.Item(“actress“)=TextBox4.Text.Item(“producer“)=TextBox5.Text.Item(“palydate“)=TextBox6.Text.EndEditEndWithCatchexAsExceptionMessageBox.Show(ex.Message)ReturnEndTryDataSet11.Movies.Rows.Add(MyNewData)TryDimiAsInteger=SqlDataAdapter1.Update(DataSet11,“Movies“)DataSet11.AcceptChangesMessageBox.Show(i&“条记录添加成功!“)CatchexAsExceptionMessageBox.Show(ex.Message)EndTryidnum(i)=TextBox1.Texti=i+1EndIfEndSubButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton6.Click”修改数据DimjAsIntegerForj=0ToiIfTextBox1.Text=CStr(idnum(j))ThenMessageBox.Show(“IDEndIfNextCurrentPosition=Me.BindingContext(DataSet11,“Movies“).PositionmovieRow=DataSet11.Movies.Rows(CurrentPosition)TryWithmovieRow.BeginEdit.Item(“movie_id“)=TextBox1.Text.Item(“movie_name“)=TextBox2.Text.Item(“actor“)=TextBox3.Text.Item(“actress“)=TextBox4.Text.Item(“producer“)=TextBox5.Text.Item(“palydate“)=TextBox6.Text.EndEditEndWithCatchexAsExceptionMessageBox.Show(ex.Message)ReturnEndTryTryDimiAsInteger=SqlDataAdapter1.Update(DataSet11,“Movies“)DataSet11.AcceptChangesMessageBox.Show(i&CatchexAsExceptionMessageBox.Show(ex.Message)EndTryEndSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickMe.BindingContext(DataSet11,“Movies“).Position=0ShowPositionEndSubButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton7.Click”删除数据CurrentPosition=Me.BindingContext(DataSet11,“Movies“).PositionmovieRow=DataSet11.Movies.Rows(CurrentPosition)DimnAsInteger=movieRow.Item(“movie_id“)DimjAsInteger=0Forj=0ToiIfn=idnum(j)Thenidnum(j)=-1EndIfNextmovieRow.DeleteTryDimiAsInteger=SqlDataAdapter1.Update(DataSet11,“Movies“)DataSet11.AcceptChangesMessageBox.Show(i&CatchexAsExceptionMessageBox.Show(ex.Message)EndTryEndSubButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton8.ClickDimexitformAsNewForm7Ifexitform.ShowDialog=DialogResult.OKThenexitform.CloseMe.CloseApplication.ExitEndIfEndSubButton9_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton9.ClickDimfrm8AsNewForm8frm8.ShowMe.CloseEndSubEndClass创立职工界面创立模块的功能对职工数据的处理。如增加、删除和更改创立模块的设计在工程中添加一个窗体,命名为“影库系统”,用来作为影库系统窗体。界面的设计如以以下图所示。代码编写InheritsSystem.Windows.Forms.FormDimfrm8AsNewForm8DimsqlAdapterAsNewSqlDataAdapterDimmovieRowAsDataRowDimRecordCountAsIntegerDimiAsInteger=0Dimidnum(2023)AsIntegerDimCurrentPositionAsIntegerSubShowPositionRecordCount=DataSet11.Workers.Rows.CountIfRecordCount=0ThenTextBox1.TextElseCurrentPosition=Me.BindingContext(DataSet11,“Workers“).PositionmovieRow=DataSet11.Workers.Rows(CurrentPosition)TextBox1.Text=movieRow.Item(“workerid“)idnum(i)=TextBox1.Texti+=1TextBox2.Text=movieRow.Item(“password“)TextBox3.Text=movieRow.Item(“leibie“)TextBox4.Text=CurrentPosition+1&“/“&RecordCountEndIfEndSubSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadDataSet11.ClearMe.SqlDataAdapter1.Fill(DataSet11)ShowPositionEndSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.ClickIfMe.BindingContext(DataSet11,“Workers“).Position>0ThenMe.BindingContext(DataSet11,“Workers“).Position-=1ShowPositionElseMessageBox.Show(EndIfEndSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickIfMe.BindingContext(DataSet11,“Workers“).Position<RecordCount-1ThenMe.BindingContext(DataSet11,“Workers“).Position+=1ShowPositionElseMessageBox.Show(EndIfEndSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.ClickMe.BindingContext(DataSet11,“Workers“).Position=0ShowPositionEndSubButton4_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton4.ClickMe.BindingContext(DataSet11,“Workers“).Position=RecordCount-1ShowPositionEndSubButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton5.ClickDimjAsIntegerDimflagAsBoolean=TrueForj=0ToiIfTextBox1.Text=CStr(idnum(j))Thenflag=FalseMessageBox.Show(“IDEndIfNextIfTextBox3.Text<>1AndTextBox3.Text<>2AndTextBox3.Text<>3Thenflag=FalseMessageBox.Show(“效劳系统号只能为1,2,3EndIfIfflag=TrueThenDimMyNewDataAsDataRowMyNewData=DataSet11.Workers.NewRowTryWithMyNewData.BeginEditIfTextBox1.Text<>““Then.Item(“workerid“)=TextBox1.TextElseMessageBox.Show(“编号不能为空“)ReturnEndIf.Item(“password“)=TextBox2.Text.Item(“leibie“)=TextBox3.Text.EndEditEndWithCatchexAsExceptionMessageBox.Show(ex.Message)ReturnEndTryDataSet11.Workers.Rows.Add(MyNewData)TryDimkAsInteger=SqlDataAdapter1.Update(DataSet11,“Workers“)DataSet11.AcceptChangesMessageBox.Show(k&CatchexAsExceptionMessageBox.Show(ex.Message)EndTryidnum(i)=TextBox1.Texti=i+1EndIfEndSubButton6_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton6.ClickDimjAsIntegerForj=0ToiIfTextBox1.Text=CStr(idnum(j))ThenMessageBox.Show(“IDEndIfNextIfTextBox3.Text<>1AndTextBox3.Text<>2AndTextBox3.Text<>3ThenMessageBox.Show(“效劳系统号只能为1,2,3!“,“提示“)EndIfCurrentPosition=Me.BindingContext(DataSet11,“Workers“).PositionmovieRow=DataSet11.Workers.Rows(CurrentPosition)TryWithmovieRow.BeginEdit.Item(“workerid“)=TextBox1.Text.Item(“password“)=TextBox2.Text.Item(“leibie“)=TextBox3.Text.EndEditEndWithCatchexAsExceptionMessageBox.Show(ex.Message)ReturnEndTryTryDimkAsInteger=SqlDataAdapter1.Update(DataSet11,“Workers“)DataSet11.AcceptChangesMessageBox.Show(k&CatchexAsExceptionMessageBox.Show(ex.Message)EndTryEndSubButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton7.ClickCurrentPosition=Me.BindingContext(DataSet11,“Workers“).PositionmovieRow=DataSet11.Workers.Rows(CurrentPosition)DimnAsInteger=movieRow.Item(“workerid“)DimjAsInteger=0Forj=0ToiIfn=idnum(j)Thenidnum(j)=-1EndIfNextmovieRow.DeleteTryDimkAsInteger=SqlDataAdapter1.Update(DataSet11,“Workers“)DataSet11.AcceptChangesMessageBox.Show(k&CatchexAsExceptionMessageBox.Show(ex.Message)EndTryEndSubButton8_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton8.ClickDimexitformAsNewForm7Ifexitform.ShowDialog=DialogResult.OKThenexitform.CloseMe.CloseApplication.ExitEndIffrm8.CloseEndSubButton9_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton9.ClickMe.Closefrm8.ShowEndSubEndClass创立票务界面创立模块的功能对所售出的电影票进展治理,把没用的数据进展去除创立模块的设计在工程中添加一个窗体,命名为“影库系统”,用来作为影库系统窗体。界面的设计如以以下图所示。代码编写ImportsSystem.Data.SqlClientPublicClassForm9InheritsSystem.Window

温馨提示

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

评论

0/150

提交评论