數據庫系統原理課程設計報告.doc_第1頁
數據庫系統原理課程設計報告.doc_第2頁
數據庫系統原理課程設計報告.doc_第3頁
數據庫系統原理課程設計報告.doc_第4頁
數據庫系統原理課程設計報告.doc_第5頁
已閱讀5頁,還剩15頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

數據庫系統原理課程設計報告-平面設計公司業務管理系統姓 名: 學 號: 指導老師: 起始時間:2010年3月3日結束時間:2010年5月28日目錄第一章概述31.1項目背景31.2編寫目的31.3軟件定義31.4開發環境3第二章需求分析32.1信息要求42.處理要求42.3安全性與完整性要求5第三章概念設計53.1整體E-R圖53.2用戶E-R圖63.3客戶E-R圖63.4員工E-R圖63.5稿件E-R圖73.6單據E-R圖7第四章邏輯結構設計74.1用戶關系表74.2客戶關系表74.3稿件關系表84.4員工關系表84.5單據關系表9第五章主要模塊設計與代碼95.1登錄模塊設計95.2主界面模塊設計105.3信息修改模塊設計125.4業務信息模塊設計145.5綜合查詢模塊設計185.6連接數據庫模塊設計19第六章總結19第七章參考文獻20第一章 概述1.1項目背景該公司經營平面設計業務。業務員負責聯系業務,并將客戶的設計要求進行登記,然后交由設計人員設計。設計完成后由專人負責送貨并收款。客戶每次的設計要求可能多個不同規格的稿件,這次要求的所有稿件構成一份單據,稱為為“預訂單”。設計人員從預訂單中選取其中的一個進行設計,正在設計中的預訂單稱為“在建單”,已經完成設計的在建單稱為“送貨單”,已經送貨的送貨單稱為“歷史單”。設計人員一旦開始設計某一預訂單,就必須負責完成預訂單、在建單、送貨單三個流程。業務員的月薪按照每月聯系的業務提成3%;、設計員的月薪按照每月完成的設計單提成3%;送貨人的月薪按照每月送貨的業務提成1%。1.2 編寫目的從案例來講,隨著公司業務的增多,需要一個完善的業務系統來管理,在此平臺上公司能更好的運作;從個人來講,為了更好地了解數據庫,同時提高自己的動手能力。1.3軟件定義用VB和SQL共同構建適合公司日常業務操作的應用程序。1.4開發環境 普通PC機一臺,安裝Microsoft Visual Basic / Microsoft SQL sever。第二章 需求分析2.1信息要求用戶基本信息:用戶姓名、用戶密碼、權限。客戶基本信息:客戶名稱、聯系人、聯系人電話、傳真、郵箱、公司地址。稿件基本信息:稿件名稱、長度寬度、規格、色數、輸出機型、P數。員工基本信息:編號、員工名、性別、職位、月薪、出生日期、入職日期、聯系電話、聯系地址。單據基本信息:單號、性質、客戶名稱、營業員、設計者、送貨人、創建及送貨日期。(單據性質包括預訂單、在建單、送貨單、歷史單)2.2處理要求 系統的功能模塊大體可以設計成如圖1-1所示。登陸界面主界面員工信息管理界面業務信息查詢管理界面客戶信息管理界面信息修改管理界面綜合信息查詢界面 預訂單在建單送貨單歷史單所有單單據信息修改稿件信息修改圖1-1 系統功能模塊圖從登錄用戶上看,登錄用戶需要使用該系統對全體用戶的資料進行維護和管理,可以進入各個界面查看和修改,以便對各個員工的工作進行監督和干涉。2.3安全性與完整性要求系統數據完整性與安全性要求如下:從用戶基本信息上看,系統要求必須有用戶姓名、用戶權限、密碼等。密碼或用戶名字錯誤無法登陸。從稿件基本信息上看,系統要求每張稿件必須有稿件名稱、長度寬度、規格、色數、機型等。允許登陸用戶修改信息。從客戶基本信息上看,系統要求每位客戶都必須有客戶名稱、聯系人、聯系電話、公司地址等。允許登陸用戶修改信息。從單據基本信息上看,系統要求單據必須必須有單號、性質、客戶名稱、營業員、設計者、送貨人、創建及送貨日期。允許登陸用戶修改信息。第三章 概念設計3.1整體E-R圖根據上面的定義可以得到以下整體的E-R圖:圖1-2 整體E-圖預定單在建單送貨單歷史單稿件客戶用戶預定設計送貨存檔3.2用戶E-R圖根據系統對用戶完整性約束等條件定義用戶的E-R圖如下:用戶用戶姓名用戶密碼權限圖1-3 用戶E-圖3.3客戶E-R圖根據系統對客戶完整性約束等條件定義客戶的E-R圖如下:圖1-4 客戶E-圖客戶客戶名稱聯系人聯系人電話傳真郵箱公司地址3.4員工E-R圖根據系統對客戶完整性約束等條件定義員工的E-R圖如下:圖1-5 員工E-圖員工編號員工名職位出生日期入職日期聯系電話聯系地址月薪性別3.5稿件E-R圖根據系統對稿件完整性約束等條件定義稿件的E-R圖如下:稿件稿件名稱長度寬度規格色數P數輸出機型圖1-6 稿件E-圖3.6單據E-R圖根據系統對單據完整性約束等條件定義單據的E-R圖如下:圖1-7單據E-圖單號營業員客戶名稱設計者送貨人人人者性質創建日期送貨日期單據第四章 邏輯結構設計4.1用戶關系表根據用戶的E-R圖得到如下關系表:表1-1 用戶表4.2客戶關系表根據客戶的E-R圖得到如下關系表:表1-2 客戶表4.3稿件關系表根據稿件的E-R圖得到如下關系表:表1-3 稿件表4.4員工關系表根據員工的E-R圖得到如下關系表:表1-4 員工表4.5單據關系表根據單據的E-R圖得到如下關系表:表1-5 單據表第五章 主要模塊設計與代碼5.1登錄模塊設計主要代碼如下:Private Sub Command1_Click() Dim strSQL As String UserName = CStr(Trim(TxtUserName.Text) PassWord = CStr(Trim(TxtPassWord.Text)If UserName Empty And PassWord Empty Then strSQL = select * from 用戶信息 where 用戶名= & UserName & and 密碼 = & PassWord & If RsLoginCheck.State = adStateClosed Then RsLoginCheck.Open strSQL, DBCON, adOpenKeyset, adLockPessimistic, adCmdText End If If RsLoginCheck.EOF = False Then Group = RsLoginCheck.Fields(1).Value Group1 = RsLoginCheck.Fields(3).Value Group5 = RsLoginCheck.Fields(0).Value RsLoginCheck.Close Unload Me 主界面.Show ElseIf Counts 2 Then MsgBox 用戶名域密碼錯誤, vbExclamation + vbOKOnly, 登錄失敗 RsLoginCheck.Close Counts = Counts + 1 Else MsgBox 密碼錯誤不得超過三次,否則視您為非法用戶!, vbCritical, 警告 End End IfElse MsgBox 用戶名密碼不能為空, vbExclamation + vbOKOnly, 登錄失敗End IfEnd SubPrivate Sub Command2_Click() EndEnd Sub5.2主界面模塊設計主要代碼如下:Private Sub exitos_Click()EndEnd SubPrivate Sub Image1_Click() 員工信息.ShowUnload 業務信息Unload 客戶信息Unload 單據信息Unload 綜合信息查詢End SubPrivate Sub Image2_Click() 客戶信息.ShowUnload 員工信息Unload 業務信息Unload 單據信息Unload 綜合信息查詢End SubPrivate Sub Image3_Click() 業務信息.ShowUnload 員工信息Unload 客戶信息Unload 單據信息Unload 綜合信息查詢End SubPrivate Sub Image4_Click() EndEnd SubPrivate Sub Image5_Click() 綜合信息查詢.ShowUnload 員工信息Unload 客戶信息Unload 業務信息Unload 單據信息End SubPrivate Sub Image6_Click() 單據信息.ShowUnload 員工信息Unload 客戶信息Unload 綜合信息查詢End SubPrivate Sub khxx_Click()客戶信息.ShowUnload 員工信息Unload 業務信息Unload 單據信息Unload 綜合信息查詢End SubPrivate Sub ygxx_Click()員工信息.ShowUnload 業務信息Unload 客戶信息Unload 單據信息Unload 綜合信息查詢End SubPrivate Sub ymcx_Click()業務信息.ShowUnload 員工信息Unload 客戶信息Unload 單據信息Unload 綜合信息查詢End SubPrivate Sub ymxg_click()業務信息.ShowUnload 員工信息Unload 客戶信息Unload 綜合信息查詢End SubPrivate Sub zhcx_click()綜合信息查詢.ShowUnload 員工信息Unload 客戶信息Unload 單據信息End SubPrivate Sub Timer1_Timer()Label1.Caption = NowEnd Sub5.3信息修改模塊設計主要代碼如下:Private Sub Command1_Click()a = CZSX.Textb = CZZ.TextIf a Then If b = Then MsgBox 請輸入查找值, , 提示 Else Adodc1.CommandType = adCmdText Adodc1.RecordSource = select * from orderF where & a & = & b & Adodc1.Refresh DataGrid1.Refresh Set DataGrid1.DataSource = Adodc1 End IfElseMsgBox 請選擇要查找的相關屬性, , 提示信息End IfEnd SubPrivate Sub Command2_Click()Set DataGrid1.DataSource = Adodc1CZZ.Text = End SubPrivate Sub Command3_Click()a = Combo1.Textb = Text1.TextIf a Then If b = Then MsgBox 請輸入查找值, , 提示 Else Adodc2.CommandType = adCmdText Adodc2.RecordSource = select * from model where & a & = & b & Adodc2.Refresh DataGrid2.Refresh Set DataGrid2.DataSource = Adodc2 End IfElseMsgBox 請選擇要查找的相關屬性, , 提示信息End IfEnd SubPrivate Sub Command4_Click()Set DataGrid2.DataSource = Adodc2Text1.Text = End Sub5.4業務信息模塊設計主要代碼如下:Private Sub DataGrid1_RowColChange(lastrow As Variant, ByVal lastcol As Integer)sn = DataGrid1.Columns(單號).CellText(DataGrid1.Bookmark)Adodc6.CommandType = adCmdTextAdodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.RefreshDataGrid6.RefreshSet DataGrid6.DataSource = Adodc6*For i = 0 To 5 Label1(i).Caption = DataGrid1.Columns(i).CellText(DataGrid1.Bookmark)Next iEnd SubPrivate Sub DataGrid2_RowColChange(lastrow As Variant, ByVal lastcol As Integer)sn = DataGrid2.Columns(單號).CellText(DataGrid2.Bookmark)Adodc6.CommandType = adCmdTextAdodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.RefreshDataGrid6.RefreshSet DataGrid6.DataSource = Adodc6*For i = 0 To 5 Label1(i).Caption = DataGrid2.Columns(i).CellText(DataGrid2.Bookmark)Next iEnd SubPrivate Sub DataGrid3_RowColChange(lastrow As Variant, ByVal lastcol As Integer)sn = DataGrid3.Columns(單號).CellText(DataGrid3.Bookmark)Adodc6.CommandType = adCmdTextAdodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.RefreshDataGrid6.RefreshSet DataGrid6.DataSource = Adodc6*For i = 0 To 5 Label1(i).Caption = DataGrid3.Columns(i).CellText(DataGrid3.Bookmark)Next iEnd SubPrivate Sub DataGrid4_RowColChange(lastrow As Variant, ByVal lastcol As Integer)sn = DataGrid4.Columns(單號).CellText(DataGrid4.Bookmark)Adodc6.CommandType = adCmdTextAdodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.RefreshDataGrid6.RefreshSet DataGrid6.DataSource = Adodc6*For i = 0 To 5 Label1(i).Caption = DataGrid4.Columns(i).CellText(DataGrid4.Bookmark)Next iEnd SubPrivate Sub DataGrid5_RowColChange(lastrow As Variant, ByVal lastcol As Integer) sn = DataGrid5.Columns(單號).CellText(DataGrid5.Bookmark) Adodc6.CommandType = adCmdText Adodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.Recordset.PageSize = 5 Adodc6.Refresh DataGrid6.Refresh Set DataGrid6.DataSource = Adodc6 * For i = 0 To 5 Label1(i).Caption = DataGrid5.Columns(i).CellText(DataGrid5.Bookmark) Next i - For i = 0 To Adodc6.Recordset.RecordCount - 1 Allcost = Allcost + Adodc6.Recordset.Fields(小計).Value If Adodc6.Recordset.EOF Then Exit For Adodc6.Recordset.MoveNext Next i Label3.Caption = AllcostEnd SubPrivate Sub Label4_Click() sn = DataGrid1.Columns(單號).CellText(DataGrid1.Bookmark)Adodc6.CommandType = adCmdTextAdodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.RefreshDataGrid6.RefreshSet DataGrid6.DataSource = Adodc6*For i = 0 To 5 Label1(i).Caption = DataGrid1.Columns(i).CellText(DataGrid1.Bookmark)Next iDataGrid1.Visible = TrueDataGrid2.Visible = FalseDataGrid3.Visible = FalseDataGrid4.Visible = FalseDataGrid5.Visible = FalseEnd SubPrivate Sub Label6_Click() sn = DataGrid2.Columns(單號).CellText(DataGrid2.Bookmark)Adodc6.CommandType = adCmdTextAdodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.RefreshDataGrid6.RefreshSet DataGrid6.DataSource = Adodc6*For i = 0 To 5 Label1(i).Caption = DataGrid2.Columns(i).CellText(DataGrid2.Bookmark)Next iDataGrid1.Visible = FalseDataGrid2.Visible = TrueDataGrid3.Visible = FalseDataGrid4.Visible = FalseDataGrid5.Visible = FalseEnd SubPrivate Sub Label7_Click() sn = DataGrid3.Columns(單號).CellText(DataGrid3.Bookmark)Adodc6.CommandType = adCmdTextAdodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.RefreshDataGrid6.RefreshSet DataGrid6.DataSource = Adodc6*For i = 0 To 5 Label1(i).Caption = DataGrid3.Columns(i).CellText(DataGrid3.Bookmark)Next iDataGrid1.Visible = FalseDataGrid2.Visible = FalseDataGrid3.Visible = TrueDataGrid4.Visible = FalseDataGrid5.Visible = FalseEnd SubPrivate Sub Label8_Click() sn = DataGrid4.Columns(單號).CellText(DataGrid4.Bookmark)Adodc6.CommandType = adCmdTextAdodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.RefreshDataGrid6.RefreshSet DataGrid6.DataSource = Adodc6*For i = 0 To 5 Label1(i).Caption = DataGrid4.Columns(i).CellText(DataGrid4.Bookmark)Next iDataGrid1.Visible = FalseDataGrid2.Visible = FalseDataGrid3.Visible = FalseDataGrid4.Visible = TrueDataGrid5.Visible = FalseEnd SubPrivate Sub Label9_Click() sn = DataGrid5.Columns(單號).CellText(DataGrid5.Bookmark) Adodc6.CommandType = adCmdText Adodc6.RecordSource = select * from model where 單號 = & sn & Adodc6.Recordset.PageSize = 5 Adodc6.Refresh DataGrid6.Refresh Set DataGrid6.DataSource = Adodc6 * For i = 0 To 5 Label1(i).Caption = DataGrid5.Columns(i).CellText(DataGrid5.Bookmark) Next i - For i = 0 To Adodc6.Recordset.RecordCount - 1 Allcost = Allcost + Adodc6.Recordset.Fields(小計).Value If Adodc6.Recordset.EOF Then Exit For Adodc6.Recordset.MoveNext Next i Label3.Caption = Allcost DataGrid1.Visible = FalseDataGrid2.Visible = FalseDataGrid3.Visible = FalseDataGrid4.Visible = FalseDataGrid5.Visible = TrueEnd SubPrivate Sub Timer1_Timer()TIMELabel.Caption = NowEnd SubPrivate Sub Form_Resize()TIMELabel.Top = Me.Height - TIMELabel.HeightTIMELabel.Left = Me.Width - TIMELabel.WidthEnd Sub5.5綜合查詢模塊設計主要代碼如下:Private Sub Command1_Click()Dim moenybegin = DTP1.Valuee_nd = DTP2.ValueAdodc1.CommandType = adCmdTextAdodc1.RecordSource = select SUM(小計)合計 from orderf,model where orderf.單號 = model.單號 and 送貨日期 & begin & and 送貨日期 & e_nd & Adodc1.RefreshText1.Text = Adodc1.Recordset.Fields(合計).Value & ¥End Sub5.6連接數據庫模塊設計主要代碼如下:Sub main() If FileExist(App.Path + db.ini) = False Then xx = 0 yy = 0 WriteINI App.Path & db.ini, config, server, . W

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論