版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
用數(shù)據(jù)庫(kù)設(shè)計(jì)影院售票治理系統(tǒng)用數(shù)據(jù)庫(kù)設(shè)計(jì)影院售票治理系統(tǒng)10/26一.系統(tǒng)概述;1.設(shè)計(jì)需求;很多人寵愛(ài)到電影院去看電影。由于家里的氣氛到底不如影院好。所以,現(xiàn)代家庭影院的消滅并不會(huì)讓電影院沒(méi)有生路。每個(gè)社會(huì)效勞系統(tǒng)都有自己的一套治理機(jī)制。固然,電影院也不除外。其實(shí)電影院的治理系統(tǒng)應(yīng)當(dāng)來(lái)說(shuō)比其他的社會(huì)效勞系統(tǒng)的治理要簡(jiǎn)潔一點(diǎn)。電影院不外乎是引進(jìn)電影,制定播放影片的時(shí)間表,買票,檢票進(jìn)場(chǎng)觀看,還有就是一些數(shù)據(jù)治理方面的事。如工作人員治理,票務(wù)治理等等。為了工作機(jī)制簡(jiǎn)潔有序,必定要引進(jìn)一套治理系統(tǒng)。需求分析;具體而言,影院售票系統(tǒng)需要實(shí)現(xiàn)以下的需求:能夠?qū)Σシ烹娪?,工作人員,售票事宜,檢票事宜,無(wú)用數(shù)據(jù)進(jìn)展處理。售票治理自然有專人負(fù)責(zé),要處理各電影的電影票銷售問(wèn)題。固然包括退票問(wèn)題,還有就是預(yù)訂電影票其實(shí)也就相當(dāng)于買票。兩者可以當(dāng)一回事處理。檢票治理事宜要完成觀眾進(jìn)場(chǎng)時(shí)檢票的事宜。其中包括了電影票的真假檢測(cè)問(wèn)題。電影座位電影座位電影號(hào)上映時(shí)間座位編號(hào)是否售出電影名稱導(dǎo)演主演生產(chǎn)地座位票價(jià)電影票電影票驗(yàn)證碼價(jià)格電影號(hào)電影名座位號(hào)上映時(shí)間電影票號(hào)職工信息職工類型職工號(hào)職工密碼字段屬性三.設(shè)計(jì)說(shuō)明字段屬性MicrosoftSQLSever2023作為后臺(tái)的數(shù)據(jù)庫(kù)治理系統(tǒng)。本治理系統(tǒng)是應(yīng)用于電影院中,而且需要和數(shù)據(jù)庫(kù)之間進(jìn)展頻繁數(shù)據(jù)交換,所以承受MicrosoftSQLSever2023作為后臺(tái)的數(shù)據(jù)庫(kù)治理系統(tǒng)。在本治理系統(tǒng)中,需要把握影庫(kù)充實(shí)信息,職工治理信息,票務(wù)治理信息,此外,由于要進(jìn)展職工治理,還需要把握使用本系統(tǒng)的職工。表1存儲(chǔ)硬庫(kù)信息列表,表2存儲(chǔ)了電影院座位的相關(guān)數(shù)據(jù)連接關(guān)系,表34存儲(chǔ)了系統(tǒng)使用者職工的相關(guān)狀況的治理列表。字段屬性表1 影庫(kù)治理表---MOVIES字段屬性字段名稱數(shù)據(jù)類型字段大小 作用 必填 索引是否主字段鍵Movie_idsmallint2 電影號(hào) 是 有〔無(wú)重復(fù)〕是Movie_nameNvarchar50 電影名稱 是 無(wú)actorNvarchar50 導(dǎo)演 否 無(wú)actressNvarchar50 主演 否 無(wú)producerNvarchar25 制片廠 否 無(wú)palydatedatetime8 上映時(shí)間 是 無(wú)表2 電影院座位治理表---SEATS字段名稱字段名稱數(shù)據(jù)類型字段大小作用字段屬性必填字段索引是否主鍵seatidpricesoldornotsmallintfloatsmallint282座位號(hào)票價(jià)是否售出是是是有〔無(wú)重復(fù)〕無(wú)無(wú)是表3 電影票信息表---TICKETS字段名稱數(shù)據(jù)類型字段大小作用必填索引是否主鍵字段ticketsidsmallint2電影票號(hào)是有〔無(wú)重復(fù)〕是seatidsmallint2座位號(hào)是有Movie_idsmallint2電影號(hào)是有Movie_nameNvarchar50電影名否無(wú)palydatedatetime8上映時(shí)間是無(wú)pricefloat8價(jià)格是無(wú)yanzhengmasmallint2驗(yàn)證碼是無(wú)是字段名稱workeridpassword字段名稱workeridpasswordleibie數(shù)據(jù)類型smallintsmallintsmallint字段大小222作用職工號(hào)職工密碼職工類型字段屬性必填字段是是是索引無(wú)無(wú)無(wú)是否主鍵是依據(jù)標(biāo)準(zhǔn)化的設(shè)計(jì)理念,本治理系統(tǒng)的數(shù)據(jù)分成上面4個(gè)表,削減了數(shù)據(jù)的冗余,同時(shí)系:2.創(chuàng)立登陸窗體模塊;窗體模塊的功能登陸窗體窗體界面的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“登陸系統(tǒng)”,用來(lái)作為系統(tǒng)登陸窗體。界面3窗體代碼ImportsSystem.Data.SqlClientPublicClassForm1InheritsSystem.Windows.Forms.FormDimnavigatorAsBindingManagerBase 錄導(dǎo)航DimmyconAsNewSqlConnection ”連接對(duì)象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:\試驗(yàn)運(yùn)行場(chǎng)\VB.NET程序設(shè)計(jì)\電影院票務(wù)系統(tǒng)\image\登陸界面1.swf“
AxShockwaveFlash1.Playing=FalseAxShockwaveFlash1.StopDimtox1AsInt32Dimtox2AsInt32DimmydataadapterAsNewSqlDataAdapterDimmydsAsNewDataSetDimiAsIntegerDimjAsIntegertox1=Val(TextBox1.Text)tox2=Val(TextBox2.Text)mycon.ConnectionString=“initialcatalog=ticketbooking;userid=sa;password=;“mycom.Connection=mycon ”通過(guò)MYCON連接對(duì)象操作數(shù)據(jù)庫(kù)mycommandType=CommandType.Text ”設(shè)置命令類型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 ”通過(guò)MYCON連接對(duì)象操作數(shù)據(jù)庫(kù)mycom1mandType=CommandType.Text ”設(shè)置命令類型mycom1mandText=“selectleibiefromworkerswhereworkerid=“+CStr(tox1)“andpassword=“+CStr(tox2)+““”設(shè)置要執(zhí)行的命令Dimmydataadapter1AsNewSqlDataAdaptermydataadapter1.SelectCommand=mycom1Dimmyds1AsNewDataSetmydataadapter1.Fill(myds1,“workers“)IfRadioButton1.Checked=TrueAndVal(myds1.Tables(“workers“).Rows(0)(“l(fā)eibie“))=1Thenfrm2.ShowMe.HideElseIfRadioButton2.Checked=TrueAndVal(myds1.Tables(“workers“).Rows(0)(“l(fā)eibie“))=2Thenfrm3.ShowMe.HideElseIfRadioButton3.Checked=TrueAndVal(myds1.Tables(“workers“).Rows(0)(“l(fā)eibie“))=3Thenfrm8.ShowMe.HideElseMessageBox.Show(示“,MessageBoxButtons.OK,MessageBoxIcon.Warning,MessageBoxDefaultButton.Button1)EndIfCatchexAsExceptionEndTryEndIfEndSubByValeAsSystem.EventArgs)HandlesMyBase.LoadAxShockwaveFlash1.Movie“E:\試驗(yàn)運(yùn)行場(chǎng)\VB.NET程序設(shè)計(jì)\電影院票務(wù)系統(tǒng)\image\登陸界面1.swf“AxShockwaveFlash1.PlayEndSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickDimexitformAsNewForm7Ifexitform.ShowDialog=DialogResult.OKThenexitform.CloseMe.CloseApplication.ExitEndIfEndSubEndClass創(chuàng)立售票窗體模塊窗體模塊的功能為觀眾供給買票效勞。在界面上觀眾可以觀看座位的狀況,依據(jù)此來(lái)選擇自己寵愛(ài)的座位。不同的座位有不同的價(jià)格。此窗體還有退票功能。窗體界面的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“售票系統(tǒng)”,用來(lái)作為倉(cāng)管人員窗體。界面的設(shè)計(jì)如以以下圖所示。代碼編寫(xiě)ImportsSystem.Data.SqlClientPublicClassForm2InheritsSystem.Windows.Forms.FormDimnavigatorAsBindingManagerBase 錄導(dǎo)航DimmyconAsNewSqlConnection ”連接對(duì)象DimmycomAsNewSqlCommand PrivateSubForm2_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load”Me.ShowAxShockwaveFlash1.Movie=“E:\試驗(yàn)運(yùn)行場(chǎng)\VB.NET程序設(shè)計(jì)\電影院票務(wù)系統(tǒng)\image\銷售界面.swf“下.swf“
AxShockwaveFlash1.Play“E:\試驗(yàn)運(yùn)行場(chǎng)\VB.NET程序設(shè)計(jì)\電影院票務(wù)系統(tǒng)\image\檢票界面AxShockwaveFlash2.PlayDimmydataadapterAsNewSqlDataAdapterDimmydsAsNewDataSetDimiAsIntegerDimjAsIntegerDimstrrowAsStringDimdtAsNewDataTablemycon.ConnectionString=“initialcatalog=ticketbooking;userid=sa;password=;“mycom.Connection=mycon ”通過(guò)MYCON連接對(duì)象操作數(shù)據(jù)庫(kù)mycommandType=CommandType.Text ”設(shè)置命令類型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 ”通過(guò)MYCON連接對(duì)象操作數(shù)據(jù)庫(kù)mycom3mandType=CommandType.Text ”設(shè)置命令類型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 ”通過(guò)MYCON連接對(duì)象操作數(shù)據(jù)庫(kù)mycom1mandType=CommandType.Text ”設(shè)置命令類型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 ”通過(guò)MYCON連接對(duì)象操作數(shù)據(jù)庫(kù)mycom4mandType=CommandType.Text ”設(shè)置命令類型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 ”通過(guò)MYCON連接對(duì)象操作數(shù)據(jù)庫(kù)mycom2mandType=CommandType.Text ”設(shè)置命令類型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創(chuàng)立檢票界面創(chuàng)立模塊的功能對(duì)進(jìn)場(chǎng)觀眾檢票,假設(shè)覺(jué)察有假票或無(wú)票觀眾不允許入內(nèi)。創(chuàng)立模塊的窗體在工程中添加一個(gè)窗體,命名為“檢票系統(tǒng)”,用來(lái)作為檢票系統(tǒng)窗體。界面的設(shè)計(jì)如以以下圖所示。代碼編寫(xiě)ImportsSystem.Data.SqlClientPublicClassForm3InheritsSystem.Windows.Forms.FormDimds1AsNewDataSetDimsqlda1AsNewSqlDataAdapterDimRecordCountAsIntegerPrivateSubForm3_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadAxShockwaveFlash1.Movie=“E:\試驗(yàn)運(yùn)行場(chǎng)\VB.NET程序設(shè)計(jì)\電影院票務(wù)系統(tǒng)\image\檢票界面.swf“下.swf“
AxShockwaveFlash1.Play“E:\試驗(yàn)運(yùn)行場(chǎng)\VB.NET程序設(shè)計(jì)\電影院票務(wù)系統(tǒng)\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創(chuàng)立維護(hù)界面創(chuàng)立模塊的功能給數(shù)據(jù)庫(kù)維護(hù)工作人員選擇維護(hù)的系統(tǒng)數(shù)據(jù)庫(kù)創(chuàng)立模塊的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“維護(hù)系統(tǒng)”,用來(lái)作為維護(hù)系統(tǒng)窗體。界面的設(shè)計(jì)如以以下圖所示。代碼編寫(xiě)PublicClassForm8InheritsSystem.Windows.Forms.FormPrivateSubForm8_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadAxShockwaveFlash1.Movie=“E:\試驗(yàn)運(yùn)行場(chǎng)\VB.NET程序設(shè)計(jì)\電影院票務(wù)系統(tǒng)\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創(chuàng)立影庫(kù)界面創(chuàng)立模塊的功能對(duì)電影庫(kù)播放列表的治理創(chuàng)立模塊的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“影庫(kù)系統(tǒng)”,用來(lái)作為影庫(kù)系統(tǒng)窗體。界面的設(shè)計(jì)如以以下圖所示。代碼編寫(xiě)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”添加數(shù)據(jù)DimjAsIntegerDimflagAsBoolean=TrueForj=0ToiIfTextBox1.Text=CStr(idnum(j))Thenflag=FalseMessageBox.Show(“IDEndIfNextIfflag=TrueThenDimMyNewDataAsDataRowMyNewData=DataSet11.Movies.NewRowTryWithMyNewData.BeginEditIfTextBox1.Text<>““Then.Item(“movie_id“)=TextBox1.TextElseMessageBox.Show(“編號(hào)不能為空“)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”修改數(shù)據(jù)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”刪除數(shù)據(jù)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創(chuàng)立職工界面創(chuàng)立模塊的功能對(duì)職工數(shù)據(jù)的處理。如增加、刪除和更改創(chuàng)立模塊的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“影庫(kù)系統(tǒng)”,用來(lái)作為影庫(kù)系統(tǒng)窗體。界面的設(shè)計(jì)如以以下圖所示。代碼編寫(xiě)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(“l(fā)eibie“)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(“效勞系統(tǒng)號(hào)只能為1,2,3EndIfIfflag=TrueThenDimMyNewDataAsDataRowMyNewData=DataSet11.Workers.NewRowTryWithMyNewData.BeginEditIfTextBox1.Text<>““Then.Item(“workerid“)=TextBox1.TextElseMessageBox.Show(“編號(hào)不能為空“)ReturnEndIf.Item(“password“)=TextBox2.Text.Item(“l(fā)eibie“)=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(“效勞系統(tǒng)號(hào)只能為1,2,3!“,“提示“)EndIfCurrentPosition=Me.BindingContext(DataSet11,“Workers“).PositionmovieRow=DataSet11.Workers.Rows(CurrentPosition)TryWithmovieRow.BeginEdit.Item(“workerid“)=TextBox1.Text.Item(“password“)=TextBox2.Text.Item(“l(fā)eibie“)=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創(chuàng)立票務(wù)界面創(chuàng)立模塊的功能對(duì)所售出的電影票進(jìn)展治理,把沒(méi)用的數(shù)據(jù)進(jìn)展去除創(chuàng)立模塊的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“影庫(kù)系統(tǒng)”,用來(lái)作為影庫(kù)系統(tǒng)窗體。界面的設(shè)計(jì)如以以下圖所示。代碼編寫(xiě)ImportsSystem.Data.SqlClientPublicClassForm9InheritsSystem.Window
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年龍崗區(qū)稅務(wù)局飲用水安全風(fēng)險(xiǎn)評(píng)估與整改服務(wù)協(xié)議4篇
- 2025版鋁材行業(yè)培訓(xùn)與咨詢服務(wù)合同范本
- 2025年度高新技術(shù)企業(yè)研發(fā)項(xiàng)目成果轉(zhuǎn)化與技術(shù)支持協(xié)議下載2篇
- 2025年度內(nèi)部控制合同管理內(nèi)部控制手冊(cè)3篇
- 二零二五版羅絲與吳磊的離婚協(xié)議及子女撫養(yǎng)權(quán)轉(zhuǎn)讓協(xié)議4篇
- 二零二五年度廚師技能競(jìng)賽與評(píng)選活動(dòng)合同4篇
- 二零二五版特色小鎮(zhèn)物業(yè)合同財(cái)務(wù)管理與文化旅游融合協(xié)議3篇
- 二零二五版汽車維修店面使用權(quán)轉(zhuǎn)讓合同模板3篇
- 2025年度新能源產(chǎn)業(yè)合作推廣戰(zhàn)略框架協(xié)議書(shū)
- 二零二五年度LED燈具音響設(shè)備研發(fā)生產(chǎn)合作協(xié)議4篇
- 華為HCIA-Storage H13-629考試練習(xí)題
- Q∕GDW 516-2010 500kV~1000kV 輸電線路劣化懸式絕緣子檢測(cè)規(guī)程
- 遼寧省撫順五十中學(xué)2024屆中考化學(xué)全真模擬試卷含解析
- 2024年湖南汽車工程職業(yè)學(xué)院?jiǎn)握新殬I(yè)技能測(cè)試題庫(kù)及答案解析
- 家長(zhǎng)心理健康教育知識(shí)講座
- GB/T 292-2023滾動(dòng)軸承角接觸球軸承外形尺寸
- 軍人結(jié)婚函調(diào)報(bào)告表
- 民用無(wú)人駕駛航空器實(shí)名制登記管理規(guī)定
- 北京地鐵6號(hào)線
- 航空油料計(jì)量統(tǒng)計(jì)員(初級(jí))理論考試復(fù)習(xí)題庫(kù)大全-上(單選題匯總)
評(píng)論
0/150
提交評(píng)論