用大數(shù)據(jù)庫設(shè)計(jì)影院售票管理系統(tǒng)_第1頁
用大數(shù)據(jù)庫設(shè)計(jì)影院售票管理系統(tǒng)_第2頁
用大數(shù)據(jù)庫設(shè)計(jì)影院售票管理系統(tǒng)_第3頁
已閱讀5頁,還剩27頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、.系統(tǒng)概述;1. 設(shè)計(jì)需求;現(xiàn)在中國大部分的家庭都喜歡在家里置辦屬于自己風(fēng)格的家庭影院。但是,仍然有很多人喜歡到電影院去看電影。因?yàn)榧依锏臍夥债吘共蝗缬霸汉?。所以,現(xiàn)代家庭影院 的出現(xiàn)并不會(huì)讓電影院沒有生路。每個(gè)社會(huì)服務(wù)系統(tǒng)都有自己的一套管理機(jī)制。當(dāng)然,電影院也不除外。其實(shí)電影院 的管理系統(tǒng)應(yīng)該來說比其他的社會(huì)服務(wù)系統(tǒng)的管理要簡單一點(diǎn)。電影院不外乎是引進(jìn)電 影,制定播放影片的時(shí)間表,買票,檢票進(jìn)場觀看,還有就是一些數(shù)據(jù)管理方面的事。如 工作人員管理,票務(wù)管理等等。為了工作機(jī)制簡單有序,必然要引進(jìn)一套管理系統(tǒng)。2. 需求分析;具體而言,影院售票系統(tǒng)需要實(shí)現(xiàn)以下的需求:(1) 能夠?qū)Σシ烹娪?,工?/p>

2、人員,售票事宜,檢票事宜,無用數(shù)據(jù)進(jìn)行處理。(2) 售票管理自然有專人負(fù)責(zé),要處理各電影的電影票銷售問題。當(dāng)然包括退票問題, 還有就是預(yù)訂電影票其實(shí)也就相當(dāng)于買票。兩者可以當(dāng)一回事處理。(3) 檢票管理事宜要完成觀眾進(jìn)場時(shí)檢票的事宜。其中包括了電影票的真假檢測問題。(4) 數(shù)據(jù)管理要處理電影的播放的次序,工作人員的管理, 以及過期電影票的處理問題。二.結(jié)構(gòu)設(shè)計(jì)電影座位電影票職工信息三.設(shè)計(jì)說明1. 分析與創(chuàng)建數(shù)據(jù)庫;根據(jù)系統(tǒng)的功能分析結(jié)果,影院售票管理系統(tǒng)將會(huì)使用Microsoft SQLSever 2000作為后臺(tái)的數(shù)據(jù)庫管理系統(tǒng)。本管理系統(tǒng)是應(yīng)用于電影院中,而且需要和數(shù)據(jù)庫之 間進(jìn)行頻繁數(shù)

3、據(jù)交換,所以采用Microsoft SQL Sever 2000作為后臺(tái)的數(shù)據(jù)庫管理系統(tǒng)。在本管理系統(tǒng)中,需要掌握影庫充實(shí)信息,職工管理信息,票務(wù)管理信息,此外, 由于要進(jìn)行職工管理,還需要掌握使用本系統(tǒng)的職工。表1存儲(chǔ)硬庫信息列表,表2存儲(chǔ)了電影院座位的相關(guān)數(shù)據(jù)連接關(guān)系,表3存儲(chǔ)了電影票銷售情況管理,表4存儲(chǔ)了系統(tǒng)使用者職工的相關(guān)情況的管理列表。表1影庫管理表-MOVIES字段名稱數(shù)據(jù)類型字段屬性字段大小作用必填字段索引是否主鍵Movie_idsmalli nt2電影號(hào)是有(無重復(fù))是Movie_ nameNvarchar50電影名稱是無actorNvarchar50導(dǎo)演否無actressN

4、varchar50主演否無producerNvarchar25制片廠否無palydatedatetime8上映時(shí)間是無表2電影院座位管理表-SEATS字段名稱數(shù)據(jù)類型字段屬性字段大小作用必填字段索引是否主鍵seatidsmalli nt2座位號(hào)是有(無重復(fù))是pricefloat8票價(jià)是無soldor notsmalli nt2是否售出是無表3電影票信息表-TICKETS字段名稱數(shù)據(jù)類型字段屬性字段大小作用必填字段索引是否主鍵ticketsidsmalli nt2電影票號(hào)是有(無重復(fù))是seatidsmalli nt2座位號(hào)是有Movie_idsmalli nt2電影號(hào)是有Movie_ nam

5、eNvarchar50電影名否無palydatedatetime8上映時(shí)間是無pricefloat8價(jià)格是無yan zhe ngmasmalli nt2驗(yàn)證碼是無是表4 職工信息表-WORKERS字段名稱數(shù)據(jù)類型字段屬性字段大小作用必填字段索引是否主鍵workeridsmalli nt2職工號(hào)是無是passwordsmalli nt2職工密碼是無leibiesmalli nt2職工類型是無根據(jù)規(guī)范化的設(shè)計(jì)理念,本管理系統(tǒng)的數(shù)據(jù)分成上面4個(gè)表,減少了數(shù)據(jù)的冗余,同時(shí)在這些表之間又存在著一些關(guān)聯(lián)關(guān)系。這四個(gè)表之間的這兩種關(guān)系表現(xiàn)在下圖所示的關(guān)系:Ti ckfttsiicketslfutidpric

6、e£7i.DxhraEnBS'eal-3-上Tvr ker & 刊 in-rkcr Lelhle2 .創(chuàng)建登陸窗體模塊;(1) 窗體模塊的功能 登陸窗體(2 )窗體界面的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“登陸系統(tǒng)”,用來作為系統(tǒng)登陸窗體。界面 的設(shè)計(jì)如圖3所示。(3 )窗體代碼Public Class Form1Inherits System.Windows.Forms.FormDim navigator As BindingManagerBaseDim mycon As NewSqlConnectionDim mycom As NewSqlCommandDim my

7、com1 As NewSqlCommand'用來對(duì)記錄導(dǎo)航'連接對(duì)象'命令對(duì)象Dim frm2 As NewForm2Dim frm3 As NewForm3Dim frm8 As NewForm8Private Sub Timer1_Tick( ByVai sender As System.Object,ByVai e As System.EventArgs) HandlesTimerl.TickStatusBar1.Panels(0).Text = DateTime.TodayEnd SubPrivate Sub GroupBox1_Enter( ByVai sen

8、der As System.Object, ByVai e As System.EventArgs)Handles GroupBoxI.EnterIf RadioButtonl.Checked = True ThenRadioButton2.Checked =FalseRadioButton3.Checked =FalseElself RadioButton2.Checked = True ThenRadioButtonl.Checked =FalseRadioButton3.Checked =FalseElself RadioButton3.Checked = True ThenRadioB

9、uttonl.Checked =FalseRadioButton2.Checked =FalseEnd IfEnd SubPrivate Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buttonl.ClickAxShockwaveFlashl.Movie =實(shí)驗(yàn)運(yùn)行場WB.NET程序設(shè)計(jì)電影院票務(wù)系統(tǒng)登陸界面l.swf"AxShockwaveFlashl.Playing =FalseAxShockwaveFlash1.Stop()Dim toxl As I

10、nt32Dim tox2 As Int32Dim mydataadapter As NewSqlDataAdapterDim myds As NewDataSetDim i As IntegerDim j As Integertoxl = Val(TextBoxl.Text)tox2 = Val(TextBox2.Text)通過MYCON連接對(duì)象操作數(shù)據(jù)庫 設(shè)置命令類型'設(shè)置要執(zhí)行的命令mycon.ConnectionString = "initial catalog=ticketbooking;user id=sa;password=;"mycom.Connect

11、ion = mycon mycom.CommandType = CommandType.Text mycom.CommandText = "select * from workers"Trymycon.Open() mydataadapter.SelectCommand = mycomCatch ex As ExceptionMessageBox.Show(”連接失敗")Finallymycon.Close()End Trymydataadapter.Fill(myds, "workers")For i = 0 To myds.Tables(&

12、quot;workers").Rows.Count - 1If tox1 = Val(myds.Tables("workers").Rows(i).ltemArray(O)Thenj = 0Exit ForElsej = 1End IfNextFor i = 0 To myds.Tables("workers").Rows.Count - 1If tox2 = Val(myds.Tables("workers").Rows(i).ItemArray(1)Thenj = 0Exit ForElsej = 1End IfNext

13、If j = 1 ThenMessageBox.Show(”您的工號(hào)或者密碼錯(cuò)誤 ","錯(cuò)誤提示", MessageBoxButtons.OK,MessageBoxIcon.Warning)ElseTrymycom1.Connection = mycon'通過 MYCON連接對(duì)象操作數(shù)據(jù)庫mycom1.CommandType = CommandType.Text'設(shè)置命令類型mycom1.CommandText = "select leibie from workers where workerid=" +CStr (tox1)

14、+ "and password=" + CStr (tox2) +設(shè)置要執(zhí)行的命令Dim mydataadapter1 As NewSqlDataAdaptermydataadapter1.SelectCommand = mycom1Dim myds1 As NewDataSetmydataadapter1.Fill(myds1, "workers")If RadioButton1.Checked = True AndVal(myds1.Tables("workers").Rows(0)("leibie") = 1

15、Thenfrm2.Show()MeHide()ElseIf RadioButton2.Checked =True AndVal(myds1.Tables("workers").Rows(0)("leibie") = 2Thenfrm3.Show()MeHide()ElseIf RadioButton3.Checked =True AndVal(myds1.Tables("workers").Rows(0)("leibie") = 3Thenfrm8.Show()MeHide()ElseMessageBox.Show

16、(”您超出職責(zé)范圍或未選擇服務(wù)系統(tǒng),請重新輸入! ",示", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Buttonl)End IfCatch ex As ExceptionEnd TryEnd IfEnd SubPrivate Sub Form1_Load( ByVai sender As System.Object, ByVai e As System.EventArgs) MyBaseLoadAxShockwaveFlashl.Movie =實(shí)驗(yàn)運(yùn)行場WB.NET程序設(shè)計(jì)

17、電影院票務(wù)系統(tǒng)l.swf"AxShockwaveFlash1.Play()End SubPrivate Sub Button2_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Button2.ClickDim exitform As NewForm7If exitform.ShowDialog = DialogResult.OKThenexitform.Close()MeClose()Application.Exit()End IfEnd SubEnd Class3. 創(chuàng)建售票窗體模塊(1) 窗體模

18、塊的功能為觀眾提供買票服務(wù)。在界面上觀眾可以看見座位的情況,根據(jù)此來選擇自己喜歡 的座位。不同的座位有不同的價(jià)格。此窗體還有退票功能。(2) 窗體界面的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“售票系統(tǒng)”,用來作為倉管人員窗體。界面 的設(shè)計(jì)如下圖所示。(3) 代碼編寫Public Class Form2Dim navigator As BindingManagerBase '用來對(duì)記錄導(dǎo)航Dim mycon錯(cuò)誤提Handles登陸界面HandlesAs NewSqlConnection'連接對(duì)象As NewSqlCommand'命令對(duì)象苗&Dim mycomPrivat

19、e Sub Form2_Load( ByVai sender As System.Object, ByVai e As System.EventArgs) Handles MyBaseLoad'Me.Show()實(shí)驗(yàn)運(yùn)行場WB.NET程序設(shè)計(jì)電影院票務(wù)系統(tǒng)銷售界面.swf"AxShockwaveFlash1.Play()AxShockwaveFlash2.Movie =實(shí)驗(yàn)運(yùn)行場WB.NET程序設(shè)計(jì)電影院票務(wù)系統(tǒng)檢票界面下.swf"AxShockwaveFlash2.Play()Dim mydataadapter As NewSqlDataAdapterDim my

20、ds As NewDataSetDim i As IntegerDim j As IntegerDim strrow As StringDim dt As NewDataTablemycon.ConnectionString = "initial catalog=ticketbooking;user id=sa;password=;" mycom.Connection = mycon'通過 MYCON連接對(duì)象操作數(shù)據(jù)庫mycom.CommandType = CommandType.Text '設(shè)置命令類型mycom.CommandText = "s

21、elect * from Movies"'設(shè)置要執(zhí)行的命令"Trymycon.Open()mydataadapter.SelectCommand = mycommydataadapter.Fill(myds, "Movies")Catch ex As ExceptionMessageBox.Show("連接失敗")Finallymycon.Close()End TryTryFor i = 0 To myds.Tables("Movies").Rows.Count - 1strrow = myds.Table

22、s("Movies").Rows(i)("movie_name")NextCatch ex As ExceptionMessageBox.Show(ex.ToString)End TryEnd SubPrivate Sub Button1_Click_1( ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Buttonl.ClickDim i As IntegerDim tickethao As IntegerDim moviehao As IntegerDim suij

23、i As IntegerDim mydataadapter3 As NewSqlDataAdapterDim myds3 As NewDataSetDim dt3 As NewDataTableDim mycom3 As NewSqlCommandDim mycon3 As NewSqlConnectionRandomize。suiji = lnt(9000 * Rnd() + 1000)Trytickethao = tickets_id()moviehao = movieid()mycon3.ConnectionString = "initial catalog=ticketboo

24、king;user id=sa;password=;" mycom3.Connection = mycon3'通過 MYCON連接對(duì)象操作數(shù)據(jù)庫mycom3.CommandType = CommandType.Text'設(shè)置命令類型Catch ex As ExceptionMessageBox.Show(ex.ToString)End TryIf tickethao = 0 ThenTryMessageBox.Show(" ComboBoxl.Text ="" TextBoxl.Text ="" TextBox2.Te

25、xt ="" TextBox3.Text =""此座位已售岀,請重新選擇! ",”錯(cuò)誤")TextBox4.Text =""TextBox5.Text =""Catch ex As ExceptionMessageBox.Show(ex.ToString)End TryElseTrymycon3.Open()mycom3.CommandText = "insert into tickets(ticketsid,seatid,movie_id,movie_name,palydate,pr

26、ice,yanzhengma)values (" + CStr (tickethao) +","+ TextBox4.Text + ","+ CStr (moviehao) + TextBox5.Text + "," + CStr (suiji) + ")"Dim sql As String+ TextBox2.Text + TextBoxl.Text +sql = "insert into tickets(ticketsid,seatid,movie_id,movie_name,palydat

27、e,price,yanzhengma)","+ TextBox4.Text + ","+ CStr (moviehao) + ",'"+ TextBox2.Text +values (" + CStr (tickethao) +"','"+ TextBox3.Text +"',"+ TextBox5.Text + "," +CStr (suiji) + ")"mydataadapter3n sertCommand

28、= mycom3Trymycom3.ExecuteNonQuery()MessageBox.Show(”售票成功!","謝謝觀看")Catch ex As ExceptionMsgBox(ex.ToString)End TryCatch ex As ExceptionMessageBox.Show(ex.ToString)End Trymycon3.Close()ComboBox1.Text =""TextBox1.Text =""TextBox2.Text =""TextBox3.Text ="

29、;"TextBox4.Text =""TextBox5.Text =""End Ifrevoke_seat()End SubPrivate Sub ComboBox1_SelectedlndexChanged_1( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedlndexChangedrevoke_seat()Dim mydataadapter1 As NewSqlDataAdapterDim mydataadapter

30、11 As NewSqlDataAdapterDim myds1 As NewDataSetDim myds11 As NewDataSetDim dt1 As NewDataTableDim dt11 As NewDataTableDim mycom1 As NewSqlCommandDim mycom11 As NewSqlCommandmycon.ConnectionString = "initial catalog=ticketbooking;user id=sa;password=;"mycom1.Connection = mycon'通過 MYCON連接

31、對(duì)象操作數(shù)據(jù)庫mycom1.CommandType = CommandType.Text '設(shè)置命令類型 mycom11.Connection = myconmycom11.CommandType = CommandType.TextTrymycon.Open()mycom11.CommandText = "select palydate from Movies where movie_name= '" +ComboBox1.Text + ""'mycom1.CommandText = "select * from ti

32、ckets where movie_name= '" + ComboBoxl.Text+ "'"mydataadapterl.SelectCommand = mycomlmydataadapterll.SelectCommand = mycomllmydataadapter1.Fill(myds1, "tickets")mydataadapter11.Fill(myds11, "Movies")dt1 = myds1.Tables("tickets")dt11 = myds11.Table

33、s("Movies")Catch ex As ExceptionMessageBox.Show(ex.ToString)End TryTryMessageBox.Show(”還未出售!")TextBox1.Text = dt11.Rows(0)("palydate") revoke_seat()ElseShowSelllnfo(dt1)TextBox1.Text = dt11.Rows(0)("palydate")End IfCatch ex As ExceptionEnd Trymycon.Close()End SubPr

34、ivate Sub Button2_Click_1( ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button2.ClickDim tickethao As IntegerDim mydataadapter4 As NewSqlDataAdapterDim myds4 As NewDataSetDim dt4 As NewDataTableDim mycom4 As NewSqlCommandDim mycon4 As NewSqlConnectionTrymycon4.ConnectionString

35、= "initial catalog=ticketbooking;user id=sa;password=;"mycom4.Connection = mycon4'通過 MYCON連接對(duì)象操作數(shù)據(jù)庫mycom4.CommandType = CommandType.Text'設(shè)置命令類型tickethao = tuipiao()Catch ex As ExceptionMessageBox.Show(ex.ToString)End TryIf tickethao = 0 ThenMessageBox.Show(”座位號(hào)輸入錯(cuò)誤,請重新輸入!",”錯(cuò)誤

36、")ElseTrymycon4.Open()mycom4.CommandText = "delete from tickets where ticketsid=" +CStr (tickethao)+ ""Trymycom4.ExecuteNonQuery()MessageBox.Show(”退票成功!",”謝謝觀看")Catch ex As ExceptionMsgBox(ex.ToString)End TryCatch ex As ExceptionMsgBox(ex.ToString)End TryEnd Ifmyco

37、n4.Close()TextBox1.Text =""TextBox2.Text =""TextBox3.Text =""TextBox4.Text =""TextBox5.Text =""ComboBox1.Text =""revoke_seat()End SubPrivate Sub Button3_Click_1( ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button3.Cli

38、ckTextBox2.Text = ComboBox1.TextTextBox3.Text = TextBox1.TextIf TextBox4.Text = "" ThenMessageBox.Show(”請輸入座位號(hào)!",”提示")End IDim mydataadapter2 As NewSqlDataAdapterDim myds2 As NewDataSetDim dt2 As NewDataTableDim mycom2 As NewSqlCommandmycon.ConnectionString = "initial catalo

39、g=ticketbooking;user id=sa;password=;"mycom2.Connection = mycon'通過 MYCON連接對(duì)象操作數(shù)據(jù)庫mycom2.CommandType = CommandType.Text '設(shè)置命令類型Trymycon.Open()mycom2.CommandText = "select * from seats where seatid=" + TextBox4.Text + "" mydataadapter2.SelectCommand = mycom2mydataadapt

40、er2.Fill(myds2, "seats")dt2 = myds2.Tables("seats")Catch ex As ExceptionMessageBox.Show(ex.ToString)End TryTextBox5.Text = dt2.Rows(0)("price")mycon.Close()End SubPrivate Sub Button4_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Clic

41、kDim exitform As NewForm7If exitform.ShowDialog = DialogResult.OKThenexitform.Close()MeClose()Application.Exit()End IfEnd SubEnd Class4. 創(chuàng)建檢票界面(1)創(chuàng)建模塊的功能對(duì)進(jìn)場觀眾檢票,如果發(fā)現(xiàn)有假票或無票觀眾不允許入內(nèi)。(2 )創(chuàng)建模塊的窗體在工程中添加一個(gè)窗體,命名為“檢票系統(tǒng)”,用來作為檢票系統(tǒng)窗體。界面 的設(shè)計(jì)如下圖所示。(3 )代碼編寫Public Class Form3Dim ds1 As NewDataSetDim sqlda1 As NewSq

42、lDataAdapterDim RecordCount As IntegerPrivate Sub Form3_Load( ByVai sender As System.Object, ByVal e As System.EventArgs) MyBaseLoad實(shí)驗(yàn)運(yùn)行場WB.NET程序設(shè)計(jì)電影院票務(wù)系統(tǒng)面.swf"AxShockwaveFlash1.Play()AxShockwaveFlash2.Movie =實(shí)驗(yàn)運(yùn)行場WB.NET程序設(shè)計(jì)電影院票務(wù)系統(tǒng)Handles檢票界檢票界面下.swf"AxShockwaveFlash2.Play()Dim sqlcmd1 As

43、NewSqlCommandDim str1 As String = "select * from tickets" sqlcmd1.Connection = sqlcn1 sqlcmd1.CommandText = str1 sqlda1.SelectCommand = sqlcmd1Trysqlcn1.Open()sqlcmd1.ExecuteNonQuery()Catch ex As SqlExceptionMsgBox(ex.Message)Finallysqlcn1.Close()End TryTrysqlda1.Fill(ds1)Catch ex As SqlEx

44、ceptionMsgBox(ex.Message)End TryRecordCount = ds1.Tables(0).Rows.CountTextBox6.Text = RecordCountEnd SubPrivate Sub Button1_Click_1( ByVai sender As System.Object, ByVai e As System.EventArgs)Handles Buttonl.ClickDim i As IntegerDim flag As Boolean = FalseIf TextBoxl.Text =""ThenTextBox7.T

45、ext ="請認(rèn)真填寫票號(hào)!TextBox1.Focus()Exit SubEnd IfIf TextBox2.Text =""ThenTextBox7.Text ="請?zhí)顚戲?yàn)證碼!TextBox2.Focus()Exit SubEnd IfFor i = 0 To RecordCount - 1And TextBox2.Text =If TextBoxl.Text = CStr (ds1.Tables(0).Rows(i)("ticketsid")CStr (ds1.Tables(0).Rows(i)("yanzhengm

46、a")Thenflag =TrueExit ForEnd IfNextIf flag = True ThenTryTextBox3.Text = ds1.Tables(0).Rows(i)("seatid")TextBox4.Text = ds1.Tables(0).Rows(i)("movie_name")TextBox5.Text = ds1.Tables(0).Rows(i)("price")Catch ex As ExceptionMsgBox(ex.Message)End TryTextBox7.Text =&qu

47、ot;此票為真!"ElseTextBox7.Text ="此票為假!"End IfTextBox6.Text = RecordCountEnd SubPrivate Sub Button2_Click_1( ByVai sender As System.Object, ByVai e As System.EventArgs) Handles Button2.ClickTextBoxl.Text =""TextBox2.Text =""TextBox3.Text =""TextBox4.Text =&quo

48、t;"TextBox5.Text =""TextBox6.Text =""TextBox7.Text =""TextBox1.Focus()End SubPrivate Sub Button3_Click_1( ByVai sender As System.Object, ByVai e As System.EventArgs)Handles Button3.ClickDim exitform As NewForm7If exitform.ShowDialog = DialogResult.OKThenexitform.Cl

49、ose()MeClose()Application.Exit()End IfEnd SubEnd Class5. 創(chuàng)建維護(hù)界面(i)創(chuàng)建模塊的功能給數(shù)據(jù)庫維護(hù)工作人員選擇維護(hù)的系統(tǒng)數(shù)據(jù)庫(2 )創(chuàng)建模塊的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“維護(hù)系統(tǒng)”,用來作為維護(hù)系統(tǒng)窗體。界面的設(shè)計(jì)如下圖所示。誡遼擇護(hù)的果孩I 處憲齡it工畫披BurntI1 出(3 )代碼編寫Public Class Form8Private Sub Form8_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBaseLoad

50、實(shí)驗(yàn)運(yùn)行場WB.NET程序設(shè)計(jì)電影院票務(wù)系統(tǒng)登陸界面.swf"AxShockwaveFlash1.Play()End SubPrivate Sub Button1_Click( ByVal sender As System.Object, Button1.ClickDim frm4 As NewForm4frm4.Show()MeHide()End SubPrivate Sub Button2_Click( ByVal sender As System.Object, Button2.ClickDim frm6 As NewForm6frm6.Show()MeHide()End Su

51、bPrivate Sub Button3_Click( ByVal sender As System.Object, Button3.ClickDim frm9 As NewForm9frm9.Show()MeHide()End SubPrivate Sub Button4_Click( ByVal sender As System.Object, Button4.ClickDim exitform As NewForm7If exitform.ShowDialog = DialogResult.OKThenexitform.Close()ByVal e As System.EventArgs

52、)ByVal e As System.EventArgs)ByVal e As System.EventArgs)ByVal e As System.EventArgs)HandlesHandlesHandlesHandlesMeClose()Application.Exit()End IfEnd SubEnd Class1 .創(chuàng)建影庫界面(1 )創(chuàng)建模塊的功能對(duì)電影庫播放列表的管理(2 )創(chuàng)建模塊的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“影庫系統(tǒng)”,用來作為影庫系統(tǒng)窗體。界面 的設(shè)計(jì)如下圖所示。影片名刖蘇竜 辱 溝垂£訶耀tti(3 )代碼編寫Dim sqIAdapter As NewS

53、qlDataAdapterDim movieRow As DataRowDim RecordCount As IntegerDim i As Integer = 0Dim idnum(2000) As IntegerDim CurrentPosition As IntegerSub ShowPosition()Then無記錄MeBindingContext(DataSet11, "Movies").PositionIf RecordCount = 0TextBox1.Text ="Else CurrentPosition =TextBox1.Text = movi

54、eRow.ltem("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.ltem("p

55、alydate")TextBox7.Text = CurrentPosition + 1 & "/" & RecordCountEnd IfHandlesEnd SubPrivate Sub Form4_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) MyBaseLoadDataSet11.Clear()MeSqlDataAdapterl.Fill(DataSetll)ShowPosition()HandlesEnd SubPrivate Sub Button1_C

56、lick( ByVal sender As System.Object, ByVal e As System.EventArgs) Buttonl.ClickIf MeBindingContext(DataSet11, "Movies").Position > 0ThenMeBindingContext(DataSet11, "Movies").Position -= 1ShowPosition()ElseMessageBox.Show(”已到達(dá)首記錄!","提示信息")End IfHandlesEnd SubPriv

57、ate Sub Button2_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Button2.ClickIf MeBindingContext(DataSet11, "Movies").Position < RecordCount - 1ThenMeBindingContext(DataSet11, "Movies").Position += 1ShowPosition()ElseMessageBox.Show(”已到達(dá)尾記錄!","提示信息

58、")End IfEnd SubHandlesPrivate Sub Button4_Click( ByVal sender As System.Object, ByVal e As System.EventArgs)Button4.ClickMeBindingContext(DataSet11, "Movies").Position = RecordCount - 1ShowPosition()End SubHandlesPrivate Sub Button5_Click( ByVal sender As System.Object, ByVal e As System.EventArgs)Button5.Click '添加數(shù)據(jù)Dim j As IntegerDim flag As Boolean = TrueFor j = 0 To iIf TextBox1.Text = CStr (idnum(j) Thenflag =FalseMessageBox.Show("ID地址有沖突!","提示")End IfNextIf fl

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論