公交查詢(xún)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)(共20頁(yè))_第1頁(yè)
公交查詢(xún)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)(共20頁(yè))_第2頁(yè)
公交查詢(xún)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)(共20頁(yè))_第3頁(yè)
公交查詢(xún)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)(共20頁(yè))_第4頁(yè)
公交查詢(xún)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)(共20頁(yè))_第5頁(yè)
已閱讀5頁(yè),還剩16頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、裝訂線畢業(yè)設(shè)計(jì)(論文)報(bào)告紙共 頁(yè) 第 PAGE 21 頁(yè)公交查詢(xún)系統(tǒng)設(shè)計(jì)(shj)畢業(yè)論文信息工程系畢業(yè)設(shè)計(jì)(論文)誠(chéng)信(chn xn)承諾我謹(jǐn)在此承諾(chngnu):本人所寫(xiě)的畢業(yè)論文 公交查詢(xún)系統(tǒng)制作 ,系本人獨(dú)自完成,凡涉及其他作者的觀點(diǎn)和材料,均作了注釋與說(shuō)明,若有不實(shí),后果本人承擔(dān)。承諾人(簽名):2010年6 月1 日摘 要為推進(jìn)地名信息(xnx)服務(wù)工作,開(kāi)發(fā)(kif)的“南京(nn jn)市公交查詢(xún)系統(tǒng)”軟件(以下簡(jiǎn)稱(chēng)“本軟件”),用于提供快速的、簡(jiǎn)便的城市公交站點(diǎn)、線路查詢(xún)服務(wù),也可以用于制作地鐵、公路等交通信息查詢(xún)系統(tǒng)。本軟件的核心是對(duì)選擇好的車(chē)次進(jìn)行路線的查詢(xún),或者輸

2、入所要查詢(xún)的車(chē)站名,點(diǎn)擊“查詢(xún)”按鈕,查詢(xún)所有含有該站的車(chē)次及相應(yīng)的停靠站。此處既可以“精確查詢(xún)”也可以是“模糊查詢(xún)”,“模糊查詢(xún)”主要方便那些對(duì)站名不是很清楚,但知道其中的一部分的乘客,系統(tǒng)可以幫助他們快速的查出。本軟件用JSP作為開(kāi)發(fā)語(yǔ)言并結(jié)合SQL數(shù)據(jù)庫(kù),只要將公交站點(diǎn)等信息輸入數(shù)據(jù)庫(kù),就可以很快構(gòu)建成一個(gè)簡(jiǎn)單、實(shí)用的本地公交查詢(xún)系統(tǒng)。關(guān)鍵詞: JSP、 SQL數(shù)據(jù)庫(kù)、 車(chē)次管理, 公交查詢(xún)系統(tǒng)。English AbstractTo promote the geographical names information service work, I developed the Nanji

3、ng Public Transport Query System (hereinafter referred to as the Software), used to provide fast, convenient city bus stops, in line inquiry service can also be used to make subway, highway and other transportation information inquiry system.The core of this software is a good choice of trips to rou

4、tes of inquiry, or enter the station name to the query, click the Search button, check all the trips with the station and the corresponding stops.Here both Exact can be fuzzy query, Fuzzy query, the main benefit of those on the station were not clear, but that one part of the passenger, the system c

5、an help them quickly find out.This software is developed using JSP as a language and SQL database integration, as long as the bus stops and other information entered into the database, you can quickly build into a simple, practical system of local public transport inquiry。Keywords: JSP, SQL database

6、s, sell management, transit system.目錄 TOC o 1-3 h z u HYPERLINK l _Toc263929679 1 緒論(xln) PAGEREF _Toc263929679 h 5 HYPERLINK l _Toc263929680 11研發(fā)(yn f)的背景 PAGEREF _Toc263929680 h 5 HYPERLINK l _Toc263929681 12可行性分析(fnx) PAGEREF _Toc263929681 h 6 HYPERLINK l _Toc263929682 2需求分析 PAGEREF _Toc263929682

7、 h 6 HYPERLINK l _Toc263929683 21用戶(hù)功能需求分析 PAGEREF _Toc263929683 h 6 HYPERLINK l _Toc263929684 2.1.1所有乘客可以使用該系統(tǒng)進(jìn)行車(chē)次及路線的查詢(xún)。 PAGEREF _Toc263929684 h 7 HYPERLINK l _Toc263929685 2.1.2本系統(tǒng)應(yīng)具有簡(jiǎn)單易用功能強(qiáng)大特點(diǎn),有較強(qiáng)的糾錯(cuò)能力(隨著軟件的版本升級(jí)功能和糾錯(cuò)能力也可以不斷得到提高)。如果在網(wǎng)絡(luò)上運(yùn)行,應(yīng)有數(shù)據(jù)在線更新的能力以及在線查詢(xún)的能力。由于畢業(yè)設(shè)計(jì)時(shí)間有限,本系統(tǒng)沒(méi)有設(shè)計(jì)成網(wǎng)絡(luò)運(yùn)行版的,在以后的時(shí)間會(huì)進(jìn)一步完善

8、該系統(tǒng)。 PAGEREF _Toc263929685 h 7 HYPERLINK l _Toc263929686 2.1.3由于車(chē)次經(jīng)常會(huì)變化所以需要一個(gè)管理員身份去管理這個(gè)公交查詢(xún)系統(tǒng)方便更改車(chē)次的信息以及車(chē)輛的出行線路。 PAGEREF _Toc263929686 h 7 HYPERLINK l _Toc263929687 22系統(tǒng)功能分析 PAGEREF _Toc263929687 h 7 HYPERLINK l _Toc263929688 3系統(tǒng)總體結(jié)構(gòu)設(shè)計(jì) PAGEREF _Toc263929688 h 7 HYPERLINK l _Toc263929689 31模塊結(jié)構(gòu)設(shè)計(jì) PAG

9、EREF _Toc263929689 h 7 HYPERLINK l _Toc263929690 32數(shù)據(jù)庫(kù)設(shè)計(jì) PAGEREF _Toc263929690 h 7 HYPERLINK l _Toc263929691 4系統(tǒng)詳細(xì)設(shè)計(jì) PAGEREF _Toc263929691 h 8 HYPERLINK l _Toc263929692 4.1代碼設(shè)計(jì) PAGEREF _Toc263929692 h 8 HYPERLINK l _Toc263929693 4.2人機(jī)界面設(shè)計(jì) PAGEREF _Toc263929693 h 8 HYPERLINK l _Toc263929694 4.3本系統(tǒng)的界面

10、和源代碼 PAGEREF _Toc263929694 h 10 HYPERLINK l _Toc263929695 4.31 管 理 員 登 陸 成 功 界 面 PAGEREF _Toc263929695 h 10 HYPERLINK l _Toc263929697 4.3.2 公 交 信 息 修 改 界 面 PAGEREF _Toc263929697 h 13 HYPERLINK l _Toc263929699 4.3.3 公 交 查 詢(xún) 信 息 界 面 PAGEREF _Toc263929699 h 14 HYPERLINK l _Toc263929700 4.3.4 公 交 職 員 管

11、理 界 面 PAGEREF _Toc263929700 h 16 HYPERLINK l _Toc263929701 5系 統(tǒng) 難 點(diǎn) 分 析 PAGEREF _Toc263929701 h 19 HYPERLINK l _Toc263929702 6結(jié) 論 PAGEREF _Toc263929702 h 20 HYPERLINK l _Toc263929703 7致 謝 PAGEREF _Toc263929703 h 20 HYPERLINK l _Toc263929704 8 參考文獻(xiàn) PAGEREF _Toc263929704 h 211 緒論(xln)隨著我國(guó)經(jīng)濟(jì)的高速發(fā)展,人們生活水

12、平的提高,越來(lái)越多的人開(kāi)始熱衷于到外地(wid)旅游。那么對(duì)于這些外來(lái)(wili)旅游者,首先搞清這個(gè)城市的公交路線顯的很重要!南京,作為一個(gè)六朝古都,每年都要吸引大量的游客,為了方便廣大游客,我的畢業(yè)設(shè)計(jì)就以公交查詢(xún)系統(tǒng)做為設(shè)計(jì)課題。我認(rèn)為這樣的系統(tǒng)應(yīng)該具有很好的實(shí)用性!乘客只需選擇車(chē)次或輸入要查詢(xún)的站點(diǎn),系統(tǒng)會(huì)快速的給出結(jié)果,同時(shí)管理員也可以很容易的修改車(chē)次。正是基于這樣的目的我開(kāi)發(fā)了公交查詢(xún)系統(tǒng)。下面就根據(jù)軟件工程理論的規(guī)范要求對(duì)軟件的開(kāi)發(fā)背景、意義、需求分析等方面進(jìn)行分析:11研發(fā)的背景城市規(guī)模的逐步擴(kuò)大,也使整個(gè)城市的交通干道越來(lái)越復(fù)雜,在這種情況下,公交查詢(xún)系統(tǒng)顯的非常的方便和高效

13、,在這個(gè)背景下我開(kāi)發(fā)了公交查詢(xún)系統(tǒng)。本系統(tǒng)的開(kāi)發(fā)有很大的社會(huì)意義,能給廣大市民提供極大的方便。12可行性分析可行性分析是對(duì)系統(tǒng)進(jìn)行全面、概要的分析。它的任務(wù)是確定項(xiàng)目開(kāi)發(fā)時(shí)是否必要和可行。它的主要目標(biāo)是:進(jìn)一步明確系統(tǒng)的目標(biāo)、規(guī)模和功能,對(duì)系統(tǒng)開(kāi)發(fā)背景、必要性和意義進(jìn)行調(diào)查分析,并且提出系統(tǒng)的邏輯模型和各種可能的方案,從而為系統(tǒng)開(kāi)發(fā)項(xiàng)目的決策提供科學(xué)依據(jù)。主要從三個(gè)方面進(jìn)行研究:(1)技術(shù)可行性:以現(xiàn)有技術(shù)進(jìn)行系統(tǒng)開(kāi)發(fā)及系統(tǒng)實(shí)施,是完全可行的。首先,從自身來(lái)分析,經(jīng)過(guò)2年多的學(xué)習(xí)已經(jīng)初步掌握了JSP控件、SQL數(shù)據(jù)庫(kù)等方面的編程技巧,對(duì)該軟件的設(shè)計(jì)并不存在技術(shù)上的難點(diǎn)。第二方面,在設(shè)計(jì)這個(gè)系統(tǒng)

14、之前,我進(jìn)行了一系列先期調(diào)研,查閱了有關(guān)使用JSP進(jìn)行數(shù)據(jù)庫(kù)開(kāi)發(fā)方面的論著、教材和論文,更多是利用網(wǎng)絡(luò)的便利條件,從網(wǎng)上查閱了北京、上海、廣州、昆明等大型城市的公交查詢(xún)系統(tǒng),并認(rèn)真地對(duì)其進(jìn)行了分析研究,由于時(shí)間緊,任務(wù)重,我沒(méi)有更多的時(shí)間來(lái)開(kāi)發(fā)完整的系統(tǒng),所以就以查詢(xún)作為這個(gè)系統(tǒng)的核心。其次,從數(shù)據(jù)庫(kù)方面來(lái)分析,也是可行的。系統(tǒng)所建立的數(shù)據(jù)庫(kù)表中包含有五個(gè)字段:bus_number,bus_station1, bus_station2, bus_station3, bus_station4。bus_number用來(lái)存放車(chē)次,bus_station1, bus_station2, bus_sta

15、tion3, bus_station4這四個(gè)字段用來(lái)存放站點(diǎn)。(2)經(jīng)濟(jì)可行性:從這方面來(lái)說(shuō),本系統(tǒng)的開(kāi)發(fā)作為課題來(lái)說(shuō)不需要什么經(jīng)濟(jì)投入,因此來(lái)說(shuō)也是可行的。(3)營(yíng)運(yùn)可行性:國(guó)內(nèi)很早就開(kāi)始應(yīng)用公交查詢(xún)系統(tǒng),我國(guó)大部分城市都有公交查詢(xún)系統(tǒng)。那么從這方面來(lái)說(shuō)是可行的。2需求(xqi)分析隨著我國(guó)經(jīng)濟(jì)的高速(o s)發(fā)展,人們生活水平的提高,越來(lái)越多的人開(kāi)始熱衷于到外地旅游。那么對(duì)于這些外來(lái)旅游者,首先搞清這個(gè)城市的公交路線顯的很重要(zhngyo)!南京,作為一個(gè)六朝古都,每年都要吸引大量的游客,為了滿足這些游客熟悉公交路線的需求,特以公交查詢(xún)系統(tǒng)為設(shè)計(jì)課題。本軟件不僅能給游客帶來(lái)方便,也能給廣

16、大市民提供方便。我認(rèn)為這樣的系統(tǒng)應(yīng)該具有很好的實(shí)用性!開(kāi)發(fā)本系統(tǒng)的目標(biāo)就是立足廣大乘客的實(shí)際,著眼于公交業(yè)的未來(lái)發(fā)展,規(guī)范公交管理,提高服務(wù)質(zhì)量,方便乘客查詢(xún),并為此設(shè)計(jì)該系統(tǒng)。21用戶(hù)功能需求分析2.1.1所有乘客可以使用該系統(tǒng)進(jìn)行車(chē)次及路線的查詢(xún)。2.1.2本系統(tǒng)應(yīng)具有簡(jiǎn)單易用功能強(qiáng)大特點(diǎn),有較強(qiáng)的糾錯(cuò)能力(隨著軟件的版本升級(jí)功能和糾錯(cuò)能力也可以不斷得到提高)。如果在網(wǎng)絡(luò)上運(yùn)行,應(yīng)有數(shù)據(jù)在線更新的能力以及在線查詢(xún)的能力。由于畢業(yè)設(shè)計(jì)時(shí)間有限,本系統(tǒng)沒(méi)有設(shè)計(jì)成網(wǎng)絡(luò)運(yùn)行版的,在以后的時(shí)間會(huì)進(jìn)一步完善該系統(tǒng)。2.1.3由于車(chē)次經(jīng)常會(huì)變化所以需要一個(gè)管理員身份去管理這個(gè)公交查詢(xún)系統(tǒng)方便更改車(chē)次的信

17、息以及車(chē)輛的出行線路。22系統(tǒng)功能分析本系統(tǒng)提供了的車(chē)次查詢(xún)功能、路線查詢(xún)功能。乘客可以方便的進(jìn)行查詢(xún),以防乘錯(cuò)車(chē)次。同時(shí)管理員身份方便管理車(chē)輛的車(chē)次和出行線路。當(dāng)然有些功能的智能化不是很強(qiáng),系統(tǒng)有待進(jìn)一步來(lái)完善。也希望老師及朋友給予指導(dǎo),提出您們的建議!在此,先向您們表示感謝!3系統(tǒng)(xtng)總體結(jié)構(gòu)設(shè)計(jì)本系統(tǒng)采用結(jié)構(gòu)化設(shè)計(jì)的方法來(lái)實(shí)現(xiàn)系統(tǒng)總體功能,提高系統(tǒng)的各項(xiàng)指標(biāo),即將整個(gè)系統(tǒng)合理的劃分成各個(gè)功能模塊,正確地處理模塊之間和模塊內(nèi)部的聯(lián)系以及和數(shù)據(jù)庫(kù)的聯(lián)系,定義(dngy)各模塊的內(nèi)部結(jié)構(gòu),通過(guò)對(duì)模塊的設(shè)計(jì)和模塊之間關(guān)系的系統(tǒng)來(lái)實(shí)現(xiàn)整個(gè)系統(tǒng)的功能31模塊(m kui)結(jié)構(gòu)設(shè)計(jì)本系統(tǒng)共分兩

18、個(gè)模塊:(1)車(chē)次查詢(xún)模塊:車(chē)次查詢(xún)模塊主要實(shí)現(xiàn)選擇好車(chē)次后,得到相應(yīng)車(chē)次的路線的功能;(2)路線查詢(xún)模塊:路線查詢(xún)模塊中,既可以進(jìn)行精確查詢(xún),也可以進(jìn)行模糊查詢(xún),當(dāng)乘客不知道確切的站名時(shí),只要輸入其中的一個(gè)或多個(gè)字就可以進(jìn)行查詢(xún)。32數(shù)據(jù)庫(kù)設(shè)計(jì)本系統(tǒng)的數(shù)據(jù)庫(kù)設(shè)計(jì),采用了SQL進(jìn)行數(shù)據(jù)庫(kù)設(shè)計(jì)。通過(guò)對(duì)市場(chǎng)的調(diào)查,建立一個(gè)bus數(shù)據(jù)庫(kù)已能滿足要求,本數(shù)據(jù)庫(kù)中的bus表中,建立了五個(gè)字段:bus_number,bus_station1, bus_station2, bus_station3, bus_station4。結(jié)構(gòu)如下:表中bus_number用來(lái)保存車(chē)次,數(shù)據(jù)類(lèi)型定義為數(shù)字;bus_sta

19、tion1, bus_station2, bus_station3, bus_station4用來(lái)保存站點(diǎn),類(lèi)型定義為文本,但對(duì)于文本屬性來(lái)說(shuō)每個(gè)字段的最大長(zhǎng)度為 255,超過(guò)這個(gè)長(zhǎng)度系統(tǒng)不予顯示,因此設(shè)四個(gè)字段來(lái)控制,便于以后數(shù)據(jù)的擴(kuò)充。這里如果用一個(gè)字段來(lái)放站點(diǎn),當(dāng)向字段錄入數(shù)據(jù)時(shí),系統(tǒng)不會(huì)提示數(shù)據(jù)已滿,但程序執(zhí)行后,顯示“數(shù)據(jù)源被截?cái)唷保盟膫€(gè)字段來(lái)放站點(diǎn),只要每個(gè)字段錄入數(shù)據(jù)不超過(guò)規(guī)定的最大值就避免了以上錯(cuò)誤的發(fā)生。數(shù)據(jù)庫(kù)結(jié)構(gòu)如何設(shè)計(jì)無(wú)疑在整個(gè)系統(tǒng)設(shè)計(jì)中占有重要的地位,所以我們?cè)陂_(kāi)發(fā)一個(gè)系統(tǒng)之前,一定要考慮好數(shù)據(jù)庫(kù)該怎么設(shè)計(jì),怎么樣設(shè)計(jì)方便接口實(shí)現(xiàn)和界面顯示。當(dāng)然也可以采用另外的組織

20、方式,只要滿足一定的規(guī)則,符合條件并且有利于編程的實(shí)現(xiàn),都可以采用。4系統(tǒng)(xtng)詳細(xì)設(shè)計(jì)4.1代碼(di m)設(shè)計(jì)采用dreamweaver工具開(kāi)發(fā)客戶(hù)端用戶(hù)體驗(yàn),制作(zhzu)JSP網(wǎng)頁(yè)然后使用Tomcat作為服務(wù)器連接SQL數(shù)據(jù)庫(kù)4.2人機(jī)界面設(shè)計(jì)、Imports System.Data.SqlClientImports System.IOPublic Class Login Private sqlobject As SQL_Conn Private cmdstr As String Private Sub Button2_Click(ByVal sender As System.

21、Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cmdstr = select * from user where user_id = + TextBox1.Text + and pwd= + TextBox2.Text + and style= + ComboBox1.Te

22、xt + Try If sqlobject.Is_SQL_Cmd(cmdstr) Then main.m_Login = True main.m_style = ComboBox1.Text main.main_Load(sender, e) zhiyuanguanli.userid = TextBox1.Text MsgBox(ComboBox1.Text + 成功(chnggng)登陸) main.ToolStripStatusLabel1.Text = 就緒(jix) Me.Close() Else MsgBox(請(qǐng)?zhí)顚?xiě)正確的用戶(hù)名、密碼(m m)和用戶(hù)類(lèi)型!) End If Catch

23、 ex As Exception main.OPErr.WriteErr(ex) End Try End Sub Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.SelectedIndex = 0 sqlobject = New SQL_Conn Me.MdiParent = main End SubEnd Class4.3本系統(tǒng)的界面和源代碼4.31 管 理 員 登 陸 成 功 界 面Imports System.W

24、indows.FormsPublic Class main Public m_Login As Boolean = False Public m_style As String Public OPErr As New OutputErr Private sqlobject As SQL_Conn Private CmdStr As String Public Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If m_Login = False Then M

25、e.公交(n jio)信息ToolStripMenuItem.Enabled = False Me.條件(tiojin)查詢(xún)ToolStripMenuItem.Enabled = False Me.職員(zhyun)管理ToolStripMenuItem.Enabled = False Me.登錄ToolStripMenuItem.Enabled = True Me.注銷(xiāo)ToolStripMenuItem.Enabled = False Me.ToolStripButton6.Enabled = True Me.ToolStripButton7.Enabled = False Me.ToolS

26、tripButton1.Enabled = False Me.ToolStripButton5.Enabled = False Me.ToolStripButton8.Enabled = False login.MdiParent = Me login.Show() Else Me.公交信息ToolStripMenuItem.Enabled = True Me.條件查詢(xún)ToolStripMenuItem.Enabled = True Me.登錄ToolStripMenuItem.Enabled = False Me.注銷(xiāo)ToolStripMenuItem.Enabled = True Me.T

27、oolStripButton6.Enabled = False Me.ToolStripButton7.Enabled = True Me.ToolStripButton1.Enabled = True Me.ToolStripButton5.Enabled = True Me.ToolStripButton8.Enabled = True If m_style = 管理員 Then Me.公交信息ToolStripMenuItem.Enabled = True Me.條件查詢(xún)ToolStripMenuItem.Enabled = True Me.職員管理ToolStripMenuItem.E

28、nabled = True ElseIf m_style = 職員 Then Me.公交信息ToolStripMenuItem.Enabled = True Me.條件查詢(xún)ToolStripMenuItem.Enabled = True Me.職員管理ToolStripMenuItem.Enabled = False End If End If End Sub Private Sub 退出ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 退出ToolStripM

29、enuItem.Click Me.Close() End Sub Private Sub 注銷(xiāo)ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 注銷(xiāo)ToolStripMenuItem.Click Me.m_style = Me.m_Login = False For Each ChildForm As Form In Me.MdiChildren ChildForm.Close() Next main_Load(sender, e) Login.Show() M

30、e.ToolStripStatusLabel1.Text = 登錄(dn l) End Sub Private Sub ToolStripButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton7.Click Me.m_style = Me.m_Login = False For Each ChildForm As Form In Me.MdiChildren ChildForm.Close() Next main_Load(sender, e) Login

31、.Show() Me.ToolStripStatusLabel1.Text = 登錄(dn l) End Sub Private Sub 登錄(dn l)ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 登錄ToolStripMenuItem.Click Login.Show() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)

32、Handles Timer1.Tick Label1.Text = Now End Sub Private Sub ToolStripButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton6.Click Login.Show() End Sub Private Sub 添加ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

33、添加ToolStripMenuItem1.Click gongjiaoxinxixiugai.MdiParent = Me gongjiaoxinxixiugai.Show() End Sub Private Sub 查詢(xún)ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 查詢(xún)ToolStripMenuItem1.Click gongjiaoxinxichakan.MdiParent = Me gongjiaoxinxichakan.Show() End Sub

34、 Private Sub 預(yù)定查詢(xún)ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 預(yù)定查詢(xún)ToolStripMenuItem.Click shoumozhanchaxun.MdiParent = Me shoumozhanchaxun.Show() End Sub Private Sub 添加職員ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

35、 Handles 添加職員ToolStripMenuItem.Click zhiyuanguanli.MdiParent = Me zhiyuanguanli.Show() End Sub Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click gongjiaoxinxichakan.MdiParent = Me gongjiaoxinxichakan.Show() End Sub Private S

36、ub ToolStripButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton8.Click shoumozhanchaxun.MdiParent = Me shoumozhanchaxun.Show() End Sub Private Sub 使用(shyng)方法ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) MsgBox(點(diǎn)擊(di

37、n j)相應(yīng)的圖標(biāo)選擇需要的功能,選擇菜單、客戶(hù)等內(nèi)容時(shí),直接點(diǎn)擊數(shù)據(jù)表) End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click gongjiaoxinxixiugai.MdiParent = Me gongjiaoxinxixiugai.Show() End SubEnd Class4.3.2 公 交 信 息 修 改 界 面Imports 公交查詢(xún)Imports System.IO

38、Public Class gongjiaoxinxichakan Private row As Integer = -1 Private CmdStr As String Private sqlobject As SQL_Conn Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick If row e.RowIndex And e.RowIndex

39、= 0 Then row = e.RowIndex Label6.Text = Me.DataGridView1.Item(0, row).Value.ToString.Trim() Label7.Text = Me.DataGridView1.Item(1, row).Value.ToString.Trim() Label8.Text = Me.DataGridView1.Item(2, row).Value.ToString.Trim() Label9.Text = Me.DataGridView1.Item(3, row).Value.ToString.Trim() Label1.Tex

40、t = Me.DataGridView1.Item(0, row).Value.ToString.Trim() If Label1.Text Then CmdStr = select photo from gj where name= + Label1.Text + DisplayImg(CmdStr) Else : PictureBox1.Image = Nothing End If End If End Sub Private Sub kehuchaxun_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Ha

41、ndles MyBase.Load sqlobject = New SQL_Conn CmdStr = SELECT name as 線路(xinl)名稱(chēng),price as 費(fèi)用(fi yong)價(jià)格,efficacy as 首站地址(dzh),formula as 末站地址 FROM gj Try Me.DataGridView1.DataSource = sqlobject.SQL_Ada(CmdStr) Catch ex As Exception main.OPErr.WriteErr(ex) End Try Me.DataGridView1.AutoSizeColumnsMode =

42、DataGridViewAutoSizeColumnsMode.DisplayedCells End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Call kehuchaxun_Load(sender, e) End Sub Private Sub DisplayImg(ByVal str As String) sqlobject.SQL_Ada(str) If sqlobject.SQL_Ada(str).Rows(0).Item(0) Is DBNull.

43、Value Then PictureBox1.Image = Nothing Else Dim imgbyte() As Byte = sqlobject.SQL_Ada(str).Rows(0).Item(0) Dim imgmemory As New MemoryStream(imgbyte) PictureBox1.Image = Image.FromStream(imgmemory) End If End Sub Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)

44、 Handles Button1.Click End SubEnd Class4.3.3 公 交 查 詢(xún) 信 息 界 面Imports 公交查詢(xún)Imports System.IOPublic Class gongjiaoxinxichakan Private row As Integer = -1 Private CmdStr As String Private sqlobject As SQL_Conn Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.Dat

45、aGridViewCellEventArgs) Handles DataGridView1.CellClick If row e.RowIndex And e.RowIndex = 0 Then row = e.RowIndex Label6.Text = Me.DataGridView1.Item(0, row).Value.ToString.Trim() Label7.Text = Me.DataGridView1.Item(1, row).Value.ToString.Trim() Label8.Text = Me.DataGridView1.Item(2, row).Value.ToS

46、tring.Trim() Label9.Text = Me.DataGridView1.Item(3, row).Value.ToString.Trim() Label1.Text = Me.DataGridView1.Item(0, row).Value.ToString.Trim() If Label1.Text Then CmdStr = select photo from gj where name= + Label1.Text + DisplayImg(CmdStr) Else : PictureBox1.Image = Nothing End If End If End Sub P

47、rivate Sub kehuchaxun_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load sqlobject = New SQL_Conn CmdStr = SELECT name as 線路(xinl)名稱(chēng),price as 費(fèi)用(fi yong)價(jià)格,efficacy as 首站地址(dzh),formula as 末站地址 FROM gj Try Me.DataGridView1.DataSource = sqlobject.SQL_Ada(CmdStr) Catc

48、h ex As Exception main.OPErr.WriteErr(ex) End Try Me.DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Call kehuchaxun_Load(sender, e) End Sub Private Sub DisplayImg(ByVal s

49、tr As String) sqlobject.SQL_Ada(str) If sqlobject.SQL_Ada(str).Rows(0).Item(0) Is DBNull.Value Then PictureBox1.Image = Nothing Else Dim imgbyte() As Byte = sqlobject.SQL_Ada(str).Rows(0).Item(0) Dim imgmemory As New MemoryStream(imgbyte) PictureBox1.Image = Image.FromStream(imgmemory) End If End Su

50、b Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End SubEnd Class4.3.4 公 交 職 員 管 理 界 面Imports 公交查詢(xún)Imports System.IOPublic Class zhiyuanguanli Public userid As String Private row As Integer = -1 Private CmdStr As String Private Cmd As Str

51、ing Private sqlobject As SQL_Conn Private Sub zhiyuanguanli_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load sqlobject = New SQL_Conn CmdStr = SELECT user_id as 登陸(dng l)賬號(hào),style as 員工(yungng)級(jí)別,id as 身份證號(hào),name as 職工(zhgng)姓名,tel as 聯(lián)系方式 FROM user Try Me.DataGridV

52、iew1.DataSource = sqlobject.SQL_Ada(CmdStr) Catch ex As Exception main.OPErr.WriteErr(ex) End Try Me.DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

53、CmdStr = SELECT user_id FROM user where user_id= + TextBox1.Text + Cmd = SELECT id FROM user where id= + TextBox4.Text + If TextBox1.Text = Then MsgBox(請(qǐng)輸入登陸賬號(hào)) TextBox1.Focus() ElseIf sqlobject.Is_SQL_Cmd(CmdStr) Then MsgBox(該登陸賬號(hào)已經(jīng)存在) TextBox1.Focus() ElseIf TextBox2.Text = Then MsgBox(請(qǐng)輸入(shr)密碼)

54、 TextBox2.Focus() ElseIf TextBox2.Text TextBox3.Text Then MsgBox(兩次密碼(m m)不一致) TextBox2.Focus() TextBox3.Focus() ElseIf ComboBox1.Text = 請(qǐng)選擇(xunz) Then MsgBox(請(qǐng)選擇級(jí)別) TextBox1.Focus() ElseIf TextBox4.Text = Then MsgBox(請(qǐng)輸入身份證號(hào)) TextBox4.Focus() ElseIf sqlobject.Is_SQL_Cmd(Cmd) Then MsgBox(該員工已經(jīng)存在) Te

55、xtBox4.Focus() ElseIf TextBox5.Text = Then MsgBox(請(qǐng)輸入姓名) TextBox5.Focus() ElseIf TextBox6.Text = Then MsgBox(請(qǐng)輸入聯(lián)系方式) TextBox6.Focus() Else CmdStr = insert into user (user_id,pwd,style,id,name,tel,money)VALUES( + TextBox1.Text + , + TextBox2.Text + , + ComboBox1.Text + , + TextBox4.Text + , + TextBo

56、x5.Text + , + TextBox6.Text + , + 0 + ) Try sqlobject.ExecCmd(CmdStr) MsgBox(添加成功) Call zhiyuanguanli_Load(sender, e) TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = TextBox5.Text = TextBox6.Text = ComboBox1.Text = 請(qǐng)選擇 Catch ex As Exception main.OPErr.WriteErr(ex) End Try End If End

57、Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim i As Integer Dim j As String j = 管理員 If TextBox4.Text = Then MsgBox(請(qǐng)選擇要?jiǎng)h除的員工) Else If ComboBox1.Text = 管理員 Then CmdStr = select Style from user where Style= + j + i = sqlobject.SQL_Ad

58、a(CmdStr).Rows.Count If i 1 Then CmdStr = delete from user where id= + TextBox4.Text + Try sqlobject.ExecCmd(CmdStr) If TextBox1.Text = userid Then MsgBox(刪除(shnch)成功,請(qǐng)重新(chngxn)登錄) main.m_style = main.m_Login = False For Each ChildForm As Form In Me.MdiChildren ChildForm.Close() Next main.main_Load

59、(sender, e) Login.Show() main.ToolStripStatusLabel1.Text = 登錄(dn l) Me.Close() Else MsgBox(刪除成功) End If Catch ex As Exception main.OPErr.WriteErr(ex) End Try Else : MsgBox(至少保留一個(gè)管理員用戶(hù)) End If Else CmdStr = delete from user where id= + TextBox4.Text + Try sqlobject.ExecCmd(CmdStr) MsgBox(刪除成功) Catch

60、ex As Exception main.OPErr.WriteErr(ex) End Try End If End If Call zhiyuanguanli_Load(sender, e) TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = TextBox5.Text = TextBox6.Text = ComboBox1.Text = 請(qǐng)選擇 End Sub Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論