數(shù)據(jù)庫技術(shù)及應(yīng)用課程設(shè)計(jì)項(xiàng)目設(shè)計(jì)報(bào)告說明書之工程項(xiàng)目管理_第1頁
數(shù)據(jù)庫技術(shù)及應(yīng)用課程設(shè)計(jì)項(xiàng)目設(shè)計(jì)報(bào)告說明書之工程項(xiàng)目管理_第2頁
數(shù)據(jù)庫技術(shù)及應(yīng)用課程設(shè)計(jì)項(xiàng)目設(shè)計(jì)報(bào)告說明書之工程項(xiàng)目管理_第3頁
數(shù)據(jù)庫技術(shù)及應(yīng)用課程設(shè)計(jì)項(xiàng)目設(shè)計(jì)報(bào)告說明書之工程項(xiàng)目管理_第4頁
數(shù)據(jù)庫技術(shù)及應(yīng)用課程設(shè)計(jì)項(xiàng)目設(shè)計(jì)報(bào)告說明書之工程項(xiàng)目管理_第5頁
已閱讀5頁,還剩73頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、同濟(jì)大學(xué)數(shù)據(jù)庫技術(shù)及應(yīng)用項(xiàng)目報(bào)告項(xiàng)目報(bào)告題目: 工程項(xiàng)目管理 班級: 數(shù)據(jù)庫( 1 )班組長: 王 進(jìn) 學(xué)號: 050933 成員: 史 亮 學(xué)號: 043598 年級: 大 三 專業(yè): 土木工程 指導(dǎo)教師: 袁科萍 日期: 2008 年 1 月 1 日目錄概述 12.功能介紹 13.E-R圖 44.相關(guān)設(shè)計(jì)(1)表設(shè)計(jì) 5(2)存儲過程設(shè)計(jì) 7(3)觸發(fā)器設(shè)計(jì) 7(4)窗體設(shè)計(jì) 15 20 69 72一、工程概述:作為土木工程學(xué)院大三的學(xué)生,在接觸了數(shù)據(jù)庫一年之后,拿到數(shù)據(jù)庫項(xiàng)目編程作業(yè)的時候,我們自然而然的將平時所學(xué)和與己相關(guān)的城建工程管理與其聯(lián)系在了一起。一個工程項(xiàng)目管理系統(tǒng)的想法進(jìn)入視

2、野。一個工程項(xiàng)目可能要經(jīng)過幾年才能夠完成,在這幾年中,有許多信息是需要管理的,如:客戶信息、項(xiàng)目負(fù)責(zé)人信息、項(xiàng)目具體情況、項(xiàng)目施工信息、項(xiàng)目投入支出金額信息、客戶付款情況等。管理這些信息,將為企業(yè)的各種統(tǒng)計(jì)結(jié)算和員工考核提供方便。該項(xiàng)目是以“工程項(xiàng)目管理”為主題,旨在創(chuàng)建高效、人性的項(xiàng)目管理系統(tǒng),為實(shí)現(xiàn)城建公司科學(xué)管理、系統(tǒng)管理而創(chuàng)建的電子管理系統(tǒng)。通過不同的身份的登錄,系統(tǒng)根據(jù)不同的命令參數(shù),賦予訪問者不同的權(quán)限:普通用戶只限于瀏覽、查詢,管理員另擁有添加、更改、刪除的權(quán)利。二、功能介紹:“工程項(xiàng)目管理系統(tǒng)”的項(xiàng)目信息管理可以分為:客戶信息管理、與該客戶有關(guān)的項(xiàng)目管理、項(xiàng)目的相關(guān)負(fù)責(zé)人信息管

3、理及指定項(xiàng)目相關(guān)的施工、支出、回款情況管理。在客戶信息管理部分,功能要求如下:(1) 查詢客戶信息(2) 更新、維護(hù)客戶信息(3) 根據(jù)客戶的ID查找該客戶與公司簽訂的所有項(xiàng)目情況,并由此查詢和編輯各個項(xiàng)目的有關(guān)信息客戶信息包含以下內(nèi)容:(1) 客戶ID(2) 客戶公司名稱(3) 客戶公司地址(4) 客戶所在省份(5) 客戶所在城市(6) 聯(lián)系人姓名(7) 聯(lián)系人職務(wù)(8) 聯(lián)系 與 (9) 附注信息在公司員工信息管理部分,功能要求如下:(1) 查詢員工信息(2) 更新、維護(hù)員工信息(3) 根據(jù)員工的ID查找該員工負(fù)責(zé)的所有項(xiàng)目情況,并由此查詢和編輯各個項(xiàng)目的有關(guān)信息公司員工人事信息管理部分,

4、要求如下:(1) 員工(項(xiàng)目負(fù)責(zé)人)ID(2) 員工姓名(3) 員工職務(wù)(4) 員工聯(lián)系 (5) 員工家庭住址在項(xiàng)目管理部分,功能要求如下:(1) 查詢項(xiàng)目信息(2) 更新、維護(hù)項(xiàng)目信息(3) 根據(jù)項(xiàng)目的ID查找該項(xiàng)目的客戶情況和項(xiàng)目負(fù)責(zé)人情況,并由此查詢和編輯有關(guān)信息(4) 查詢、更新和維護(hù)項(xiàng)目的施工、支出、回款信息項(xiàng)目管理部分的基本信息如下:(1) 項(xiàng)目ID(2) 項(xiàng)目名稱(3) 項(xiàng)目所屬客戶(4) 本公司的該項(xiàng)目負(fù)責(zé)人(5) 項(xiàng)目所在地(6) 項(xiàng)目金額(7) 項(xiàng)目開始及結(jié)束日期(8) 項(xiàng)目說明公司對項(xiàng)目的支出,需要以下信息:(1) 開支ID(2) 項(xiàng)目ID(3) 開支類型(4) 開支金額

5、(5) 開支日期項(xiàng)目施工信息管理,需要以下信息:(1) 項(xiàng)目施工ID(2) 項(xiàng)目ID(3) 項(xiàng)目負(fù)責(zé)人ID(4) 工作類型(5) 工作開始日期及結(jié)束日期(6) 工作天數(shù)項(xiàng)目回款信息管理,需要以下信息:(1) 項(xiàng)目回款I(lǐng)D(2) 項(xiàng)目ID(3) 回款方式(4) 回款金額(5) 回款日期(6) 經(jīng)辦人根據(jù)以上功能要求,現(xiàn)在數(shù)據(jù)庫中建立“項(xiàng)目表”、“客戶表”、“項(xiàng)目負(fù)責(zé)人表”、“匯款表”、“項(xiàng)目施工表”、“項(xiàng)目支出表”。為了維護(hù)和使用的方便,還需要更加人性化,界面更加友好的應(yīng)用程序,對數(shù)據(jù)庫進(jìn)行維護(hù)、查詢等處理。應(yīng)用程序用表單設(shè)計(jì),以處理其數(shù)據(jù)。為此,我們建立了“管理員”、“項(xiàng)目”、“客戶”、“項(xiàng)目

6、負(fù)責(zé)人”、“項(xiàng)目支出”、“回款”、“項(xiàng)目施工”等7個表單。其中“項(xiàng)目”表單為整個程序設(shè)計(jì)的核心,所有查詢、更新最后都落到“項(xiàng)目”表單上。三、E-R圖設(shè)計(jì):為了更清除的表達(dá)各個主體之間的關(guān)系,先建立E-R圖關(guān)系如下:項(xiàng)目說明開支類型開支日期開支金額工作類型項(xiàng) 目回 款項(xiàng)目支出項(xiàng)目施工客 戶項(xiàng)目負(fù)責(zé)人負(fù)責(zé)回款合同施工支出客戶ID聯(lián)系人姓名聯(lián)系人職務(wù)公司名稱公司地址省份城市 姓名職務(wù) 地址項(xiàng)目負(fù)責(zé)人ID項(xiàng)目ID項(xiàng)目名稱所在地項(xiàng)目金額開始日期結(jié)束日期回款I(lǐng)D經(jīng)辦人回款金額回款日期付款方式支出ID開始日期結(jié)束日期施工ID四、相關(guān)設(shè)計(jì):(1)項(xiàng)目表(2)客戶表(3)項(xiàng)目負(fù)責(zé)人表(4)回款表(5)項(xiàng)目施工表

7、(6)項(xiàng)目支出表2.存儲過程設(shè)計(jì):求最大值、最小值、總額的存儲過程3.觸發(fā)器設(shè)計(jì):(1) 項(xiàng)目表觸發(fā)器:刪除項(xiàng)目支出表相關(guān)信息觸發(fā)器:刪除回款表中相關(guān)信息觸發(fā)器:刪除項(xiàng)目施工表中相關(guān)信息觸發(fā)器:填加項(xiàng)目表中相關(guān)信息觸發(fā)器:更新項(xiàng)目表中相關(guān)信息觸發(fā)器:(2) 客戶表觸發(fā)器:刪除客戶表中相關(guān)信息觸發(fā)器:更改項(xiàng)目表中相關(guān)信息觸發(fā)器:(3) 項(xiàng)目負(fù)責(zé)人表觸發(fā)器:刪除項(xiàng)目負(fù)責(zé)人表相關(guān)信息觸發(fā)器:修改項(xiàng)目負(fù)責(zé)人表相關(guān)信息觸發(fā)器:(4) 項(xiàng)目支出表觸發(fā)器:項(xiàng)目支出表填加相關(guān)信息觸發(fā)器:更新項(xiàng)目支出表相關(guān)信息觸發(fā)器:(5) 回款表觸發(fā)器:更新回款表相關(guān)信息觸發(fā)器:填加回款表相關(guān)信息觸發(fā)器:(6) 項(xiàng)目施工表觸

8、發(fā)器:填加項(xiàng)目施工表相關(guān)信息觸發(fā)器:更新項(xiàng)目施工表相關(guān)信息觸發(fā)器:4.窗體設(shè)計(jì):(1)登錄身份選擇窗體:(2)管理員登錄窗體:(3)查詢方式選擇窗體:上方金色字條為滾動狀態(tài)(4)客戶表信息查詢窗體:如以普通用戶身份進(jìn)入,則下方“添加”、“刪除”、“更改”、“保存”等button控件為不可見。用戶可以通過客戶ID旁邊的combolbox選擇想要查詢的客戶。(5)客戶投資所有項(xiàng)目信息窗體:窗體上有現(xiàn)實(shí)該客戶投資項(xiàng)目的總金額和最大、最小金額。右下角的計(jì)算器是輔助功能,以備不時之需。用戶可以在客戶旁邊的combolbox選擇想要查詢的客戶,并可以點(diǎn)擊datagri中選擇想要了解的項(xiàng)目,再點(diǎn)擊右下角的“

9、查詢選擇項(xiàng)目詳情”,轉(zhuǎn)至項(xiàng)目表中查看詳情。(6)項(xiàng)目表窗體:整個系統(tǒng)的核心窗體,有三種方法可以到達(dá)此窗體,分別是從客戶表跟蹤查詢、從項(xiàng)目負(fù)責(zé)人表跟蹤查詢、直接進(jìn)入項(xiàng)目查詢。在項(xiàng)目表中可以進(jìn)行客戶查詢、項(xiàng)目負(fù)責(zé)人查詢、回款、項(xiàng)目施工、項(xiàng)目支出等功能。下方的“更改”、“添加”、“刪除”等功能由trigger進(jìn)行約束。項(xiàng)目ID右側(cè)的combolbox可以選擇不同項(xiàng)目查詢詳情。(7)項(xiàng)目負(fù)責(zé)人選擇窗體:功能和項(xiàng)目表類似選擇左上方“該項(xiàng)目負(fù)責(zé)人負(fù)責(zé)的所有項(xiàng)目”進(jìn)入下個窗體。(8)項(xiàng)目負(fù)責(zé)人窗體:點(diǎn)擊下方button進(jìn)入項(xiàng)目窗體。此處應(yīng)用了datagrid.currentcell.rownumber處理。

10、(9)回款表窗體:(10)回款曲線繪制窗體:Paint畫圖處理(11)項(xiàng)目支出窗體:(12)項(xiàng)目施工窗體: (13)退出窗體:“感謝您的使用”為滾動字條五、詳細(xì)代碼:公共模塊:Module Module1 Public f1 = New Form1 Public f2 = New Form2 Public f3 = New Form3 Public f4 = New 回款 Public f5 = New 回款曲線圖 Public f6 = New 項(xiàng)目支出表 Public f7 = New 登陸 Public f8 = New 客戶表 Public f9 = New 項(xiàng)目負(fù)責(zé)人表 Public

11、 f10 As New 總界面 Public f11 As New 感謝您的使用 Public f12 As New 客戶to項(xiàng)目 Public f13 As New 負(fù)責(zé)人to項(xiàng)目 Public f14 As New 計(jì)算器 Public xmid1, khid, fzid, khid1, xmid, fzid1 As String Public key As Integer Public kh, fz, xm As Integer Public glyname As StringEnd Module1.登陸表Public Class 登陸InheritsDim id, code As St

12、ring Dim checkcode As String Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles If Not IsNumeric(id) And id <> "" Then MsgBox("輸入錯誤:id均為數(shù)字,請輸入數(shù)字") '控制帳號輸入為數(shù)字 End If End Sub Private Sub 登陸_Load(ByVal sender As System.Obje

13、ct, ByVal e As System.EventArgs) Handles MyBase.Load Randomize() Label4.Text = Int(Rnd() * 9000 + 1000) TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox1.Focus() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs

14、) Handles Me.Hide() f2.show() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dim id, code As String Dim checkcode As String '打開連接,到數(shù)據(jù)庫讀取該帳號的密碼 Dim myconnstr As String = "initial catalog=工程項(xiàng)目管理;data source=SHA;integrated security=SSPI;&q

15、uot; Dim myconn As New SqlClient.SqlConnection(myconnstr) Dim mySelectQuery1 As String = "select 密碼 from 管理員 where 管理員id = '" + TextBox1.Text + "'" Dim myCommand1 As New System.Data.SqlClient.SqlCommand(mySelectQuery1, myconn) myconn.Open() Dim myReader1 As System.Data.Sq

16、lClient.SqlDataReader = myCommand1.ExecuteReader() While myReader1.Read() checkcode = myReader1.GetString(0) End While myReader1.Close() '連接關(guān)閉 If checkcode = "" And TextBox1.Text <> "" Then MsgBox("您輸入的帳號不存在!") Randomize() Label4.Text = Int(Rnd() * 9000 + 1000

17、) TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox1.Focus() '帳號不存在時 Else If TextBox1.Text = "" Then MsgBox("請輸入學(xué)號!") '未輸入帳號時 Else Select Casext Case "" MsgBox("密碼不能為空,請輸入!") '密碼為空時 Case checkcode Select

18、 Case Case "" MsgBox("請輸入驗(yàn)證碼!") '驗(yàn)證碼為空時 Case Me.Hide() '密碼、驗(yàn)證碼都正確時,進(jìn)入下一界面 f10.Show() Case Else MsgBox("驗(yàn)證碼輸入錯誤!") '驗(yàn)證碼錯誤時 TextBox3.Text = "" Label4.Text = Int(Rnd() * 9000 + 1000) End Select Case Else MsgBox("密碼錯誤!請重新輸入!") '密碼錯時 TextB

19、ox2.Text = "" TextBox3.Text = "" Label4.Text = Int(Rnd() * 9000 + 1000) End Select End If End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "&

20、quot; Randomize() Label4.Text = Int(Rnd() * 9000 + 1000) TextBox1.Focus() End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles End Sub Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated Ran

21、domize() Label4.Text = Int(Rnd() * 9000 + 1000) TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox1.Focus() id = "" code = "" End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles End SubEn

22、d Class2.登陸身份選擇:Public Class Form2 InheritsDim i As IntegerPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles If RadioButton1.Checked = True Then key = 0 Me.Hide() f10.Show() Else key = 1 Me.Hide() f7.Show() End If End Sub '身份選擇時設(shè)計(jì)返回參數(shù) Private Sub Form2

23、_Load(ByVal sender Asect, ByVal e As System.EventArgs) Handles MyBase.Load Me.AxWindowsMediaPlayer1.URL = Application.StartupPath & "1.mp3" Me.AxWindowsMediaPlayer1.Ctlcontrols.play() Timer1.Enabled = True Me.SqlDataAdapter1.Fill(Me.DataSet11.picture_1) Dim i As Integer Dim myfilestrea

24、m As Dim filename As String '加入音頻 Dim data() As Byte For i = 0 To 4 myfilestream = New System.IO.FileStream(Application.StartupPath & "pictures" & i & ".jpg", IO.FileMode.Open) ReDim data(myfilestream.Length - 1)(data, 0, myfilestream.Length) myfilestream.Close()

25、DataSet11.Tables("picture_1").Rows(i).Item(0) = data Next End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dim Data() As Byte Dim myfilestream As Data = Me.DataSet11.picture_1.Rows(i).Item(0) myfilestream = New System.IO.MemoryStream(Data)

26、 Me(myfilestream) i = i + 1 If i > 4 Then i = 0 End If End Sub '加入圖片,并使之循環(huán)播放 Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Menu Me.AxWindowsMediaPlayer1.Ctlcontrols.stop() End Sub Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVa

27、l e As System.EventArgs) Handles Me.AxWindowsMediaPlayer1.Ctlcontrols.play() End SubEnd Class3.總界面:Public Class 總界面InheritsPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles If RadioButton1.Checked = True Then kh = 1 Me.Hide() f8.show() ElseIf RadioButton2.

28、Checked = True Then fz = 1 Me.Hide() f9.show() ElseIf RadioButton3.Checked = True Then xm = 0 Me.Hide() f1.show() End If End Sub '設(shè)計(jì)返回值參數(shù),進(jìn)入不同界面 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Text = Now If key = 0 Then Label2.Text = "歡迎使用工

29、程項(xiàng)目管理系統(tǒng)" Else Label2.Text = "歡迎" & glyname & "管理員" End If Label2.Left = Label2.Left - 30 If Label2.Left < 0 Then End If End Sub '滾動字幕制作 Private Sub 總界面_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Enabled = True E

30、nd SubEnd Class4.客戶表:Public Class 客戶表InheritsDim myconn As New SqlClient.SqlConnection("initial catalog=工程項(xiàng)目管理;data source=SHA;integrated security=SSPI;") Dim mm As Integer Dim nn As String Private Sub 客戶表_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

31、 If key = 0 Then Me.Button2.Visible = False Me.Button3.Visible = False Me.Button4.Visible = False Me.Button1.Visible = False Else Me.Button2.Visible = True Me.Button3.Visible = True Me.Button4.Visible = True Me.Button1.Visible = True End If '根據(jù)不同的返回參數(shù)布置界面,實(shí)現(xiàn)不同權(quán)限下的功能 Dim sql As String = "sel

32、ect distinct 客戶id from 客戶表" Dim cmd As New SqlClient.SqlCommand(sql, myconn) Dim reader As myconn.Open() reader = cmd.ExecuteReader() Do While ComboBox1.Items.Add(reader.Item(0) Loop reader.Close() myconn.Close() End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object,

33、ByVal e As System.EventArgs) Handles Dim table1 As New DataTable Dim sqlstr2 As String Dim adapter As sqlstr2 = "select * from 客戶表 where 客戶id like '" & Trim(ComboBox1.Text) & "'" adapter = New SqlClient.SqlDataAdapter(sqlstr2, myconn) adapter.Fill(table1) TextBox2

34、.Text = table1.Rows(0).Item(1) ComboBox1.Text = table1.Rows(0).Item(0) TextBox3.Text = table1.Rows(0).Item(2) TextBox4.Text = table1.Rows(0).Item(3) TextBox5.Text = table1.Rows(0).Item(4) TextBox6.Text = table1.Rows(0).Item(5) TextBox7.Text = table1.Rows(0).Item(6) TextBox8.Text = table1.Rows(0).Ite

35、m(7) TextBox9.Text = table1.Rows(0).Item(8) TextBox10.Text = table1.Rows(0).Item(9) End Sub Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Hide() f12.Show() End Sub Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventA

36、rgs) Handles Me.Hide() f10.Show() End Sub Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Hide() f11.Show() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dim sql As String = "delete from 客

37、戶表 where 客戶id like '" & Trim(ComboBox1.Text) & "'" Dim mycmd As New SqlClient.SqlCommand(sql, myconn) myconn.Open() Try mycmd.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.Message) End Try myconn.Close() TextBox2.Text = "" ComboBox1.Text = "" Te

38、xtBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" TextBox9.Text = "" TextBox10.Text = "" Me.Button4.Enabled = True mm = 0 End Sub Private Sub Button4_Click(By

39、Val sender As System.Object, ByVal e As System.EventArgs) Handles If mm = 1 Then Dim sql As String = "insert into 客戶表 values('" & Me.ComboBox1.Text & "','" & Me.TextBox2.Text & "','" & Me.TextBox3.Text & "','"

40、; & Me.TextBox4.Text & "','" & Me.TextBox5.Text & "','" & Me.TextBox6.Text & "','" & Me & "','" & Me.TextBox8.Text & "','" & Me.TextBox9.Text & "','&

41、quot; & Me.TextBox10.Text & "')" Dim mycmd As New SqlClient.SqlCommand(sql, myconn) myconn.Open() Try mycmd.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.Message) End Try myconn.Close() ElseIf mm = 2 Then Dim sql As String = "update 客戶表 set 客戶id='" & Me.Co

42、mboBox1.Text & "',聯(lián)系人姓名='" & Me.TextBox2.Text & "',聯(lián)系人職務(wù)='" & Me.TextBox3.Text & "', ='" & Me.TextBox4.Text & "', ='" & Me.TextBox5.Text & "',公司名稱='" & Me.TextBox6.Text &

43、amp; "',公司地址='" & Me.TextBox7.Text & "',省份='" & Me.TextBox8.Text & "',城市='" & Me.TextBox9.Text & "',附注='" & Me.TextBox10.Text & "' where 客戶id= '" & nn & "' "

44、; Dim mycmd As New SqlClient.SqlCommand(sql, myconn) myconn.Open() Try mycmd.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.Message) End Try myconn.Close() Else End If 'nn為全局變量,傳遞客戶id到下個界面 ComboBox1.Items.Clear() Dim sql4 As String = "select distinct 客戶id from 客戶表" Dim cmd As New Sq

45、lClient.SqlCommand(sql4, myconn) Dim reader As myconn.Open() reader = cmd.ExecuteReader() Do While ComboBox1.Items.Add(reader.Item(0) Loop reader.Close() myconn.Close() Me.Button4.Enabled = False End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Te

46、xtBox2.Text = "" ComboBox1.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" TextBox9.Text = "" TextBox10.Text = "" mm = 1 Me.

47、Button4.Enabled = True End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mm = 2 Me.Button4.Enabled = True End Sub Private Sub 客戶表_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated Dim sql1 As String Dim table1

48、As New DataTable Dim adapter As If kh = 1 Then sql1 = "select * from 客戶表" Else sql1 = "select * from 客戶表 where 客戶id like'" & khid & "'" End If adapter = New SqlClient.SqlDataAdapter(sql1, myconn) adapter.Fill(table1) TextBox2.Text = table1.Rows(0).Item(1)ext = table1.Rows(0).Item(0) TextBox3.Text = table1.Rows(0).Item(2) TextBox4.Text = table1.Rows(0).Item(3) TextBox5.Text = table1.Rows(0).Item(4) TextBox6.Text = table1.Rows(0).Item(5) TextBox7.Text = table1.Rows(0).Item(6) TextBox8.Text = table1.Rows(0).Item(7) TextBox9.Text

溫馨提示

  • 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論