版權(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)告紙公交查詢(xún)系統(tǒng)設(shè)計(jì)畢業(yè)論文信息工程系畢業(yè)設(shè)計(jì)(論文)誠(chéng)信承諾我謹(jǐn)在此承諾:本人所寫(xiě)的畢業(yè)論文 公交查詢(xún)系統(tǒng)制作 ,系本人獨(dú)自完成,凡涉及其他作者的觀點(diǎn)和材料,均作了注釋與說(shuō)明,若有不實(shí),后果本人承擔(dān)。承諾人(簽名):2010年6 月1 日摘 要為推進(jìn)地名信息服務(wù)工作,開(kāi)發(fā)的“南京市公交查詢(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),或者輸入所要查詢(xún)的車(chē)站名,點(diǎn)擊“查詢(xún)”按鈕,查詢(xún)所有含有該站的車(chē)次及相應(yīng)的停靠站。此處既可以“精確查詢(xún)”也可以是
2、“模糊查詢(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 "Nanjing Public Transport Query System" (hereina
3、fter 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 routes of inquiry, o
4、r 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 on
5、e part of the passenger, the system can 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 tr
6、ansport inquiry。Keywords: JSP, SQL databases, sell management, transit system.目 錄1 緒論511 研發(fā)的背景512 可行性分析62 需求分析621 用戶(hù)功能需求分析62.1.1 所有乘客可以使用該系統(tǒng)進(jìn)行車(chē)次及路線的查詢(xún)。72.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ì)
7、成網(wǎng)絡(luò)運(yùn)行版的,在以后的時(shí)間會(huì)進(jìn)一步完善該系統(tǒng)。72.1.3由于車(chē)次經(jīng)常會(huì)變化所以需要一個(gè)管理員身份去管理這個(gè)公交查詢(xún)系統(tǒng)方便更改車(chē)次的信息以及車(chē)輛的出行線路。722 系統(tǒng)功能分析73 系統(tǒng)總體結(jié)構(gòu)設(shè)計(jì)731 模塊結(jié)構(gòu)設(shè)計(jì)732 數(shù)據(jù)庫(kù)設(shè)計(jì)74 系統(tǒng)詳細(xì)設(shè)計(jì)84.1 代碼設(shè)計(jì)84.2 人機(jī)界面設(shè)計(jì)84.3 本系統(tǒng)的界面和源代碼104.31 管 理 員 登 陸 成 功 界 面104.3.2 公 交 信 息 修 改 界 面134.3.3 公 交 查 詢(xún) 信 息 界 面144.3.4 公 交 職 員 管 理 界 面165
8、 系 統(tǒng) 難 點(diǎn) 分 析196結(jié) 論207致 謝208 參考文獻(xiàn)211 緒論隨著我國(guó)經(jīng)濟(jì)的高速發(fā)展,人們生活水平的提高,越來(lái)越多的人開(kāi)始熱衷于到外地旅游。那么對(duì)于這些外來(lái)旅游者,首先搞清這個(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
9、研發(fā)的背景城市規(guī)模的逐步擴(kuò)大,也使整個(gè)城市的交通干道越來(lái)越復(fù)雜,在這種情況下,公交查詢(xún)系統(tǒng)顯的非常的方便和高效,在這個(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年多
10、的學(xué)習(xí)已經(jīng)初步掌握了JSP控件、SQL數(shù)據(jù)庫(kù)等方面的編程技巧,對(duì)該軟件的設(shè)計(jì)并不存在技術(shù)上的難點(diǎn)。第二方面,在設(shè)計(jì)這個(gè)系統(tǒng)之前,我進(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_
11、station4。bus_number用來(lái)存放車(chē)次,bus_station1, bus_station2, bus_station3, 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 需求分析隨著我國(guó)經(jīng)濟(jì)的高速發(fā)展,人們生活水平的提高,越來(lái)越多的人開(kāi)始熱衷于到外地旅游。那么對(duì)于這些外來(lái)旅游者,首先搞清這個(gè)城市的公交路線顯的很重要!南京,作為一個(gè)六朝古都,每年都要吸引大量的游客,為
12、了滿(mǎn)足這些游客熟悉公交路線的需求,特以公交查詢(xún)系統(tǒng)為設(shè)計(jì)課題。本軟件不僅能給游客帶來(lái)方便,也能給廣大市民提供方便。我認(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ì)成
13、網(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ē)次的信息以及車(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)總體結(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)系以及和
14、數(shù)據(jù)庫(kù)的聯(lián)系,定義各模塊的內(nèi)部結(jié)構(gòu),通過(guò)對(duì)模塊的設(shè)計(jì)和模塊之間關(guān)系的系統(tǒng)來(lái)實(shí)現(xiàn)整個(gè)系統(tǒng)的功能31 模塊結(jié)構(gòu)設(shè)計(jì)本系統(tǒng)共分兩個(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ù)已能滿(mǎn)足要求,本數(shù)據(jù)庫(kù)中的bus表中,建立了五個(gè)字段:bus_number,bus_station1, bus_statio
15、n2, bus_station3, bus_station4。結(jié)構(gòu)如下:表中bus_number用來(lái)保存車(chē)次,數(shù)據(jù)類(lèi)型定義為數(shù)字;bus_station1, 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ù)已滿(mǎn),但程序執(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ú)疑在整
16、個(gè)系統(tǒng)設(shè)計(jì)中占有重要的地位,所以我們?cè)陂_(kāi)發(fā)一個(gè)系統(tǒng)之前,一定要考慮好數(shù)據(jù)庫(kù)該怎么設(shè)計(jì),怎么樣設(shè)計(jì)方便接口實(shí)現(xiàn)和界面顯示。當(dāng)然也可以采用另外的組織方式,只要滿(mǎn)足一定的規(guī)則,符合條件并且有利于編程的實(shí)現(xiàn),都可以采用。4 系統(tǒng)詳細(xì)設(shè)計(jì)4.1 代碼設(shè)計(jì)采用dreamweaver工具開(kāi)發(fā)客戶(hù)端用戶(hù)體驗(yàn),制作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 Pr
17、ivate cmdstr As String Private Sub Button2_Click(ByVal sender As System.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 us
18、er_id ='" + TextBox1.Text + "' and pwd= '" + TextBox2.Text + "' and style= '" + ComboBox1.Text + "'" Try If sqlobject.Is_SQL_Cmd(cmdstr) Then main.m_Login = True main.m_style = ComboBox1.Text main.main_Load(sender, e) zhiyuanguanli.userid =
19、TextBox1.Text MsgBox(ComboBox1.Text + "成功登陸") main.ToolStripStatusLabel1.Text = "就緒" Me.Close() Else MsgBox("請(qǐng)?zhí)顚?xiě)正確的用戶(hù)名、密碼和用戶(hù)類(lèi)型!") End If Catch ex As Exception main.OPErr.WriteErr(ex) End Try End Sub Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System
20、.EventArgs) Handles MyBase.Load ComboBox1.SelectedIndex = 0 sqlobject = New SQL_Conn Me.MdiParent = main End SubEnd Class4.3 本系統(tǒng)的界面和源代碼4.31 管 理 員 登 陸 成 功 界 面Imports System.Windows.FormsPublic Class main Public m_Login As Boolean = False Public m_style As String Public OPErr As New OutputErr Pri
21、vate 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 Me.公交信息ToolStripMenuItem.Enabled = False Me.條件查詢(xún)ToolStripMenuItem.Enabled = False Me.職員管理ToolStripMenuItem.Enabled = False
22、Me.登錄ToolStripMenuItem.Enabled = True Me.注銷(xiāo)ToolStripMenuItem.Enabled = False Me.ToolStripButton6.Enabled = True Me.ToolStripButton7.Enabled = False Me.ToolStripButton1.Enabled = False Me.ToolStripButton5.Enabled = False Me.ToolStripButton8.Enabled = False login.MdiParent = Me login.Show() Else Me.公交
23、信息ToolStripMenuItem.Enabled = True Me.條件查詢(xún)ToolStripMenuItem.Enabled = True Me.登錄ToolStripMenuItem.Enabled = False Me.注銷(xiāo)ToolStripMenuItem.Enabled = True Me.ToolStripButton6.Enabled = False Me.ToolStripButton7.Enabled = True Me.ToolStripButton1.Enabled = True Me.ToolStripButton5.Enabled = True Me.Tool
24、StripButton8.Enabled = True If m_style = "管理員" Then Me.公交信息ToolStripMenuItem.Enabled = True Me.條件查詢(xún)ToolStripMenuItem.Enabled = True Me.職員管理ToolStripMenuItem.Enabled = True ElseIf m_style = "職員" Then Me.公交信息ToolStripMenuItem.Enabled = True Me.條件查詢(xún)ToolStripMenuItem.Enabled = True M
25、e.職員管理ToolStripMenuItem.Enabled = False End If End If End Sub Private Sub 退出ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 退出ToolStripMenuItem.Click Me.Close() End Sub Private Sub 注銷(xiāo)ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.
26、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() Me.ToolStripStatusLabel1.Text = "登錄" End Sub Private Sub ToolStripButton7_Click(ByVal sender As Sy
27、stem.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.Show() Me.ToolStripStatusLabel1.Text = "登錄" End Sub Private Sub 登錄ToolStripMe
28、nuItem_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) Handles Timer1.Tick Label1.Text = Now End Sub Private Sub ToolStripButton6_Click(ByVal s
29、ender 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 添加ToolStripMenuItem1.Click gongjiaoxinxixiugai.MdiParent = Me gongjiaoxinxixiugai.Show()
30、 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 Private Sub 預(yù)定查詢(xún)ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As Syste
31、m.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) Handles 添加職員ToolStripMenuItem.Click zhiyuanguanli.MdiParent = Me zhiyuanguanli.Show() E
32、nd 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 Sub ToolStripButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Ha
33、ndles ToolStripButton8.Click shoumozhanchaxun.MdiParent = Me shoumozhanchaxun.Show() End Sub Private Sub 使用方法ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) MsgBox("點(diǎn)擊相應(yīng)的圖標(biāo)選擇需要的功能,選擇菜單、客戶(hù)等內(nèi)容時(shí),直接點(diǎn)擊數(shù)據(jù)表") End Sub Private Sub ToolStripButton1_Click(ByVal sen
34、der 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.IOPublic Class gongjiaoxinxichakan Private row As Integer = -1 Private CmdStr As String Priv
35、ate 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 >= 0 Then row = e.RowIndex Label6.Text = Me.DataGridView1.Item(0, row).Value.T
36、oString.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.Text = Me.DataGridView1.Item(0, row).Value.ToString.Trim() If Label1.Text <&g
37、t; "" 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) Handles MyBase.Load sq
38、lobject = New SQL_Conn CmdStr = "SELECT name as '線路名稱(chēng)',price as '費(fèi)用價(jià)格',efficacy as '首站地址',formula as '末站地址' FROM gj" Try Me.DataGridView1.DataSource = sqlobject.SQL_Ada(CmdStr) Catch ex As Exception main.OPErr.WriteErr(ex) End Try Me.DataGridView1.AutoSizeCo
39、lumnsMode = 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
40、) 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 Sub Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As Syste
41、m.EventArgs) 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.Windo
42、ws.Forms.DataGridViewCellEventArgs) 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.DataGridVie
43、w1.Item(2, row).Value.ToString.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 + "'&q
44、uot; 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) Handles MyBase.Load sqlobject = New SQL_Conn CmdStr = "SELECT name as '線路名稱(chēng)',price as '費(fèi)用價(jià)格',efficacy as '
45、首站地址',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 = DataGridViewAutoSizeColumnsMode.DisplayedCells End Sub Private Sub Button1_Click(ByVal sender As
46、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.Value Then PictureBox1.Image = Nothing Else Dim imgbyte() As Byte = sqlobject.SQL_Ada(str).Rows(0
47、).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) Handles Button1.Click End SubEnd Class4.3.4 公 交 職 員 管 理 界 面Imports 公交查詢(xún)Imports System.IOPublic C
48、lass zhiyuanguanli Public userid As String Private row As Integer = -1 Private CmdStr As String Private Cmd As String 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 = "S
49、ELECT user_id as '登陸賬號(hào)',style as '員工級(jí)別',id as '身份證號(hào)',name as '職工姓名',tel as '聯(lián)系方式' FROM user" Try Me.DataGridView1.DataSource = sqlobject.SQL_Ada(CmdStr) Catch ex As Exception main.OPErr.WriteErr(ex) End Try Me.DataGridView1.AutoSizeColumnsMode = DataGridV
50、iewAutoSizeColumnsMode.DisplayedCells End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click CmdStr = "SELECT user_id FROM user where user_id='" + TextBox1.Text + "'" Cmd = "SELECT id FROM user where id=
51、9;" + 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)輸入密碼") TextBox2.Focus() ElseIf TextBox2.Text <> TextBox3.Text Then MsgBox("兩次密碼不一致") TextBox2.Focus() TextBox3.Focus() ElseIf ComboBox1.Text = "請(qǐng)選擇" Then MsgBox("請(qǐng)選擇級(jí)別") TextBox1.Focus() ElseIf TextBox4.Text = "" Then MsgBox("請(qǐng)輸入身份證號(hào)")
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年度特定附屬工程承包協(xié)議范本
- 2024年勞務(wù)分包協(xié)議規(guī)定詳解
- 保健品2024年買(mǎi)賣(mài)協(xié)議式
- 2023-2024學(xué)年浙江省湖州、衢州、麗水高考預(yù)測(cè)密卷(1)(數(shù)學(xué)試題)試卷
- 2024年專(zhuān)業(yè)記賬代理協(xié)議規(guī)范
- 2024年度公司用車(chē)租賃協(xié)議條款綱要
- 2024年隔音室建造協(xié)議格式
- 2024年保健品供應(yīng)協(xié)議模板
- 2024室內(nèi)設(shè)計(jì)服務(wù)協(xié)議樣本
- 2024年輕鋼結(jié)構(gòu)建設(shè)協(xié)議模板
- 南仁東和中國(guó)天眼課件
- 彩票市場(chǎng)銷(xiāo)售計(jì)劃書(shū)
- 設(shè)備維保的現(xiàn)場(chǎng)維修與故障處理
- 2024《中央企業(yè)安全生產(chǎn)治本攻堅(jiān)三年行動(dòng)方案(2024-2026年)》
- 紀(jì)錄片《園林》解說(shuō)詞
- 紀(jì)委監(jiān)督工作培訓(xùn)課件
- 蟲(chóng)害分析分析報(bào)告
- 《民間文學(xué)導(dǎo)論》課件
- 《輸血查對(duì)制度》課件
- 湘少版五年級(jí)下冊(cè)英語(yǔ)全期教案
- 高速公路收費(fèi)站常見(jiàn)特情處理辦法課件
評(píng)論
0/150
提交評(píng)論