版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、軟件工程實(shí)驗(yàn)報告一系統(tǒng)概述;1項目需求 ;2需求分析; 二項目開發(fā)計劃書; 三設(shè)計說明書;1分析與創(chuàng)建數(shù)據(jù)庫2 創(chuàng)建登陸窗體模塊;3 創(chuàng)建售票窗體模塊4創(chuàng)建檢票界面5創(chuàng)建維護(hù)界面1創(chuàng)建影庫界面2 創(chuàng)建職工界面3 創(chuàng)建票務(wù)界面 四用戶操作手冊; 五改進(jìn)意見; 六自我評價; 七參考資料、書籍; 一系統(tǒng)概述; 1項目需求;現(xiàn)在中國大部分的家庭都喜歡在家里置辦屬于自己風(fēng)格的家庭影院。但是, 仍然有很多人喜歡到電影院去看電影。因?yàn)榧依锏臍夥债吘共蝗缬霸汉?。所以,現(xiàn)代家庭影院的出現(xiàn)并不會讓電 影院沒有生路。每個社會服務(wù)系統(tǒng)都有自己的一套管理機(jī)制。當(dāng)然,電影院也不除外。其實(shí)電影院的管理系統(tǒng)應(yīng)該來說比其他的社
2、會服務(wù)系統(tǒng)的管理要簡單一點(diǎn)。 電影院不外乎是引進(jìn)電影, 制定播放影片的 時間表, 買票, 檢票進(jìn)場觀看, 還有就是一些數(shù)據(jù)管理方面的事。 如工作人員管理, 票務(wù)管理等等。 為了工作機(jī)制簡單有序,必然要引進(jìn)一套管理系統(tǒng)。2需求分析;具體而言,影院售票系統(tǒng)需要實(shí)現(xiàn)以下的需求:(1)能夠?qū)Σシ烹娪?,工作人員,售票事宜,檢票事宜,無用數(shù)據(jù)進(jìn)行處理。(2)售票管理自然有專人負(fù)責(zé),要處理各電影的電影票銷售問題。當(dāng)然包括退票問題,還有就是 預(yù)訂電影票其實(shí)也就相當(dāng)于買票。兩者可以當(dāng)一回事處理。(3)檢票管理事宜要完成觀眾進(jìn)場時檢票的事宜。其中包括了電影票的真假檢測問題。(4)數(shù)據(jù)管理要處理電影的播放的次序,工
3、作人員的管理,以及過期電影票的處理問題。二項目開發(fā)計劃書;根據(jù)需求分析的結(jié)果,本小組成員討論協(xié)商,決定本系統(tǒng)主要劃分為以下三個子模塊:售票 管理模塊、檢票管理模塊、數(shù)據(jù)管理模塊。影院售票管理系統(tǒng)是一個基于電影院工作人員的系統(tǒng), 不同類型的用戶在系統(tǒng)中有不同的權(quán)限。 主 要有三種用戶:1 售票管理人員: 主要負(fù)責(zé)賣票,訂票及退票事宜;2 檢票管理人員: 主要負(fù)責(zé)觀眾進(jìn)場時檢票工作,以及辨認(rèn)電影票的真假(此工作自然可以由 服務(wù)系統(tǒng)來完成);3 數(shù)據(jù)處理人員: 主要負(fù)責(zé)播放電影導(dǎo)入數(shù)據(jù)庫,工作人員的應(yīng)聘以及開除的數(shù)據(jù)管理,還有 過期電影票的數(shù)據(jù)處理;以下分別介紹此系統(tǒng)中各個系統(tǒng)( 3 個子模塊。):
4、(1)售票系統(tǒng)模塊給觀眾提供售票服務(wù)。不同的位置有不同的價格。要選購哪個位置由觀眾決定。工作人員根據(jù) 觀眾的需要進(jìn)行操作。系統(tǒng)在購票成功后會產(chǎn)生一個驗(yàn)證碼,此驗(yàn)證碼連工作人員都不知道。是隨 機(jī)生成的。用于對電影票真假的辯識。(2)檢票系統(tǒng)模塊 在觀眾進(jìn)場時所使用的系統(tǒng)。由掃描儀掃描,取的驗(yàn)證碼,然后進(jìn)行辯識,看是不是和數(shù)據(jù)庫 中數(shù)據(jù)一樣,如果一樣,則電影票為真,否則電影票為假。由此來決定讓不讓觀眾入場。(3)維護(hù)系統(tǒng)模塊此模塊是由電影院的數(shù)據(jù)庫管理員來管理的。他根據(jù)電影院事情的需要對有關(guān)數(shù)據(jù)進(jìn)行處理。 如電影票的管理,工作人員的管理,和電影庫的管理等。整個系統(tǒng)的結(jié)構(gòu)如下圖 1 所示:以下分別介
5、紹系統(tǒng)中數(shù)據(jù)系統(tǒng)3個子模塊。(1)影片播放管理模塊影片播放管理是對電影院播放的電影的充實(shí),設(shè)定電影的播放,以及電影時間的設(shè)定。當(dāng)所設(shè) 定的電影已經(jīng)播放完成后,要對其進(jìn)行刪除。還要對數(shù)據(jù)庫進(jìn)行清理,把一些沒用的數(shù)據(jù)全部清除。(2 )工作人員管理:電影院里當(dāng)然有工作人員的增加與開除,以及他們的管理權(quán)限的變化。這一部分事件的發(fā)生都需要數(shù)據(jù)庫管理人員將有關(guān)數(shù)據(jù)進(jìn)行處理。保證數(shù)據(jù)庫里數(shù)據(jù)的統(tǒng)一與完整。其中有他們的共號,登陸電影院管理系統(tǒng)的密碼,以及所擁有的權(quán)限。(3 )過期票務(wù)管理:電影院里的電影在放過以后,在數(shù)據(jù)庫的電影票數(shù)據(jù)就會變成沒有用的數(shù)據(jù)。通過此管理可以 把那些沒用的過期的數(shù)據(jù)清除。這里指的是
6、與放過的電影同名的電影票清除,而其他的電影票保存不變。小組人員分工情況:王圣武登陸界面和售票界面、系統(tǒng)轉(zhuǎn)換界面的程序編寫,整個系統(tǒng)框架的設(shè)計,整個系統(tǒng)界面及美化設(shè)計,整個系統(tǒng)流程的管理,創(chuàng)建數(shù)據(jù)庫張潤馳檢票系統(tǒng)和整個維護(hù)系統(tǒng)的程序編寫,局部框架輔助設(shè)計,創(chuàng)建數(shù)據(jù)庫本系統(tǒng)后臺數(shù)據(jù)庫采用目前比較流行的Microsoft SQLSever,該數(shù)據(jù)庫系統(tǒng)在安全性、準(zhǔn)確性、運(yùn)行速度方面有絕對的優(yōu)勢,并且處理數(shù)據(jù)量大、效率高;前臺采用Microsoft 公司的2003 作為主要的開發(fā)工具,其可與 SQL Sever 2000數(shù)據(jù)庫無縫銜接。三.設(shè)計說明書;1 .分析與創(chuàng)建數(shù)據(jù)庫;根據(jù)系統(tǒng)的功能分析結(jié)果,影
7、院售票管理系統(tǒng)將會使用Microsoft SQL Sever 2000 作為后臺的數(shù)據(jù)庫管理系統(tǒng)。本管理系統(tǒng)是應(yīng)用于電影院中,而且需要和數(shù)據(jù)庫之間進(jìn)行頻繁數(shù) 據(jù)交換,所以采用 Microsoft SQL Sever 2000作為后臺的數(shù)據(jù)庫管理系統(tǒng)。在本管理系統(tǒng)中,需要掌握影庫充實(shí)信息,職工管理信息,票務(wù)管理信息,此外,由于要進(jìn)行職工管理,還需要掌握使用本系統(tǒng)的職工。表1存儲硬庫信息列表,表2存儲了電影院座位的相關(guān)數(shù)據(jù)連接關(guān)系,表3存儲了電影票銷售情況管理,表4存儲了系統(tǒng)使用者職工的相關(guān)情況的管理列表。表1影庫管理表-MOVIES字段名稱數(shù)據(jù)類型字段屬性字段大小作用必填字段索引是否主鍵Movi
8、e_idsmalli nt2電影號是有(無重復(fù))是Movie_ nameNvarchar50電影名稱是無actorNvarchar50導(dǎo)演否無actressNvarchar50主演否無producerNvarchar25制片廠否無palydatedatetime8上映時間是無表2電影院座位管理表芟-SEATS字段名稱數(shù)據(jù)類型字段屬性字段大小作用必填字段索引是否主鍵seatidsmalli nt2座位號是有(無重復(fù))是pricefloat8票價是無soldor notsmalli nt2是否售出是無表3電影票信息表-TICKETS字段名稱數(shù)據(jù)類型字段屬性字段大小作用必填字段索引是否主鍵ticke
9、tsidsmalli nt2電影票號是有(無重復(fù))是seatidsmalli nt2座位號是有Movie_idsmalli nt2電影號是有Movie_ nameNvarchar50電影名否無palydatedatetime8上映時間是無pricefloat8價格是無yan zhe ngmasmalli nt2驗(yàn)證碼是無是表4 職工信息表-WORKERS字段名稱數(shù)據(jù)類型字段屬性字段大小作用必填字段索引是否主鍵workeridsmalli nt2職工號是無是passwordsmalli nt2職工密碼是無leibiesmalli nt2職工類型是無根據(jù)規(guī)范化的設(shè)計理念,本管理系統(tǒng)的數(shù)據(jù)分成上面4
10、個表,減少了數(shù)據(jù)的冗余,同時在這些表之間又存在著一些關(guān)聯(lián)關(guān)系。這四個表之間的這兩種關(guān)系表現(xiàn)在下圖所示的關(guān)系:2 .創(chuàng)建登陸窗體模塊;(1)窗體模塊的功能登陸窗體(2)窗體界面的設(shè)計在工程中添加一個窗體,命名為“登陸系統(tǒng)”,用來作為系統(tǒng)登陸窗體。界面 的設(shè)計如圖3所示。(3)窗體代碼ImportsPublic Class Form1InheritsDim navigator As BindingManagerBaseDim mycon As NewSqlConnectionDim mycom As NewSqlCommandDim mycom1 As NewSqlCommandDim frm2
11、As NewForm2' 用來對記錄導(dǎo)航' 連接對象' 命令對象Dim frm3 As NewForm3Dim frm8 As NewForm8Private Sub Timer1_Tick( ByVal sender As , ByVal e As Handles (0).Text =End SubPrivate Sub GroupBox1_Enter( ByVal sender As , ByVal e As Handles If = True Then= False= FalseElseIf = True Then= False= FalseElseIf = Tr
12、ue Then= False= FalseEnd IfEnd SubPrivate Sub Button1_Click( ByVal sender As , ByVal e As Handles 實(shí)驗(yàn)運(yùn)行場 程序設(shè)計 電影院票務(wù)系統(tǒng) 登陸界面 "= False()Dim tox1 As Int32Dim tox2 As Int32Dim mydataadapter As NewSqlDataAdapterDim myds As NewDataSetDim i As IntegerDim j As Integertox1 = Valtox2 = Val= "initial c
13、atalog=ticketbooking;user id=sa;password=;"=mycon'通過MYCON連接對象操作數(shù)據(jù)庫= ' 設(shè)置命令類型= "select * from workers"'設(shè)置要執(zhí)行的命令Try()= mycomCatch ex As Exception("連接失敗 ")Finally()End Try(myds, "workers")For i = 0 To ("workers"). - 1If tox1 = Val("workers&q
14、uot;).Rows(i).ItemArray(0)Thenj = 0Exit ForElse j = 1End IfNextFor i = 0 To ("workers"). - 1If tox2 = Val("workers").Rows(i).ItemArray(1)Thenj = 0Exit ForElse j = 1End IfNextIf j = 1 Then(" 您的工號或者密碼錯誤 ", " 錯誤提示 ", ,ElseTry = mycon'通過MYCON連接對象操作數(shù)據(jù)庫設(shè)置命令類型CSt
15、r (tox1) + "and password=" += "select leibie from workers where workerid=" +CStr (tox2) + ""' 設(shè)置要執(zhí)行的命令Dim mydataadapter1 As NewSqlDataAdapter = mycom1Dim myds1 As NewDataSet(myds1, "workers")If = True And Val("workers").Rows(0)("leibie"
16、) = 1 ()()ElseIf = True And Val("workers").Rows(0)("leibie") = 2 ()()ElseIf = True And Val("workers").Rows(0)("leibie") = 3 ()()Else(" 您超出職責(zé)范圍 或未選擇服務(wù)系統(tǒng),請重新輸入! End IfCatch ex As ExceptionEnd TryEnd IfThenThenThen錯誤提示 ", , ,End SubPrivate Sub Form1_Loa
17、d( ByVal sender As , ByVal e As Handles 實(shí)驗(yàn)運(yùn)行場 程序設(shè)計 電影院票務(wù)系統(tǒng) 登陸界面 "()End SubPrivate Sub Button2_Click( ByVal sender As , ByVal e As HandlesDim exitform As NewForm7If = Then()()()End IfEnd SubEnd Class3 創(chuàng)建售票窗體模塊(1 ) 窗體模塊的功能 為觀眾提供買票服務(wù)。在界面上觀眾可以看見座位的情況,根據(jù)此來選擇自己喜歡的座位 不同的座位有不同的價格。此窗體還有退票功能。(2 ) 窗體界面的設(shè)計
18、 在工程中添加一個窗體,命名為“售票系統(tǒng)”,用來作為倉管人員窗體。界面 的設(shè)計如下圖所示。(3) 代碼編寫ImportsPublic Class Form2用來對記錄導(dǎo)航InheritsDim mycon As NewSqlConnectionDim mycom As NewSqlCommandDim navigator As BindingManagerBasePrivateSub Form2_Load( ByVal senderAs , ByVal e AsHandles()()'()實(shí)驗(yàn)運(yùn)行場程序設(shè)計電影院票務(wù)系統(tǒng)銷售界面 .swf"實(shí)驗(yàn)運(yùn)行場程序設(shè)計電影院票務(wù)系統(tǒng)檢票
19、界面下 .swf"Dim mydataadapterAs NewSqlDataAdapter連接對象命令對象Dim myds As NewDataSetDim i As IntegerDim j As IntegerDim strrow As StringDim dt As NewDataTable= "initial catalog=ticketbooking;user id=sa;password=;"=mycon'通過MYCON連接對象操作數(shù)據(jù)庫= ' 設(shè)置命令類型= "select * from Movies"'
20、 設(shè)置要執(zhí)行的命令 "Try= mycom(myds, "Movies")Catch ex As Exception (" 連接失敗 ")Finally()End TryTryFor i = 0 To ("Movies"). - 1 strrow = ("Movies").Rows(i)("movie_name")NextCatch ex As ExceptionEnd TryEnd SubPrivate Sub Button1_Click_1( ByVal sender As , B
21、yVal e As Handles Dim i As IntegerDim tickethao As IntegerDim moviehao As IntegerDim suiji As IntegerDim mydataadapter3 As NewSqlDataAdapterDim myds3 As NewDataSetDim dt3 As NewDataTableDim mycom3 As NewSqlCommandDim mycon3 As NewSqlConnection Randomize() suiji = Int(9000 * Rnd() + 1000)Try ticketha
22、o = tickets_id() moviehao = movieid() = "initial catalog=ticketbooking;user id=sa;password=;"=mycon3'通過MYCON連接對象操作數(shù)據(jù)庫= ' 設(shè)置命令類型 Catch ex As ExceptionEnd TryIf tickethao = 0 ThenTry(" 此座位已售出,請重新選擇! ", " 錯誤 ") III! III! III! III! III!Catch ex As ExceptionEnd TryEl
23、seTry()= "insert into tickets(ticketsid,seatid,movie_id,movie_name,palydate,price,yanzhengma) values (" +CStr (tickethao) + + "," +CStr (moviehao) + ",'" + + "','" + + "'," + + "," +CStr (suiji) + ")"Dim sql As Str
24、ingsql = "insert into tickets(ticketsid,seatid,movie_id,movie_name,palydate,price,yanzhengma) values (" +CStr (tickethao) + + "," +CStr (moviehao) + ",'" + + "','" + + "'," + + "," +CStr (suiji) + ")"= mycom3Try()(
25、" 售票成功! ", " 謝謝觀看 ")Catch ex As ExceptionMsgBoxEnd TryCatch ex As ExceptionEnd Try() III! III! III! III! III! III!End If revoke_seat() End Sub Private Sub ComboBox1_SelectedIndexChanged_1( ByVal sender As , ByVal e As Handles revoke_seat()Dim mydataadapter1 As NewSqlDataAdapterDi
26、m mydataadapter11 As NewSqlDataAdapterDim myds1 As NewDataSetDim myds11 As NewDataSetDim dt1 As NewDataTableDim dt11 As NewDataTableDim mycom1 As NewSqlCommandDim mycom11 As NewSqlCommand= "initial catalog=ticketbooking;user id=sa;password=;"=mycon'通過MYCON連接對象操作數(shù)據(jù)庫= ' 設(shè)置命令類型= mycon
27、= "select palydate from Movies where movie_name= '" + + "'"= "select * from tickets where movie_name= '" + + "'"= mycom1= mycom11(myds1, "tickets")(myds11, "Movies")dt1 = ("tickets")dt11 = ("Movies")Catch
28、 ex As ExceptionEnd TryTryIfThen(" 還未出售! ")= (0)("palydate") revoke_seat()ElseShowSellInfo(dt1)= (0)("palydate")End IfCatch ex As ExceptionEnd Try()End SubPrivate Sub Button2_Click_1(ByVal sender As , ByVal e As HandlesDim tickethao As IntegerDim mydataadapter4 As NewSq
29、lDataAdapterDim myds4 As NewDataSetDim dt4 As NewDataTableDim mycom4 As NewSqlCommandDim mycon4 As NewSqlConnectionTry= "initial catalog=ticketbooking;user id=sa;password=;"=mycon4'通過MYCON連接對象操作數(shù)據(jù)庫= ' 設(shè)置命令類型tickethao = tuipiao()Catch ex As ExceptionEnd TryIf tickethao = 0 Then(&quo
30、t; 座位號輸入錯誤,請重新輸入!", " 錯誤 ")ElseTry()CStr(tickethao) + ""= "delete from tickets where ticketsid=" +(" 退票成功! ", " 謝謝觀看 ")Catch ex As ExceptionMsgBoxEnd TryCatch ex As ExceptionMsgBoxEnd TryEnd If() III! III! III! III! III! III!revoke_seat()End Sub
31、Private Sub Button3_Click_1( ByVal sender As , ByVal e As HandlesIf = "" Then(" 請輸入座位號! ", " 提示 ")End IDim mydataadapter2 As NewSqlDataAdapterDim myds2 As NewDataSetDim dt2 As NewDataTableDim mycom2 As NewSqlCommand= "initial catalog=ticketbooking;user id=sa;passwo
32、rd=;"=mycon'通過MYCON連接對象操作數(shù)據(jù)庫= ' 設(shè)置命令類型Try()= "select * from seats where seatid=" + + ""= mycom2(myds2, "seats")dt2 = ("seats")Catch ex As ExceptionEnd Try= (0)("price")()End SubPrivate Sub Button4_Click( ByVal sender As , ByVal e As Hand
33、lesDim exitform As NewForm7If = Then()()()End IfEnd SubEnd Class4 創(chuàng)建檢票界面1)創(chuàng)建模塊的功能 對進(jìn)場觀眾檢票,如果發(fā)現(xiàn)有假票或無票觀眾不允許入內(nèi)。2)創(chuàng)建模塊的窗體 在工程中添加一個窗體,命名為“檢票系統(tǒng)”,用來作為檢票系統(tǒng)窗體。界面 的設(shè)計如下圖所示。3)代碼編寫ImportsPublic Class Form3InheritsDim ds1 As NewDataSetDim sqlda1 As NewSqlDataAdapterDim RecordCount As IntegerPrivateSub Form3_Load
34、( ByVal sender As ,ByVal e As Handles實(shí)驗(yàn)運(yùn)行場 程序設(shè)計 電影院票務(wù)系統(tǒng)檢票界面 .swf"()實(shí)驗(yàn)運(yùn)行場 程序設(shè)計 電影院票務(wù)系統(tǒng)檢票界面下 .swf"()Dim sqlcmd1 As NewSqlCommandDim str1 As String = "select * from tickets"= sqlcn1= str1= sqlcmd1Try()()Catch ex As SqlExceptionMsgBoxFinally()End TryTry(ds1)Catch ex As SqlExceptionMs
35、gBoxEnd Try RecordCount = (0). = RecordCountEnd SubPrivate Sub Button1_Click_1(ByVal sender As ,ByVal e As HandlesDim i As IntegerDim flag As Boolean = FalseIf = "" Then= " 請認(rèn)真填寫票號!()Exit SubEnd IfIf = "" Then= " 請?zhí)顚戲?yàn)證碼!()ExitSubEnd IfFor i = 0 To RecordCount - 1If = CS
36、tr (0).Rows(i)("ticketsid") flag = TrueExit ForEnd IfNextIf flag = True ThenTry= (0).Rows(i)("seatid")= (0).Rows(i)("movie_name")= (0).Rows(i)("price")Catch ex As ExceptionMsgBoxEnd Try= "此票為真! "Else= "此票為假! "End If= RecordCountEnd SubPriva
37、te Sub Button2_Click_1( ByVal sender III! III! III! III! III! III! III!()End SubPrivate Sub Button3_Click_1( ByVal senderAnd = CStr (0).Rows(i)("yanzhengma")As , ByVal e As HandlesAs , ByVal e As HandlesThenDim exitform As NewForm7If = Then()()()End IfEnd SubEnd Class5 創(chuàng)建維護(hù)界面(1)創(chuàng)建模塊的功能 給數(shù)據(jù)
38、庫維護(hù)工作人員選擇維護(hù)的系統(tǒng)數(shù)據(jù)庫(2)創(chuàng)建模塊的設(shè)計 在工程中添加一個窗體,命名為“維護(hù)系統(tǒng)”,用來作為維護(hù)系統(tǒng)窗體。界面 的設(shè)計如下圖所示。(3)代碼編寫Public Class Form8InheritsPrivate Sub Form8_Load( ByVal sender As , ByVal e As Handles實(shí)驗(yàn)運(yùn)行場 程序設(shè)計 電影院票務(wù)系統(tǒng) 登陸界面 .swf"()End SubPrivate Sub Button1_Click( ByVal sender As ,Dim frm4 As NewForm4()()End SubPrivate Sub Butto
39、n2_Click( ByVal sender As ,Dim frm6 As NewForm6()()End SubPrivate Sub Button3_Click( ByVal sender As ,Dim frm9 As NewForm9ByVal e As HandlesByVal e As HandlesByVal e As Handles()()End SubPrivate Sub Button4_Click( ByVal sender As ,Dim exitform As NewForm7ByVal e As HandlesIf = Then () () ()End IfEnd
40、 SubEnd Class1創(chuàng)建影庫界面1)創(chuàng)建模塊的功能對電影庫播放列表的管理2)創(chuàng)建模塊的設(shè)計在工程中添加一個窗體,命名為“影庫系統(tǒng)”,用來作為影庫系統(tǒng)窗體。界面的設(shè)計如下圖所示3)代碼編寫Dim sqlAdapter As NewSqlDataAdapterDim movieRow As DataRowDim RecordCount As IntegerDim i As Integer = 0Dim idnum(2000) As IntegerDim CurrentPositionAs IntegerSub ShowPosition()If RecordCount = 0 Then= &
41、quot; 無記錄 "ElseCurrentPosition = (DataSet11, "Movies").Position= ("movie_id")idnum(i) =i += 1= ("movie_name")= ("actor")= ("actress")= ("producer")= ("palydate")= CurrentPosition + 1 & "/" & RecordCountEnd I
42、fEnd SubPrivate Sub Form4_Load( ByVal sender As , ByVal e As ()ShowPosition()End SubPrivate Sub Button1_Click( ByVal sender As , ByVal e If (DataSet11, "Movies").Position > 0Then(DataSet11, "Movies").Position -= 1ShowPosition()Else(" 已到達(dá)首記錄! ", " 提示信息 ")End
43、 IfEnd SubPrivate Sub Button2_Click( ByVal sender As , ByVal e If (DataSet11, "Movies").Position < RecordCount - 1 (DataSet11, "Movies").Position += 1ShowPosition()Else(" 已到達(dá)尾記錄! ", " 提示信息 ")End IfEnd SubPrivate Sub Button4_Click( ByVal sender As , ByVal e
44、(DataSet11, "Movies").Position = RecordCount - 1 ShowPosition()HandlesAs HandlesAs HandlesThenAs HandlesEnd SubPrivate Sub Button5_Click( ByVal sender As , ByVal e As Handles ' 添加數(shù)據(jù)Dim j As IntegerDim flagAs Boolean = TrueFor j = 0To iIf =CStr (idnum(j)Thenflag =False("ID地址有沖突!&qu
45、ot;, " 提示 ")EndIfNextIf flag =True ThenDim MyNewData As DataRowTryWith MyNewData.BeginEdit()If <> "" Then.Item("movie_id") =Else(" 編號不能為空 ")Return End If.Item("movie_name") =.Item("actor") =.Item("actress") =.Item("prod
46、ucer") =.Item("palydate") =.EndEdit()End WithCatch ex As ExceptionReturnEnd TryTryDim i As Integer = (DataSet11, "Movies")()(i & "條記錄添加成功! ")Catch ex As ExceptionEnd Tryidnum(i) =i = i + 1End IfEnd SubPrivate Sub Button6_Click( ByVal sender As , ByVal e As Hand
47、les ' 修改數(shù)據(jù) Dim j As IntegerFor j = 0 To iIf = CStr (idnum(j) Then("ID 地址有沖突! ", " 提示 ")End IfNextCurrentPosition = (DataSet11, "Movies").PositionTryWith movieRow.BeginEdit().Item("movie_id") =.Item("movie_name") =.Item("actor") =.Item(&
48、quot;actress") =.Item("producer") =.Item("palydate") =.EndEdit()End WithCatch ex As ExceptionReturnEnd TryTryDim i As Integer = (DataSet11, "Movies")()(i & "條記錄修改成功! ")Catch ex As ExceptionEnd TryEnd SubPrivate Sub Button3_Click( ByVal sender As , ByV
49、al e As Handles(DataSet11, "Movies").Position = 0ShowPosition()End SubPrivate Sub Button7_Click( ByVal sender As , ByVal e As Handles ' 刪除數(shù)據(jù)CurrentPosition = (DataSet11, "Movies").PositionDim n As Integer = ("movie_id")Dim j As Integer = 0For j = 0 To iIf n = idnum(
50、j)Thenidnum(j) = -1End IfNext()TryDim i As Integer = (DataSet11, "Movies")()(i & "條記錄刪除成功! ")Catch ex As ExceptionEnd TryEnd SubPrivate Sub Button8_Click( ByVal sender As , ByVal e As HandlesDim exitform As NewForm7If = Then()()()End IfEnd SubPrivate Sub Button9_Click( ByVal
51、sender As , ByVal e As HandlesDim frm8 As NewForm8()()End SubEnd Class2創(chuàng)建職工界面(1) 創(chuàng)建模塊的功能 對職工數(shù)據(jù)的處理。如增加、刪除和更改(2) 創(chuàng)建模塊的設(shè)計 在工程中添加一個窗體,命名為“影庫系統(tǒng)”,用來作為影庫系統(tǒng)窗體。界面 的設(shè)計如下圖所示。(3) 代碼編寫InheritsDim frm8 As NewForm8Dim sqlAdapter As NewSqlDataAdapterDim movieRow As DataRowDim RecordCount As IntegerDim i As Integer
52、= 0Dim idnum(2000) As IntegerDim CurrentPositionAs IntegerSub ShowPosition()If RecordCount = 0 Then= " 無記錄 "ElseCurrentPosition = (DataSet11, "Workers").Position= ("workerid")idnum(i) =i += 1= ("password")= ("leibie")= CurrentPosition + 1 & "
53、;/" & RecordCountEnd IfEnd SubPrivate Sub Form6_Load( ByVal sender As , ByVal e As Handles()ShowPosition()End SubPrivate Sub Button1_Click( ByVal sender As , ByVal e As Handles If (DataSet11, "Workers").Position > 0Then(DataSet11, "Workers").Position -= 1ShowPosition(
54、)Else(" 已到達(dá)首記錄! ", " 提示信息 ")End IfEnd SubPrivate Sub Button2_Click( ByVal sender As , ByVal e As Handles If (DataSet11, "Workers").Position < RecordCount - 1Then(DataSet11, "Workers").Position += 1ShowPosition()Else(" 已到達(dá)尾記錄! ", " 提示信息 "
55、)End IfEnd SubPrivate Sub Button3_Click(ByVal senderAs ,ByVal eAsHandles(DataSet11, "Workers").Position= 0ShowPosition()End SubPrivate Sub Button4_Click(ByVal senderAs ,ByVal eAsHandles(DataSet11, "Workers").Position= RecordCount- 1ShowPosition()End SubPrivate Sub Button5_Click(B
56、yVal senderAs ,ByVal eAsHandlesDim j As IntegerDim flagAs Boolean = TrueFor j = 0To iIf =CStr (idnum(j)Thenflag =False("ID地址有沖突!", " 提示 ")End IfNextIf <> 1 And <> 2 And <> 3 Thenflag = False(" 服務(wù)系統(tǒng)號只能為 1,2,3!", " 提示")End IfIf flag = True Then
57、Dim MyNewData As DataRowTryWith MyNewData.BeginEdit()If <> "" Then.Item("workerid") =ElseReturnEnd If.Item("password") = .Item("leibie") = .EndEdit()End WithCatch ex As ExceptionReturnEnd TryTryDim k As Integer = (DataSet11, "Workers") ()(k &am
58、p; " 條記錄添加成功! ")Catch ex As ExceptionEnd Tryidnum(i) =i = i + 1End IfEnd SubHandlesPrivate Sub Button6_Click( ByVal sender As , ByVal e AsDim j AsIntegerFor j = 0To iIf =CStr (idnum(j)Then("ID地址有沖突!", " 提示 ")EndIfNextIf <> 1And <> 2 And<> 3 Then(" 服務(wù)系統(tǒng)號只能為 1,2,3!", " 提示") End IfCurrentPosition = (DataSet11, "Workers").PositionTryWith movieRow .BeginEdit() .Item(&
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 藥用甘草項目營銷計劃書
- 肚臍穿孔器械項目運(yùn)營指導(dǎo)方案
- 空貴金屬制粉餅盒細(xì)分市場深度研究報告
- 自行車曲柄市場發(fā)展前景分析及供需格局研究預(yù)測報告
- 醫(yī)用抗真菌霜產(chǎn)品供應(yīng)鏈分析
- 成比例的模型車產(chǎn)品供應(yīng)鏈分析
- 尿素合成塔產(chǎn)業(yè)鏈招商引資的調(diào)研報告
- 家用電凈水器產(chǎn)品供應(yīng)鏈分析
- 牛奶均質(zhì)機(jī)項目營銷計劃書
- 冰球守門員用保護(hù)墊產(chǎn)品供應(yīng)鏈分析
- 英語書寫標(biāo)準(zhǔn)三線格可A4紙雙面打印
- 《基礎(chǔ)會計學(xué)》教案(共70頁)
- 自己編制的表格-兩孔箱涵(結(jié)構(gòu)、配筋、裂縫、基底應(yīng)力)箱涵結(jié)構(gòu)計算(恒載+活載)
- 小型雕刻機(jī)結(jié)構(gòu)設(shè)計說明書
- 小流量多頭泵中文說明書C
- 最高法裁定:已付全款但尚未過戶的商品房可以對抗該房抵押權(quán)
- 管理經(jīng)濟(jì)學(xué)計算題及參考答案(已分類整理)
- 自噴漆(環(huán)氧乙烷)化學(xué)品安全技術(shù)說明書(MSDS)
- 全省各市及縣(市)城鎮(zhèn)土地使用稅地段等級劃分及稅額標(biāo)準(zhǔn)
- cpk原始數(shù)據(jù)生成器
- 金屬的磷酸鹽轉(zhuǎn)化膜
評論
0/150
提交評論