




已閱讀5頁,還剩37頁未讀, 繼續(xù)免費閱讀
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
濱州學院數(shù)據(jù)庫原理與應用課程設計 數(shù)據(jù)庫原理與應用課 程 設 計題 目 ASP+MSSQL的手機銷售管理系統(tǒng)系 (院) 計算機科學技術系 專 業(yè) 計算機網(wǎng)絡技術 班 級 2006級網(wǎng)一 學生姓名 42數(shù)據(jù)庫原理與應用課程設計一、課程設計概述(一)、課程設計的目的數(shù)據(jù)庫原理及應用課程設計是計算機專業(yè)集中實踐性環(huán)節(jié)之一,是學習完數(shù)據(jù)庫原理及應用課程后進行的一次全面的綜合練習。本課程設計主要在于加深學生對數(shù)據(jù)庫基礎理論和基本知識的理解,掌握數(shù)據(jù)庫應用系統(tǒng)設計開發(fā)的基本方法,達到進一步使學生綜合運用所學知識和增強實際動手能力的目的。(二)、課程設計的任務與要求要求學生根據(jù)自身的情況,構思一個系統(tǒng),以MS SQL Server作為后臺數(shù)據(jù)庫平臺,結合自己掌握的所有語言和平臺,完成一個小型數(shù)據(jù)庫應用系統(tǒng)的系統(tǒng)的分析、設計和開發(fā)。二、系統(tǒng)概述 (一)、系統(tǒng)需求分析現(xiàn)在隨著網(wǎng)絡、計算機以及數(shù)據(jù)庫的快速發(fā)展,手機的銷售也不再是傳統(tǒng)的實體店鋪模式,已經(jīng)轉向網(wǎng)絡。本系統(tǒng)就是面向一個企業(yè)的手機銷售管理系統(tǒng)。此系統(tǒng)是一種比較智能化的管理系統(tǒng),它能夠實現(xiàn)手機銷售的基本功能商品管理和訂單管理,用戶管理和網(wǎng)站管理??梢院芎玫膶崿F(xiàn)于用戶之間的互動.管理員在后臺必須輸入有效密碼才能成功進入此系統(tǒng)然后進行一系列的操作。對于非法操作,系統(tǒng)有識別和防護措施。(二)、系統(tǒng)功能需求分析本系統(tǒng)主要面向的用戶為系統(tǒng)管理員。簡單介紹下本系統(tǒng)的主要功能模塊:、登陸功能:登陸系統(tǒng)為身份驗證登錄。、商品管理:添加 刪除 修改 圖片上傳、訂單管理:查看,刪除,確認訂單 查看,刪除已確認訂單 查看,刪除訂單投訴、用戶管理:查看修改用戶資料,刪除用戶,設置用戶等級(普通,VIP) 管理員添加刪除、分類管理:添加,修改,刪除一級分類,二級分類、信息管理:添加,修改,刪除網(wǎng)站新聞 三、系統(tǒng)總體設計(一)、系統(tǒng)總體結構設計報刊訂閱管理系統(tǒng)主要是由登錄、使用幫助、商品管理、訂單管理、用戶管理、分類管理、信息管理等主要模塊構成。本系統(tǒng)的結構功能圖:手機銷售管理系統(tǒng)登陸使用幫助商品管理訂單管理用戶管理網(wǎng)站管理返回首頁注銷登陸查看服務器變量添加新廠商使用幫助添加新分類添加新手機查看新修改最新訂單已確認訂單查看投訴訂單管理網(wǎng)站用戶添加用戶添加新聞修改新聞添加評測修改評測添加軟件修改軟件添加故事修改故事圖3-1 系統(tǒng)結構功能圖(二)、系統(tǒng)數(shù)據(jù)模型設計1. 系統(tǒng)E-R圖本系統(tǒng)采用E-R圖(實體-關系圖)的方法進行數(shù)據(jù)庫概念結構設計。系統(tǒng)主要部分的E-R圖如下所示: 廠商:廠商名字廠 商I D圖3-2 廠商ER圖手機編號出品日期價格型號尺碼顏色出品公司包裝類型品牌手機:圖3-3 手機ER圖訂單訂 單訂單號訂貨人地址日期送出圖3-4 訂單的ER圖用戶:用戶用戶名EMAIL郵政編碼類型注冊時間地址ID圖3-5 用戶ER圖2. 關系模式廠商(id,名稱)手機(品牌,型號,編號,出品日期,出品公司,顏色,尺碼,包裝類型,價格)訂單(訂單號,訂貨人,日期,地址,送出)用戶(ID,用戶名,EMAIL,郵政編碼,地址,注冊時間,類型)新聞(標題,內容)評測(標題,內容)軟件(標題,內容)故事(標題,內容)3. 數(shù)據(jù)表下述為本系統(tǒng)關鍵表,其他非關鍵表不在敘述。、廠商表(表 sort)sort_namer為廠商名,如圖3-6圖3-6 廠商數(shù)據(jù)表、用戶表(表member)user_name是用戶名,Usrmail是EMAIl地址,User_pass是密碼,User_adds是地址,user_tel是聯(lián)系電話,User_regtime是注冊時間, User_lasttime是最后登陸時間,User_lastip是最后登陸IP,User_buymoney是所有資金.如圖3-7圖3-7 用戶數(shù)據(jù)表、手機表(表 hw)hw_name是貨物名字,hw_cash是價格,hw_content是描述,hw_date是添加時間,hw_pic是手機圖片,daili是代理價格,pifa是批發(fā)價格yeshu是顏色。如圖3-8圖3-8 手機數(shù)據(jù)表、訂單表(表 sub)user_name 是訂貨人,sub_numbersub_date是訂單時間,sub_emil是訂人EMAiL,sub_tel是訂貨人電話,sub_adds是訂貨人地址,qian是支付方式;如圖3-9圖3-9 訂單數(shù)據(jù)表4系統(tǒng)實施主要開發(fā)步驟:1 打開SQL SERVER 建立數(shù)據(jù)庫和相關數(shù)據(jù)表2 創(chuàng)業(yè)CONN.ASP,實現(xiàn)對數(shù)據(jù)庫的鏈接;代碼:3. 制作后臺登錄驗證界面index.asp,2login.asp對數(shù)據(jù)庫操作部分的代碼如下,它主要對應的是數(shù)據(jù)庫中的admin表 0 or InStr(admin_pass,) 0 thenresponse.write 請不要使用非法字符else%set rs=server.createobject(adodb.recordset)sql=select * from admin where admin_name=&admin_name& and admin_pass=&admin_pass&rs.open sql,conn,3,3 if rs.eof then response.write 用戶名和密碼不匹配 else session(admin_name)=rs(admin_name) response.redirect manage.asp end ifrs.closeset rs=nothingconn.closeset conn=nothingend ifend if%圖3-10 管理員登陸窗口4. 制作管理員主操作界面主界面采用了框架結合代碼如下: 5. 制作主操作界面中的 使用幫助模塊本模塊包括四個文件1.Index.asp(返回管理員登陸驗證界面)2.quit.asp(注銷登錄)3.aspchenk.asp(查看服務器變量)如圖3-11圖3-11 查看服務器變量4. main.asp(使用幫助)圖3-12 使用幫助界面6. 制作主操作界面中的商品管理模塊本模塊有四部分組成:圖3-13 商品管理界面、 addnewgrp.asp,addnewgrp1.asp(添加新廠商)本部分主要對應數(shù)據(jù)庫中的sort表操作。 addnewgrp.asp代碼 %if rs.eof and rs.bof then response.write 請增加類別else Do while not rs.eof response.write + rs(sort_name) + rs.MoveNext Loopend if% addnewgrp1.asp代碼% dim cmdTemp select case request.form(options) case rename on error resume next Set cmdTemp = Server.CreateObject(ADODB.Command) set rs=server.createobject(adodb.recordset) cmdTemp.CommandText = SELECT * FROM sort where sort_id= & request.form(subject) cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = conn rs.Open cmdTemp, , 1, 3 if err.Number0 then err.clear response.write 數(shù) 據(jù) 庫 操 作 失 敗 ! else rs(sort_name) = request.form(reTitle) rs.Update rs.Close set rs=nothing set cmdTemp=nothing finished end if case delRem 刪除欄目on error resume next sql=delete from sort where sort_id= & request.form(subject) conn.execute sql if err.Number0 then err.clear response.write 數(shù) 據(jù) 庫 操 作 失 敗 ! else finished end if case new on error resume next Set cmdTemp = Server.CreateObject(ADODB.Command) set rs=server.createobject(adodb.recordset) cmdTemp.CommandText = SELECT * FROM sort where (sort_id IS NULL) cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = conn rs.Open cmdTemp, , 1, 3 if err.Number0 then err.clear response.write 數(shù) 據(jù) 庫 操 作 失 敗 ! else rs.AddNew rs(sort_name) = request.form(newTitle) rs.Update rs.Close set rs=nothing set cmdTemp=nothing finished end if end selectsub finished() %圖3-14 添加新廠商頁面、addsort.asp,addsort2.asp(添加新分類)本部分主要對應數(shù)據(jù)可中的NSORT表操作。addsort2.asp代碼如下:% dim cmdTemp select case request.form(options) case rename on error resume next Set cmdTemp = Server.CreateObject(ADODB.Command) set rs=server.createobject(adodb.recordset) cmdTemp.CommandText = SELECT * FROM Nsort where Nsort_id= & request.form(subject) cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = conn rs.Open cmdTemp, , 1, 3 if err.Number0 then err.clear response.write 數(shù) 據(jù) 庫 操 作 失 敗 ! else rs(Nsort_name) = trim(request.form(reTitle) rs(sort_id) = request.form(sort_id) rs.Update rs.Close set rs=nothing set cmdTemp=nothing finished end if case delRem 刪除子欄目 on error resume next sql=delete from Nsort where Nsort_id= & request.form(subject) conn.execute sqlRem 刪除相關子欄目程序 sql=delete from hw where Nsort_id= & request.form(subject) conn.execute sql if err.Number0 then err.clear response.write 數(shù) 據(jù) 庫 操 作 失 敗 ! else finished end if case new Set cmdTemp = Server.CreateObject(ADODB.Command) set rs=server.createobject(adodb.recordset) cmdTemp.CommandText = SELECT * FROM Nsort where (Nsort_id IS NULL) cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = conn rs.Open cmdTemp, , 1, 3 if err.Number0 or request.form(psubject)= then err.clear response.write 數(shù) 據(jù) 庫 操 作 失 敗 ! else rs.AddNew rs(Nsort_name) = request.form(newTitle) rs(sort_id) = request.form(psubject) rs.Update rs.Close set rs=nothing set cmdTemp=nothing finished end if end select sub finished() %圖3-15 添加新分類頁面、ddnewtp.asp(添加新手機)本部分主要對數(shù)據(jù)庫中的NSORT表進行操作%if request(action)=save then hw_name=request(hw_name) hw_content=htmlencode2(request(hw_content)hw_content2=htmlencode2(request(hw_content2) hw_cash=request(hw_cash) hw_pic=request(hw_pic)chubsh=request(chubsh)zhuang=request(zhuang)yeshu=request(yeshu)isbn=request(isbn) sort_id=request(sort_id) Nsort_id=request(Nsort_id) company=request(company) pifa=request(pifa)daili=request(daili)hwsn=request(hwsn)data=request(data)kaiben=request(kaiben)tuijian=request(tuijian)jia=request(jia) if not(isnumeric(hw_cash) then errmsg=+價格應該為數(shù)字 founderr=true end if if hw_name= then errmsg=errmsg+名稱不能為空 founderr=true end if if hw_content= then errmsg=errmsg+介紹不能為空 founderr=true end if if sort_id= then errmsg=errmsg+類別不能為空 founderr=true end if if nsort_id= then errmsg=errmsg+類別不能為空 founderr=true end if if hw_pic= then hw_pic=image/noimage.gif if founderr=true then response.write errmsg response.write response.write 返回 response.end else hw_name=server.htmlencode(hw_name) hw_name=replace(hw_name, , ) hw_name=replace(hw_name,chr(13)&chr(10),) hw_content=server.htmlencode(hw_content) hw_content=replace(hw_content, , ) hw_content=replace(hw_content,chr(13)&chr(10),) hw_pic=server.htmlencode(hw_pic) sql=select * from hwset rs=server.createobject(adodb.recordset) rs.open sql,conn,3,3 rs.addnew rs(hw_name)=hw_name rs(hw_content)=hw_contentrs(hw_content2)=hw_content2 rs(hw_cash)=hw_cash rs(sort_id)=sort_id rs(Nsort_id)=Nsort_id rs(company)=company rs(daili)=daili rs(pifa)=pifa rs(hw_sn)=hwsn rs(chubsh)=chubsh rs(kaiben)=kaiben rs(yeshu)=yeshu rs(data)=data rs(isbn)=isbn rs(zhuang)=zhuang rs(hw_pic)=hw_pic rs(tuijian)=tuijian rs(jia)=jia rs.update end if response.write 貨物添加成功 response.write response.write 返回 rs.close else%var onecount;onecount=0;subcat = new Array(); subcat = new Array(,); onecount=;function changelocation(locationid) document.myform.Nsort_id.length = 0; var locationid=locationid; var i; for (i=0;i onecount; i+) if (subcati1 = locationid) document.myform.Nsort_id.optionsdocument.myform.Nsort_id.length = new Option(subcati0, subcati2); option selected value= option value= option selected value= option value=圖3-16 添加新手機頁面、elhw.asp changehw.asp(查看與修改)%if request(action)=del then sql=select * from hw where hw_id=&request(hw_id)set rs=server.createobject(adodb.recordset) rs.open sql,conn,3,3 if rs.eof then response.redirect delhw.asp else rs.delete rs.update end if rs.close response.write 貨物刪除成功 response.write response.write 返回else% % page=request.querystring(page) if page= then page=1 if not(isnumeric(page) then page=1 if pagetotalpage then page=totalpage rs.absolutepage=page rs.absolutepage=page i=0 dim hw_id(),hw_name(),hw_cash(),hw_pic(),hw_date(),sort_id(),isbn(),hw_sn(),Nsort_ind() do while not rs.eof and (i修改部分代碼如下:%if request(action)=save then hw_name=request(hw_name) hw_content=request(hw_content)hw_content2=request(hw_content2) hw_cash=request(hw_cash) hw_pic=request(hw_pic)chubsh=request(chubsh)zhuang=request(zhuang)yeshu=request(yeshu)isbn=request(isbn) sort_id=request(sort_id)Nsort_id=request(Nsort_id)tuijian=request(tuijian) company=request(company) pifa=request(pifa)daili=request(daili)hw_sn=request(hw_sn)data=request(data)kaiben=request(kaiben) if not(isnumeric(hw_cash) then errmsg=+價格應該為數(shù)字 founderr=true end if if hw_name= then errmsg=errmsg+名稱不能為空 founderr=true end if if hw_content= then errmsg=errmsg+介紹不能為空 founderr=true end if if sort_id= then errmsg=errmsg+類別不能為空 founderr=true end if if hw_pic= then hw_pic=image/noimage.gif if founderr=true then response.write errmsg response.write response.write 返回 response.end else hw_name=server.htmlencode(hw_name) hw_name=replace(hw_name, , ) hw_name=replace(hw_name,chr(13)&chr(10),) hw_content=server.htmlencode(hw_content) hw_content=replace(hw_content, , ) hw_content=replace(hw_content,chr(13)&chr(10),) hw_pic=server.htmlencode(hw_pic) sql=select * from hw where hw_id=&request(hw_id) rs.open sql,conn,3,3 rs(hw_name)=hw_name rs(hw_content)=hw_contentrs(hw_content2)=hw_content2 rs(hw_cash)=hw_cash rs(sort_id)=sort_id rs(company)=company rs(daili)=daili rs(pifa)=pifa rs(hw_sn)=hw_sn rs(chubsh)=chubsh rs(kaiben)=kaiben rs(yeshu)=yeshu rs(data)=data rs(isbn)=isbn rs(zhuang)=zhuang rs(hw_pic)=hw_picrs(Nsort_id)=Nsort_idrs(tuijian)=tuijian rs.update end if response.write 商品修改成功! response.write response.write 返回 rs.close else% %dim rs,sqldim content,selsort_id=request(sort_id)Nsort_id=request(Nsort_id) set rs=server.createobject(adodb.recordset) sql=
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年02月萊陽市事業(yè)單位工作人員(171人)筆試歷年典型考題(歷年真題考點)解題思路附帶答案詳解
- 2025年02月浙江省對外交流服務中心編外人員公開招聘2人筆試歷年典型考題(歷年真題考點)解題思路附帶答案詳解
- 課題開題報告:地方高等教育創(chuàng)新發(fā)展研究
- 課題開題報告:初中數(shù)學“綜合與實踐”領域教學實踐研究
- 錫企業(yè)ESG實踐與創(chuàng)新戰(zhàn)略研究報告
- 鈮礦企業(yè)數(shù)字化轉型與智慧升級戰(zhàn)略研究報告
- 減肥產(chǎn)品成分透明度提升行業(yè)跨境出海戰(zhàn)略研究報告
- 阻燃劑企業(yè)縣域市場拓展與下沉戰(zhàn)略研究報告
- 仿制藥生產(chǎn)線能效提升企業(yè)制定與實施新質生產(chǎn)力戰(zhàn)略研究報告
- 二零二五年度知識產(chǎn)權專利池構建與運營服務合同
- 中小河治理工程監(jiān)理規(guī)劃(城鄉(xiāng))
- 多發(fā)性硬化診斷與治療指南(2023版)解讀
- 2024新版(外研版三起joinin)三年級英語上冊單詞帶音標
- 工程質量控制流程圖
- 現(xiàn)代家政導論-課件 1.2.2認識現(xiàn)代家政的特點和功能
- 汽車保險與理賠課件 3.4認識新能源汽車車上人員責任保險
- 物業(yè)公司市場拓展全員營銷激勵方案
- 2024-2025學年小學美術一年級下冊(2024)嶺南版(2024)教學設計合集
- 2024-2025學年初中信息技術(信息科技)七年級下冊甘教版教學設計合集
- 2024年安徽省文化和旅游行業(yè)職業(yè)技能大賽(導游賽項)考試題庫(含答案)
- SOAP病例書寫規(guī)范
評論
0/150
提交評論