汽車銷售管理系統(tǒng)的設(shè)計(jì)與開發(fā)_第1頁
汽車銷售管理系統(tǒng)的設(shè)計(jì)與開發(fā)_第2頁
汽車銷售管理系統(tǒng)的設(shè)計(jì)與開發(fā)_第3頁
汽車銷售管理系統(tǒng)的設(shè)計(jì)與開發(fā)_第4頁
汽車銷售管理系統(tǒng)的設(shè)計(jì)與開發(fā)_第5頁
已閱讀5頁,還剩23頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、分類號(hào):分類號(hào):TP311.1TP311.1 U U D D C C:D10621-408-(2007)D10621-408-(2007) 6134-06134-0密密 級(jí):公級(jí):公 開開 編編 號(hào):號(hào): 成成 都都 信信 息息 工工 程程 學(xué)學(xué) 院院學(xué)學(xué) 位位 論論 文文汽車銷售管理系統(tǒng)的設(shè)計(jì)與開發(fā)汽車銷售管理系統(tǒng)的設(shè)計(jì)與開發(fā)論文作者姓名:論文作者姓名:王王 翔翔申請(qǐng)學(xué)位專業(yè):申請(qǐng)學(xué)位專業(yè):網(wǎng)絡(luò)工程網(wǎng)絡(luò)工程申請(qǐng)學(xué)位類別:申請(qǐng)學(xué)位類別:工學(xué)學(xué)士工學(xué)學(xué)士指指導(dǎo)導(dǎo)教教師師姓姓名名(職職稱稱):羊裔高羊裔高(講師講師)論文提交日期:論文提交日期:2007 年年 6 月月 10 日日汽車銷售管理系統(tǒng)的

2、設(shè)計(jì)與開發(fā)汽車銷售管理系統(tǒng)的設(shè)計(jì)與開發(fā)摘摘 要要本設(shè)計(jì)為一個(gè)汽車店鋪建立一個(gè)汽車銷售管理系統(tǒng)。首先進(jìn)行系統(tǒng)的需求分析,提出系統(tǒng)任務(wù)和系統(tǒng)業(yè)務(wù)流程的分析。其次,用 SQL Server 2000 建立系統(tǒng)運(yùn)行所要的后臺(tái)數(shù)據(jù)庫。本次設(shè)計(jì)中汽車銷售管理系統(tǒng)是屬于作業(yè)層的管理信息系統(tǒng),針對(duì)汽車銷售公司的銷售流程。系統(tǒng)的主要實(shí)施目標(biāo)是提供豐富的信息查詢功能,幫助銷售人員掌握公司汽車的各種詳細(xì)信息,熟悉購車顧客的各類信息,掌握車主的售后反饋信息,從而提供更好的服務(wù)給顧客;公司更可以根據(jù)本系統(tǒng)及時(shí)了解市場(chǎng)動(dòng)態(tài)并修改銷售戰(zhàn)略。在數(shù)據(jù)庫設(shè)計(jì)中,本設(shè)計(jì)又先對(duì)數(shù)據(jù)庫進(jìn)行需求分析和概念設(shè)計(jì)結(jié)構(gòu)的列出,這樣得到了較合理

3、的邏輯數(shù)據(jù)結(jié)構(gòu),利用此數(shù)據(jù)的結(jié)構(gòu)才能支持系統(tǒng)的各模塊的實(shí)現(xiàn)。然后通過 Microsoft Visual Studio .NET 2003 進(jìn)行各個(gè)系統(tǒng)功能模塊的創(chuàng)建和系統(tǒng)的實(shí)現(xiàn)。在創(chuàng)建過程中,本設(shè)計(jì)先從系統(tǒng)主模塊著手,再實(shí)現(xiàn)各個(gè)小的模塊功能。最后在系統(tǒng)實(shí)現(xiàn)的過程中將數(shù)據(jù)庫連接起來,實(shí)現(xiàn)整個(gè)系統(tǒng)的正常運(yùn)行。一個(gè)正常進(jìn)行的汽車銷售需要管理所擁有的汽車信息的設(shè)置、銷售人員的信息和客戶的信息等,更重要的還要提供汽車信息管理。面對(duì)各種不同種類的信息,需要合理的數(shù)據(jù)庫結(jié)構(gòu)來保存數(shù)據(jù)信息以及有效的程序結(jié)構(gòu)支持各種數(shù)據(jù)操作的執(zhí)行。關(guān)鍵詞關(guān)鍵詞:網(wǎng)上訂購;數(shù)據(jù)庫;信息管理Design and Implement

4、ation of the Automobile Sale SystemAbstractThis design is mean to state how to build a automobile sales management system for a 4Sshop.First is to analyze the system, pointing out the analysis of systematic mission and the process of it. Then the author build a background data-base by using SQL Serv

5、er 2000.In designing the data-base, the author analyze the need of the data structure and list all the designs of the concept, through which the author get a relatively reasonable logic data structure and realize each systematic module by using it. And then the author builds each function of the sys

6、tematic module and realizes the system. In the process of creation, the author starts from the main systematic module and then realizes each small one. In the final process of realizing the system, the author connects the databases, realizing the normal operation of the whole system. A normally oper

7、ated sales of automobiles need the administration of the set of the occupied automobiles, the information of the sales people and the of the customers and so on .What is more important is the information management of the automobiles .In face of the variety of information, what the author need is th

8、e structure of the data-base to store the information and the effective structure of the process to support the operation of the various data.Key words: Online order; Database; Information Management目目 錄錄論文總頁數(shù):25 頁1 引言引言.11.1課題研究背景.11.2本課題的研究意義.11.3本課題的研究方法.12開發(fā)工具的選擇開發(fā)工具的選擇.12.1SQL SERVER數(shù)據(jù)庫管理系統(tǒng)簡介 .

9、12.2C語言簡介.23系統(tǒng)需求分析與設(shè)計(jì)系統(tǒng)需求分析與設(shè)計(jì).23.1系統(tǒng)功能結(jié)構(gòu).23.2系統(tǒng)管理模塊分析.24數(shù)據(jù)庫的詳細(xì)設(shè)計(jì)與實(shí)現(xiàn)數(shù)據(jù)庫的詳細(xì)設(shè)計(jì)與實(shí)現(xiàn).24.1數(shù)據(jù)庫需求與功能分析.24.2數(shù)據(jù)庫模塊設(shè)計(jì)結(jié)構(gòu).34.3數(shù)據(jù)庫物理結(jié)構(gòu)設(shè)計(jì).54.4各數(shù)據(jù)表關(guān)系圖.74.5數(shù)據(jù)庫結(jié)構(gòu)實(shí)現(xiàn).74.5.1數(shù)據(jù)庫的連接 .74.5.2數(shù)據(jù)庫連接后實(shí)現(xiàn)數(shù)據(jù)的調(diào)用 .74.5.3數(shù)據(jù)存儲(chǔ)過程的實(shí)現(xiàn) .84.5.4實(shí)現(xiàn)數(shù)據(jù)庫調(diào)用的部分關(guān)鍵語句 .85汽車銷售管理系統(tǒng)前臺(tái)模塊實(shí)現(xiàn)汽車銷售管理系統(tǒng)前臺(tái)模塊實(shí)現(xiàn).115.1模塊實(shí)現(xiàn)部分:運(yùn)行主登錄界面.115.2 銷售人員登陸頁面 .125.3 客戶管理服務(wù)

10、頁面 .145.4 客戶定購信息以及回饋頁面.176系統(tǒng)測(cè)試總結(jié)系統(tǒng)測(cè)試總結(jié).216.1系統(tǒng)實(shí)現(xiàn)的特點(diǎn).216.2系統(tǒng)實(shí)現(xiàn)的功能測(cè)試總結(jié).21結(jié)結(jié) 論論.22參考文獻(xiàn)參考文獻(xiàn).22致致 謝謝.23聲聲 明明.241 1 引言引言 1.11.1 課題研究背景課題研究背景汽車產(chǎn)業(yè)的興旺發(fā)展帶動(dòng)顧客對(duì)于汽車類型選擇的大步前進(jìn),目前大多數(shù)汽車銷售連鎖店的銷售管理是用簡易進(jìn)行的。隨著汽車款式的不斷更新,汽車各項(xiàng)功能配置會(huì)不斷的增多,簡易工作已不能適應(yīng)時(shí)代的發(fā)展需求,由于各銷售店每天的銷售量很大,難免會(huì)在業(yè)務(wù)方面及財(cái)務(wù)方面出現(xiàn)漏洞,給企業(yè)的經(jīng)營帶來種種弊端,有時(shí)還會(huì)帶給客戶不必要的麻煩。要想解決這些難題,

11、就必須有一套科學(xué)、高效、嚴(yán)密汽車銷售管理系統(tǒng)作為依托進(jìn)行和客戶的交易。當(dāng)今的中小企業(yè),一般應(yīng)具有產(chǎn)品開發(fā)、生產(chǎn)、銷售、服務(wù)的能力,為此企業(yè)都設(shè)有相應(yīng)的機(jī)構(gòu),以管理各個(gè)環(huán)節(jié)的業(yè)務(wù)。以此前提作為系統(tǒng)設(shè)計(jì)的基礎(chǔ),開發(fā)一個(gè)更適合客戶和銷售人員交流的這樣一個(gè)汽車銷售系統(tǒng),來滿足日益發(fā)展的汽車銷售業(yè).的要求。1.21.2 本課題的研究意義本課題的研究意義為了更好的適應(yīng)汽車銷售管理市場(chǎng)發(fā)展的不平衡性,更好的為客戶在選擇汽車類型方面便利,為更多不了解汽車的客戶提供一個(gè)交流平臺(tái),我們選擇這樣一個(gè) MIS 信息管理系統(tǒng)來進(jìn)行。 1.31.3 本課題的研究方法本課題的研究方法本系統(tǒng)是在充分理解 MIS 系統(tǒng),具備了

12、一定的軟件設(shè)計(jì)與開發(fā)的能力的前提條件下。綜合以前所學(xué)理論知識(shí),結(jié)合自己的實(shí)際開發(fā)水平,設(shè)計(jì)并開發(fā)完成的一個(gè)汽車銷售管理系統(tǒng)。該系統(tǒng)運(yùn)用了 C/S 模式開發(fā),用 C#語言作為開發(fā)的前臺(tái)語言,數(shù)據(jù)庫采用 SQLserver2000。 2 2開發(fā)工具的選擇開發(fā)工具的選擇2.12.1 SQLSQL ServerServer 數(shù)據(jù)庫管理系統(tǒng)簡介數(shù)據(jù)庫管理系統(tǒng)簡介本系統(tǒng)的開發(fā)選擇了 SQL 數(shù)據(jù)庫,它適用于中小型事物處理及客戶端/服務(wù)端結(jié)構(gòu)的應(yīng)用系統(tǒng)。它功能強(qiáng)大操作簡便,日益為廣大數(shù)據(jù)庫用戶所喜愛。越來越多的開發(fā)工具提供了與 SQL Server 的接口。SQL Server 2000 是 Microso

13、ft 公司推出的 SQL Server 數(shù)據(jù)庫管理系統(tǒng)的最新版本,該版本繼承了 SQL Server 7.0 版本的優(yōu)點(diǎn),同時(shí)又比它增加了許多更先進(jìn)的功能、具有使用方便、可伸縮性好與相關(guān)軟件集成程度高等優(yōu)點(diǎn)。MSSQL Server 不但可以應(yīng)用于大中型數(shù)據(jù)庫管理中,建立分布式關(guān)系數(shù)據(jù)庫,并且也可以開發(fā)桌面數(shù)據(jù)庫。事實(shí)上,SQL Server 數(shù)據(jù)庫處理的基本結(jié)構(gòu),采取關(guān)系型數(shù)據(jù)庫模式,盡管如此,相信大家都可以輕易的發(fā)現(xiàn),在 SQL Server 的數(shù)據(jù)庫處理方式,則是使用面向?qū)ο蟮牟僮鞣绞脚c精神,也就是說,SQL Server 的所有功能,都可以基于系統(tǒng)已經(jīng)建立好的一些對(duì)象來達(dá)成,是相當(dāng) O

14、O(面向?qū)ο螅┑囊粋€(gè)系統(tǒng)結(jié)構(gòu)。2.22.2 C C語言簡介語言簡介C#是一種現(xiàn)代的面向?qū)ο笳Z言。它使程序員快速便捷地創(chuàng)建基于Microsoft .NET 平臺(tái)的解決方案。這種框架使 C#組件可以方便地轉(zhuǎn)化為 XML 網(wǎng)絡(luò)服務(wù),從而使任何平臺(tái)的應(yīng)用程序都可以通過 Internet 調(diào)用它。 C#增強(qiáng)了開發(fā)者的效率,同時(shí)也致力于消除編程中可能導(dǎo)致嚴(yán)重結(jié)果的錯(cuò)誤。我認(rèn)為程序員可以快速進(jìn)行網(wǎng)絡(luò)開發(fā),同時(shí)也保持了開發(fā)者所需要的強(qiáng)大性和靈活性。 使得我們?cè)谡Z言和模塊實(shí)現(xiàn)方面更加快捷和方便。 3 3系統(tǒng)需求分析與設(shè)計(jì)系統(tǒng)需求分析與設(shè)計(jì)3.13.1 系統(tǒng)系統(tǒng)功能結(jié)構(gòu)功能結(jié)構(gòu)本課題的具體任務(wù)就是設(shè)計(jì)一個(gè)汽車銷售

15、管理信息系統(tǒng),它是一款利用現(xiàn)代計(jì)算機(jī)和數(shù)據(jù)庫開發(fā)技術(shù)來代替人工處理,從而減輕企業(yè)各部門工作人員的勞動(dòng)強(qiáng)度,提高工作質(zhì)量和效率,提高信息資源的利用率和企業(yè)管理水平的實(shí)用軟件。其主要的功能設(shè)計(jì)有:對(duì)汽車類型的購進(jìn),客戶信息及銷售情況進(jìn)行日常的管理,如:添加、刪除、修改數(shù)據(jù)庫信息;查詢信息;系統(tǒng)維護(hù)等。該系統(tǒng)還有在銷售人員登錄后能夠自動(dòng)庫存更新的功能,使得企業(yè)能夠?qū)ζ囆畔⑦M(jìn)行實(shí)時(shí)的管理,提高工作效率。3.23.2 系統(tǒng)管理模塊分析系統(tǒng)管理模塊分析通過對(duì)汽車銷售管理業(yè)務(wù)的調(diào)查分析與資料查詢,弄清了汽車銷售管理的工作業(yè)務(wù)流程和管理功能。 汽車銷售管理信息系統(tǒng)主要有以下幾項(xiàng)管理功能:信息數(shù)據(jù)管理:管理員

16、對(duì)汽車信息的輸入、存庫和維護(hù)??蛻粽?qǐng)求信息管理:對(duì)銷售業(yè)務(wù)涉及的問題進(jìn)行交流回饋??蛻舳ㄙ徯畔⒐芾恚簩?duì)客戶定購需求的信息進(jìn)行歸檔管理。汽車信息管理:對(duì)新進(jìn)汽車的信息進(jìn)行歸檔管理。信息查詢統(tǒng)計(jì)管理:管理員通過對(duì)客戶提供的汽車信息找到客戶所需的汽車并通過客戶信息庫對(duì)客戶的核查后,把客戶所需的汽車信息提供給客戶。對(duì)銷售、庫存等的統(tǒng)計(jì)。4 4數(shù)據(jù)庫的詳細(xì)設(shè)計(jì)數(shù)據(jù)庫的詳細(xì)設(shè)計(jì)與實(shí)現(xiàn)與實(shí)現(xiàn)4.14.1 數(shù)據(jù)庫需求與功能分析數(shù)據(jù)庫需求與功能分析用戶的需求具體體現(xiàn)在各種信息的提供、保存、更新和查詢,這就要求數(shù)據(jù)庫結(jié)構(gòu)能充分滿足各種信息的輸出和輸入。收集基本數(shù)據(jù)、數(shù)據(jù)結(jié)構(gòu)以及數(shù)據(jù)處理的流程,組成一份詳盡的數(shù)據(jù)字

17、典,為后面的具體設(shè)計(jì)打下基礎(chǔ)。同時(shí)在完成基本功能的同時(shí)還要實(shí)現(xiàn)銷售人員對(duì)于客戶問題回答,以及客戶對(duì)于汽車選購等等實(shí)現(xiàn)功能。仔細(xì)分析調(diào)查有汽車銷售公司管理信息需求的基礎(chǔ)上,將得到如圖所示的本系統(tǒng)所處理的數(shù)據(jù)流程。 進(jìn)入系統(tǒng)分類查詢選購汽車訂購判斷是否登錄是否繼續(xù)選購客戶信息生產(chǎn)訂單查看訂單信息回饋NY開始NY圖 4-1 客戶與銷售人員交易圖4.24.2 數(shù)據(jù)庫模塊設(shè)計(jì)結(jié)構(gòu)數(shù)據(jù)庫模塊設(shè)計(jì)結(jié)構(gòu) 有了以上數(shù)據(jù)項(xiàng)以及數(shù)據(jù)結(jié)構(gòu)后,以及實(shí)現(xiàn)的各項(xiàng)以后,就可以設(shè)計(jì)出能夠滿足用戶需求的各種實(shí)體,以及它們之間的關(guān)系,為后面的邏輯結(jié)構(gòu)設(shè)計(jì)打下基礎(chǔ)。這些實(shí)體包含各種具體信息,通過相互之間的作用形成數(shù)據(jù)的流動(dòng)。根據(jù)上面

18、得出有以下數(shù)據(jù)項(xiàng):ACASE(客戶信息實(shí)體) ;AutoMobile(汽車信息實(shí)體) ;Emploee(銷售人員信息實(shí)體) ;FQ(客戶服務(wù)信息實(shí)體) ;Picture(圖片信息實(shí)體) ;Resolvecase(回饋信息實(shí)體)ACASE(客戶信息實(shí)體)E-R 圖:IDCCommentsautoIDCustomECommentsaCase圖 4-2 ACASE(客戶信息實(shí)體)E-R 圖AutoMobile(汽車信息實(shí)體)E-R 圖: IDCostaNameCompanyPriceAutoMobile圖 4-3 AutoMobile(汽車信息實(shí)體)E-R 圖Emploee(銷售人員信息實(shí)體)E-R

19、 圖:圖 4-4 Emploee(銷售人員信息實(shí)體)E-R 圖FQ(客戶服務(wù)信息實(shí)體)E-R 圖:IDAnswerautoIDQuestionStateFQ圖 4-5 FQ(客戶服務(wù)信息實(shí)體)E-R 圖Picture(圖片信息實(shí)體)E-R 圖:PicaNamePicture圖 4-6 Picture(圖片信息實(shí)體)E-R 圖Resolvecase(回饋信息實(shí)體)E-R 圖:IDPwdeNamePositionEmploee圖 4-7 Resolvecase(回饋信息實(shí)體)E-R 圖購買汽車客戶m1圖 4-8 購買關(guān)系 E-R 圖4.34.3 數(shù)據(jù)庫物理結(jié)構(gòu)設(shè)計(jì)數(shù)據(jù)庫物理結(jié)構(gòu)設(shè)計(jì)現(xiàn)在需要將上面的

20、數(shù)據(jù)庫概念結(jié)構(gòu)轉(zhuǎn)化為 SQL Server 2000 數(shù)據(jù)庫系統(tǒng)所支持的實(shí)際數(shù)據(jù)模型,也就是數(shù)據(jù)庫的邏輯結(jié)構(gòu)。汽車銷售管理系統(tǒng)數(shù)據(jù)庫中各個(gè)表格的設(shè)計(jì)結(jié)果如下面表格所示。每個(gè)表格表示在數(shù)據(jù)庫中的一個(gè)表。表 4-1 客戶信息表aCase列名數(shù)據(jù)類型長度是否為空IDint40autoIDint40Customchar100CCommentschar1000ECommentschar1000orderDatedatetime80Paymentchar500Citychar200表 4-2 汽車信息表AutoMobile列名數(shù)據(jù)類型長度是否為空IDint40aNamechar400Companychar

21、500Costint40Priceint40Amountint40Descriptionchar4000ProfitIDautoIDresolvedCase表 4-3 銷售人員信息表Emploee列名數(shù)據(jù)類型長度是否為空IDint40eNamechar100Positionchar200Pwdchar200uvaluenvarchar2551lvalueimage161versionint40表 4-4 客戶服務(wù)信息表FQ列名數(shù)據(jù)類型長度是否為空IDint40autoIDint40Questionchar2000Answerchar4000Stateint40表 4-5 圖片信息表Pictur

22、e列名數(shù)據(jù)類型長度是否為空aNamechar400Picimage160表 4-6 回饋信息表resolvedCase列名數(shù)據(jù)類型長度是否為空IDint40autoIDint40Profitint404.44.4 各數(shù)據(jù)表關(guān)系圖各數(shù)據(jù)表關(guān)系圖Picture a aN Na am me e P Pi ic cFK1IDresolvedCaseP PK K, ,F FK K1 1I ID D a au ut to oI ID D P Pr ro of fi it taCaseP PK KI ID D a au ut to oI ID D C Cu us st to om m C CC Co om

23、mm me en nt ts s E EC Co om mm me en nt ts s o or rd de er rD Da at te e P Pa ay ym me en nt t C Ci it ty yAutoMobile a aN Na am me e C Co om mp pa an ny y C Co os st t P Pr ri ic ce e A Am mo ou un nt t D De es sc cr ri ip pt ti io on nFK1IDEmploee e eN Na am me e P Po os si it ti io on n P Pw wd d

24、FK1IDFQP PK K, ,F FK K1 1I ID D a au ut to oI ID D Q Qu ue es st ti io on n A An ns sw we er r S St ta at te e圖 4-8 數(shù)據(jù)表關(guān)系圖4.54.5 數(shù)據(jù)庫結(jié)構(gòu)實(shí)現(xiàn)數(shù)據(jù)庫結(jié)構(gòu)實(shí)現(xiàn)通過前面對(duì)于數(shù)據(jù)庫部分的分析,現(xiàn)在可以在 SQL Server 2000 數(shù)據(jù)庫系統(tǒng)中實(shí)現(xiàn)該邏輯結(jié)構(gòu)。這是利用 SQL Server 2000 數(shù)據(jù)庫系統(tǒng)中的 SQL 查詢分析器實(shí)現(xiàn)的。下面給出部分實(shí)現(xiàn)上面各種關(guān)系的 SQL 語句。.1 數(shù)據(jù)庫數(shù)據(jù)庫的連接的連接表示使用當(dāng)前登錄到系統(tǒng)的帳號(hào)訪問后臺(tái)

25、數(shù)據(jù)庫,進(jìn)行數(shù)據(jù)相關(guān)的調(diào)用class opAutoMobileprivate string conStr = server=D9J5732X;Integrated Security=SSPI;DataBase=SaleDB;private DbObject db;public opAutoMobile()db = new DbObject(conStr);.2 數(shù)據(jù)庫連接后實(shí)現(xiàn)數(shù)據(jù)的調(diào)用數(shù)據(jù)庫連接后實(shí)現(xiàn)數(shù)據(jù)的調(diào)用通過以下被設(shè)定的參數(shù)訪問 SQLServer,并且通過 sqlcommand 和sqlconnection 來實(shí)現(xiàn)數(shù)據(jù)庫更新,通過想數(shù)據(jù)庫發(fā)送更新數(shù)據(jù)庫的 SQL 語句

26、實(shí)現(xiàn).class DbObjectprivate SqlConnection connection;private string connectString;public DbObject(string constring)this.connectString = constring;this.connection = new SqlConnection(this.connectString);private SqlCommand buildCommand(string storedProc,SqlParameter parameters) SqlCommand command = new S

27、qlCommand();command.Connection = this.connection;command.CommandText = storedProc.Trim();command.CommandType = CommandType.StoredProcedure;if(parameters != null)foreach(SqlParameter p in parameters)command.Parameters.Add(p);return command;/buildCommand.3 數(shù)據(jù)存儲(chǔ)過程的實(shí)現(xiàn)數(shù)據(jù)存儲(chǔ)過程的實(shí)現(xiàn)SqlDataReader 實(shí)現(xiàn)單項(xiàng)數(shù)

28、據(jù)操作,不提供數(shù)據(jù)的緩存,并且在整個(gè)過程中它由 Buildcommond 產(chǎn)生,實(shí)現(xiàn)數(shù)據(jù)參數(shù)的傳遞,在實(shí)現(xiàn)過程中,構(gòu)造了 sql Command 對(duì)象 cmd,然后調(diào)用 cmd 的 ExecuteReader 方法,并且返回一個(gè) Reader對(duì)象,實(shí)現(xiàn)存儲(chǔ).public SqlDataReader runProcedure(string storedProc,SqlParameter parameters)SqlDataReader reader;SqlCommand cmd = this.buildCommand(storedProc,parameters);if(connection.St

29、ate = ConnectionState.Closed )connection.Open();Reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);/connection.Close();return reader;public void extProcedure(string storedProc,SqlParameter parameters)SqlCommand cmd = this.buildCommand(storedProc,parameters);if(connection.State = ConnectionS

30、tate.Closed)connection.Open();cmd.ExecuteNonQuery();connection.Close();.4 實(shí)現(xiàn)數(shù)據(jù)庫調(diào)用的部分關(guān)鍵語句實(shí)現(xiàn)數(shù)據(jù)庫調(diào)用的部分關(guān)鍵語句(1)更新汽車信息模塊的實(shí)現(xiàn),定義SQL數(shù)據(jù)參數(shù),運(yùn)用UPDATE實(shí)現(xiàn)對(duì)于數(shù)據(jù)的更新:public void updateMobile(string name,int price,int amount,string Description)SqlParameter parameters = new SqlParameter(aName,SqlDbType.Char,40), n

31、ew SqlParameter(Price,SqlDbType.Int,4), new SqlParameter(Amount,SqlDbType.Int,4), new SqlParameter(Description,SqlDbType.Char,400);parameters0.Value = name;parameters1.Value = price;parameters2.Value = amount;parameters3.Value = Description;db.extProcedure(updateMobile,parameters);/opAutoMobile(2)實(shí)現(xiàn)

32、將后臺(tái)的數(shù)據(jù)填充到DS中去,并且實(shí)現(xiàn)對(duì)于汽車信息的查詢,運(yùn)用SELECT語句進(jìn)行數(shù)據(jù)的查詢:public DataSet MoblieTable()SqlConnection con = new SqlConnection(conStr);if(con.State = ConnectionState.Closed)con.Open();string s = select * from AutoMobile;SqlCommand cmd = new SqlCommand(s,con);SqlDataAdapter da = new SqlDataAdapter(cmd); cmd.Execute

33、NonQuery(); DataSet ds = new DataSet();da.Fill(ds,AutoMobile);con.Close();return ds;(3)通過數(shù)據(jù)庫和前臺(tái)的連接,并且對(duì)于SqlDataReader中reader對(duì)象的更新,并且根據(jù)其后的參數(shù)進(jìn)行操作,實(shí)現(xiàn)對(duì)于客戶信息的回答: public string GetAnswer(int ID)string s = string.Empty;/ArrayList al = new ArrayList();SqlParameter parameters =new SqlParameter(ID,SqlDbType.In

34、t,4);parameters0.Value = ID;SqlDataReader reader = dbo.runProcedure(GetAnswer,parameters);if(reader.Read()s = Convert.ToString(readerAnswer);reader.Close();return s;/opFQ(4)對(duì)于信息的添加,添加相關(guān)的參數(shù),對(duì)于新的參數(shù)的定義,通過存儲(chǔ)和構(gòu)造函數(shù)的調(diào)出來實(shí)現(xiàn):public void AddCase(int autoID,string custom,string ccomments,string ecomments)SqlPar

35、ameter parameters = new SqlParameter(autoID,SqlDbType.Int,4), new SqlParameter(Custom,SqlDbType.Char,10), new SqlParameter(CComments,SqlDbType.Char,100),new SqlParameter(EComments,SqlDbType.Char,100);parameters0.Value = autoID;parameters1.Value = custom;parameters2.Value = ccomments;parameters3.Valu

36、e = ecomments;dbo.extProcedure(AddCase,parameters);/addCase/opCase#endregion(5)銷售人員登陸的實(shí)現(xiàn)過程,主要表現(xiàn)在先對(duì)銷售人員的一個(gè)參數(shù)定義,定義ename和pwd兩個(gè)變量,并且通過對(duì)于Sqlparameter中reader中的對(duì)象進(jìn)行傳遞,在dbo.runProcedure中添加數(shù)據(jù)參數(shù),并實(shí)現(xiàn)整個(gè)過程:public Emploee Login(string pwd,string name)Emploee em = null;SqlParameter parameters = new SqlParameter(pw

37、d,SqlDbType.Char,20), new SqlParameter(eName,SqlDbType.Char,10);parameters0.Value = pwd;parameters1.Value = name;SqlDataReader reader = dbo.runProcedure(Login,parameters);if(reader.Read() em = new Emploee();em.ID = Convert.ToInt32(readerID); = name;em.Position = Convert.ToString(readerPositio

38、n);em.Pwd = pwd;elseem = new Emploee();reader.Close();return em; 5 5汽車銷售管理系統(tǒng)前臺(tái)模塊實(shí)現(xiàn)汽車銷售管理系統(tǒng)前臺(tái)模塊實(shí)現(xiàn)5.15.1 模塊實(shí)現(xiàn)部分模塊實(shí)現(xiàn)部分:運(yùn)行主登錄界面:運(yùn)行主登錄界面進(jìn)入圖 5-1 進(jìn)行,在這個(gè)可以進(jìn)行汽車車型的閱覽和車型的查詢,對(duì)于用戶來說這是一個(gè)展示汽車詳細(xì)信息的頁面,進(jìn)入用戶登錄界面進(jìn)行查詢??梢栽谶@個(gè)生成頁面里面,根據(jù)系統(tǒng)的語言通過第三方控件,在銷售人員我和客戶直接搭建一個(gè)展示窗口,通過這個(gè)第三方控件實(shí)現(xiàn)汽車銷售系統(tǒng)的最初的展示,并且給與用戶更多的選擇信息。整個(gè)系統(tǒng)主頁面實(shí)現(xiàn)以下幾個(gè)功能:文

39、件銷售人員登陸輸入用戶名和密碼登陸進(jìn)行新車入庫更新。SUV 汽車類型選擇購車類型點(diǎn)擊進(jìn)入汽車信息界面選擇需要汽車。顧客操作常見消費(fèi)者問題輸入問題(暫時(shí)不能實(shí)現(xiàn)問題的回饋) 。SUV 汽車類型選擇定購此車輸入相應(yīng)的客戶選擇信息初步交易。圖 5-1 汽車銷售系統(tǒng)主頁面主頁面前臺(tái)代碼中用到的數(shù)據(jù)庫圖表(如圖 5-2):圖 5-2 客戶信息圖實(shí)現(xiàn)代碼如下:class Casepublic int ID = -1;public int autoID = -1;public string Custom = string.Empty;public string CComments = string.Empt

40、y;public string EComments = string.Empty;class opCaseDbObject dbo = null;private string conStr = server=D9J5732X;Integrated Security=SSPI;DataBase=SaleDB;public opCase()this.dbo = new DbObject(conStr);public void AddCase(int autoID,string custom,string ccomments,string ecomments)SqlParameter paramet

41、ers = new SqlParameter(autoID,SqlDbType.Int,4), new SqlParameter(Custom,SqlDbType.Char,10), new SqlParameter(CComments,SqlDbType.Char,100),new SqlParameter(EComments,SqlDbType.Char,100);parameters0.Value = autoID;parameters1.Value = custom;parameters2.Value = ccomments;parameters3.Value = ecomments;

42、dbo.extProcedure(AddCase,parameters);/addCase/opCase5.25.2 銷售人員登陸頁面銷售人員登陸頁面在文件一覽進(jìn)入銷售人員的登陸,進(jìn)入后登陸,出現(xiàn)以上的界面,進(jìn)行汽車車型,型號(hào),售價(jià)等等的更新和添加,對(duì)于銷售人員及時(shí)根據(jù)市場(chǎng)的需要進(jìn)行更新做好的條件。客戶可以在這個(gè)銷售信息那一欄找到自己所需要的汽車類型進(jìn)行查詢和選擇,這樣更有利于銷售人員和客戶之間的交流。圖 5-3 銷售人員登陸頁面銷售信息實(shí)體在前臺(tái)代碼中實(shí)現(xiàn)的圖表(如圖 5-4):圖 5-4 銷售人員登陸圖實(shí)現(xiàn)代碼如下:#region 雇員相關(guān)操作class Emploeepublic int

43、 ID = -1;public string name = string.Empty;public string Position = string.Empty;public string Pwd = string.Empty;class opEmploeeprivate DbObject dbo = null;private string conStr = server=D9J5732X;Integrated Security=SSPI;DataBase=SaleDB;public opEmploee()dbo = new DbObject(conStr);public Emploee Lo

44、gin(string pwd,string name)Emploee em = null;SqlParameter parameters = new SqlParameter(pwd,SqlDbType.Char,20), new SqlParameter(eName,SqlDbType.Char,10);parameters0.Value = pwd;parameters1.Value = name;SqlDataReader reader = dbo.runProcedure(Login,parameters);if(reader.Read()em = new Emploee();em.I

45、D = Convert.ToInt32(readerID); = name;em.Position = Convert.ToString(readerPosition);em.Pwd = pwd; elseem = new Emploee();reader.Close();return em; #endregion5.35.3 客戶管理服務(wù)客戶管理服務(wù)頁面頁面通過對(duì)于客戶的需求進(jìn)行分析和總結(jié),對(duì)于客戶相關(guān)問題的提出和解決,深入的了解客戶的需求以及解決客戶存在的相關(guān)問題。對(duì)于不同的汽車類型的選擇,根據(jù)不同的 F&Q 找到適合客戶需求的汽車類型。銷售人員根據(jù)不同的客戶不同的選

46、擇然后進(jìn)行相關(guān)解答,在銷售系統(tǒng)上面實(shí)現(xiàn)。圖 5-5 銷售系統(tǒng)管理,回答客戶問題服務(wù)界面客戶服務(wù)信息實(shí)體在前臺(tái)代碼中實(shí)現(xiàn)圖表(如圖 5-6): 圖 5-6 銷售人員服務(wù)圖實(shí)現(xiàn)代碼如下:class FQpublic int ID = -1;public int autoID = -1;public string Question = string.Empty;public string Answer = string .Empty;class opFQprivate DbObject dbo;private string conStr = server=D9J5732X;Integrated Se

47、curity=SSPI;DataBase=SaleDB;public opFQ()this.dbo = new DbObject(conStr);public DataSet getFQTable()SqlConnection con = new SqlConnection(conStr);if(con.State = ConnectionState.Closed)con.Open();string s = select * from FQ where State = -1;SqlCommand cmd = new SqlCommand(s,con);SqlDataAdapter da = n

48、ew SqlDataAdapter(cmd);cmd.ExecuteNonQuery();DataSet ds = new DataSet();da.Fill(ds,AutoMobile);con.Close();return ds;public void addQuesion(int autoID,string Question,string Answer)SqlParameter parameters = /new SqlParameter(ID,SqlDbType.Int,4),new SqlParameter(autoID,SqlDbType.Int,4), new SqlParame

49、ter(Question,SqlDbType.Char,200), new SqlParameter(Answer,SqlDbType.Char,400), new SqlParameter(State,SqlDbType.Int,4);/parameters0.Direction = ParameterDirection.Output;parameters0.Value = autoID;parameters1.Value = Question;parameters2.Value = Answer;parameters3.Value = -1;dbo.extProcedure(AddQues

50、tion,parameters);/addQuestionpublic ArrayList GetFQ(int autoID)ArrayList al = new ArrayList();FQ f = null;SqlParameter parameters = new SqlParameter(autoID,SqlDbType.Int,4);parameters0.Value = autoID;SqlDataReader reader = dbo.runProcedure(GetFQ,parameters);while(reader.Read()f = new FQ();f.ID = Con

51、vert.ToInt32(readerID);f.Question = Convert.ToString(readerQuestion);al.Add(f);reader.Close();return al;/ getFQpublic ArrayList GetAllFQ()ArrayList al = new ArrayList();FQ f = null;SqlDataReader reader = dbo.runProcedure(GetAllFQ,null);while(reader.Read()f = new FQ();f.ID = Convert.ToInt32(readerID)

52、;f.Question = Convert.ToString(readerQuestion);al.Add(f);reader.Close();return al;/GETALLFQpublic string GetAnswer(int ID)string s = string.Empty;/ArrayList al = new ArrayList();SqlParameter parameters =new SqlParameter(ID,SqlDbType.Int,4);parameters0.Value = ID;SqlDataReader reader = dbo.runProcedu

53、re(GetAnswer,parameters);if(reader.Read()s = Convert.ToString(readerAnswer);reader.Close(); return s;/opFQ5.45.4 客戶定購信息以及回饋客戶定購信息以及回饋頁面頁面作為程序的開始,運(yùn)行主頁面,進(jìn)行銷售分析,了解客戶的需求,對(duì)于需求進(jìn)行市場(chǎng)采購,然后對(duì)于汽車信息以及客戶信息進(jìn)行適時(shí)的更新,滿足客戶的需要。在程序的整個(gè)運(yùn)行過程中,進(jìn)行適時(shí)的分析,在前臺(tái)加入了第三方控件 ,對(duì)于在程序過程中的數(shù)據(jù)的更新,查詢,添加等都得到很好的實(shí)現(xiàn),并且能夠按照客戶信息進(jìn)行交易.在這個(gè)銷售系統(tǒng)中,進(jìn)入主頁面以

54、后,可以根據(jù)不同人的需求進(jìn)行不同的運(yùn)行操作,通過點(diǎn)擊“左邊生成的相關(guān)汽車的文件夾” ,選擇你喜歡的汽車類型,然后點(diǎn)擊“訂購此車” ,再根據(jù)我們的需求進(jìn)行調(diào)取數(shù)據(jù)庫中的內(nèi)容,獲得相關(guān)汽車訂購消息,并且選擇,進(jìn)行約定交易。圖 5-7 預(yù)定汽車銷售頁面在主頁面選擇汽車的信息以后,進(jìn)入上下兩個(gè)界面進(jìn)行交易的銜接,實(shí)現(xiàn)客戶信息輸入和確認(rèn)以及客戶要求的獲取,并在汽車服務(wù)的有限條件里獲取自己想要的汽車類型,按照自己希望購買的汽車類型填寫詳細(xì)的汽車以及相關(guān)問題,然后選擇客戶信息和客戶要求部分填寫,根據(jù)商家的承諾得到更多的相信信息。圖 5-8 銷售人員回復(fù)客戶要求頁面汽車信息實(shí)體在前臺(tái)代碼中的圖表(如圖 5-9

55、):圖 5-9 汽車信息圖實(shí)現(xiàn)代碼如下:class autoMobilepublic int ID = 0;public string aName = string.Empty;public string Company = string.Empty;public int Cost = 0;public int Price = 0;public int Amount = 0;public string Description = 沒有任何的描述;/AutoMobile相關(guān)操作。class opAutoMobileprivate string conStr = server=D9J5732X;I

56、ntegrated Security=SSPI;DataBase=SaleDB;private DbObject db;public opAutoMobile()db = new DbObject(conStr);public ArrayList getTitle()ArrayList al = new ArrayList();autoMobile name = null;SqlDataReader reader = db.runProcedure(GetAuto,null);while(reader.Read()name = new autoMobile();name.ID = Conver

57、t.ToInt32(readerID);name.aName = Convert.ToString(readeraName);al.Add(name);reader.Close();return al;public autoMobile getDetails(int ID)/ArrayList al = new ArrayList();autoMobile details = null;SqlParameter parameters = new SqlParameter(autoID,SqlDbType.Int,4);parameters0.Value = ID;SqlDataReader r

58、eader = db.runProcedure(DisplayAuto,parameters);if(reader.Read()details = new autoMobile();details.aName = Convert.ToString(readeraName);details.Company = Convert.ToString(readerCompany);details.Price = Convert.ToInt32(readerPrice);details.Description = Convert.ToString(readerDescription);reader.Clo

59、se();return details;/autoMobileopublic DataSet MoblieTable()SqlConnection con = new SqlConnection(conStr);if(con.State = ConnectionState.Closed)con.Open();string s = select * from AutoMobile;SqlCommand cmd = new SqlCommand(s,con);SqlDataAdapter da = new SqlDataAdapter(cmd); cmd.ExecuteNonQuery(); Da

60、taSet ds = new DataSet();da.Fill(ds,AutoMobile);con.Close();return ds;public void AddautoMobile(string name,string company,int cost,int price,int amount,string description)SqlParameter parameters = new SqlParameter(aName,SqlDbType.Char,40), new SqlParameter(Company,SqlDbType.Char,50), new SqlParameter(C

溫馨提示

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

評(píng)論

0/150

提交評(píng)論