aspnet天天書屋畢業(yè)設計_第1頁
aspnet天天書屋畢業(yè)設計_第2頁
aspnet天天書屋畢業(yè)設計_第3頁
aspnet天天書屋畢業(yè)設計_第4頁
aspnet天天書屋畢業(yè)設計_第5頁
已閱讀5頁,還剩21頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、題目:題目: 天天書屋天天書屋 本人聲明 我聲明, 本論文(設計)工作是由本人在指導教師的指導下獨立完成 的, 在完成論文(設計)時所利用的一切資料均已在參考文獻中列出。 目錄目錄 【摘要摘要】.1 第一章第一章 引引 言言.2 1.1 本系統(tǒng)研究的意義.2 1.2 設計天天書屋的可行性.2 第二章第二章 系統(tǒng)分析系統(tǒng)分析.3 2.1 需求分析.3 2.2 數(shù)據流程分析.3 2.3 開發(fā)環(huán)境.4 第三章第三章 系統(tǒng)數(shù)據庫結構系統(tǒng)數(shù)據庫結構.4 3.1 數(shù)據庫分析設計.5 3.2 數(shù)據庫表結構.5 3.2.1 商 品 表 .5 3.2.2 商品類型別表.5 3.2.3 商品子類別表.5 3.2.

2、4 新聞公告表.6 3.2.5 用戶表 .6 3.2.6 訂單表 .6 第四章第四章 系統(tǒng)功能模塊系統(tǒng)功能模塊.7 4.1 系統(tǒng)各功能模塊劃分.7 4.2 系統(tǒng)功能結構圖 .7 第五章第五章 系統(tǒng)功能實現(xiàn)系統(tǒng)功能實現(xiàn).8 51 數(shù)據訪問層.9 52 前臺功能.10 5.2.1 登錄模塊.10 5.2.2 商品分類.12 5.2.3 充值系統(tǒng).12 5.2.4 購物車 .13 53 后臺管理.14 5.3.1 商品添加.14 .16 5.3.2 用戶管理.17 .18 5.3.3 公告管理.18 5.3.4 添加公告.19 5.3.4 添加訂單.20 第六章第六章 結論結論.22 第七章第七章

3、參考文獻參考文獻.22 第八章第八章 致謝致謝.22 1 【摘要】 首先,對于消費者來說: 第一,可以在家“逛商店” ,訂貨不受時間的限制; 第二,獲得較大量的商品信息,可以買到當?shù)貨]有的商品; 第三,網上支付較傳統(tǒng)拿現(xiàn)金支付更加安全,可避免現(xiàn)金丟失或遭到搶劫; 但要 保存好自己各種支付賬號和密碼,防止他人獲得; 第四,從訂貨、買貨到貨物上門無需親臨現(xiàn)場,既省時又省力; 第五,由于網上商品省去租店面、召雇員及儲存保管等一系列費用,總的來說其 價格較一般商場的同類商品更便宜。 其次,對于商家來說,由于網上銷售沒有庫存壓力、經營成本低、經營規(guī)模不受 場地限制等,在將來會有更多的企業(yè)選擇網上銷售,通

4、過互聯(lián)網對市場信息的及時反 饋適時調整經營戰(zhàn)略,以此提高企業(yè)的經濟效益和參與國際競爭的能力。 再次,對于整個市場經濟來說,這種新型的購物模式可在更大的范圍內、更廣的 層面上以更高的效率實現(xiàn)資源配置。 綜上可以看出,網上購物突破了傳統(tǒng)商務的障礙,無論對消費者、企業(yè)還是市場 都有著巨大的吸引力和影響力,在新經濟時期無疑是達到“多贏”效果的理想模式。 本購物網站實現(xiàn)了網上購物的基本功能。包括:新聞發(fā)布、商品搜索、商品瀏覽、 商品訂購等功能模塊。 系統(tǒng)使用 asp.net(c#語言)+sql server 2005 及其它輔助軟件 (photoshop,flash,dreamweaver)進行開發(fā)。

5、關鍵詞:asp.net c#語言 sql server 2005 2 第一章 引 言 1.1 本系統(tǒng)研究的意義 隨著市場經濟和計算機軟、硬件技術的迅速發(fā)展,網絡技術的推廣普及, internet 已成為人們生活、工作中不可或缺的一部分。網上購物也將成為市場主流, 本購物系統(tǒng)為廣大購物愛好者提供一個不用出門便可輕松購物的平臺,即省時又方便。 客戶可查看商城中的所有商品信息,可很好的進行價格對比,挑選合適自己的商 品,經網上訂購、付款便可購得各類物美價廉的商品。 網上購物平臺的誕生給人們帶來購物的便利,也給商家?guī)砹饲八从械男б妗?購物網站同時也為商家提高了知名度,達到推銷效果,也能把銷售區(qū)城擴

6、大,有一舉 多得的功效。 網絡銷售已成為了商家提高經濟效益的一種途徑。本系統(tǒng)即能為客戶提供便利也 能為商家提高效益,相信購物網站在商業(yè)界肯定占據重要地位。 1.2 設計天天書屋的可行性 網上購物已成為商業(yè)主流,購物系統(tǒng)給商家?guī)硇б娴耐瑫r也給客戶帶來便利。 本系統(tǒng)主要實現(xiàn)普遍的購物功能(商品展示、商品挑選、商品訂購等),系統(tǒng)頁面設計 充分地滿足使用者的需求,達到一般購物系統(tǒng)的水平。 3 第二章 系統(tǒng)分析 2.1 需求分析 天天書屋主要為愛書者提供一個方便購書的平臺,同時也能給出版社帶來經濟 效益。通過充分的調查研究,結合一般的購物系統(tǒng)功能,本系統(tǒng)的功能需求如下: 商品管理: 客戶可挑選網站內所

7、有商品并訂購,管理員對商品進行添加、維護; 管理員:管理員可以用戶的注冊信息進行修改,管理員有提升權限; 新聞管理: 新聞顯示,新聞發(fā)布,新聞維護; 數(shù)據處理需求:凡是與客戶交互的信息都要經過檢測分析,合法的數(shù)據才可存入數(shù) 據庫,不合法的數(shù)據拒絕操作。對重要數(shù)據可進行備份,防止重要數(shù)據丟失。 2.2 數(shù)據流程分析 天天天天書書屋屋 主要實現(xiàn)購物功能,本購物系統(tǒng) 包括 商品展示,商品分類, 商品檢索,商品購 買,結賬等功能。 本網站用簡潔明了的方式展示商品,有 銷售分類顯示、 性質 分類 顯示 功能 ,顧客 挑選商品放入購物車,登陸 后才 能進入 結賬 系統(tǒng) ,核對訂單填寫配送信息后便可完成購物

8、操作。 4 流程圖 打開網站 商品展示 選擇商品 放入購物車 結賬 繼續(xù)購物 發(fā)訂單 2.3 開發(fā)環(huán)境 計算機操作系統(tǒng):windows xp, 開發(fā)工具:microsoft visual studio 2005 開發(fā)語言:c#語言 數(shù)據庫管理系統(tǒng): sql server 2005 輔助軟件:flash、dreamweaver、photoshop 第三章 系統(tǒng)數(shù)據庫結構 5 3.1 數(shù)據庫分析設計 購物系統(tǒng)數(shù)據量龐大,數(shù)據處理復雜,數(shù)據表間要進行多個關聯(lián)。本購物系統(tǒng)共 設計 6 個數(shù)據表,表表間建立相應外鍵關系,以實現(xiàn)復雜的系統(tǒng)需求,完成商品羅列 顯示、商品訂購等功能。 3.2 數(shù)據庫表結構 為

9、了實現(xiàn)購物系統(tǒng)物應有的功能,結合本系統(tǒng)對有關數(shù)據的存儲的需要,現(xiàn)將 本系統(tǒng)數(shù)據庫設計成5 個數(shù)據庫表: (1) 商品表存儲商品信息以顯示給瀏覽者瀏覽 (2) 商品類型別表存儲商品類別信息 (3) 商品子類別表存儲商品子類別信息 (4) 新聞公告表存儲網站新聞信息 (5) 用戶表存儲網站會員用戶信息 (6) 訂單表存儲網站會員訂單信息 3.2.1 商品表 列名數(shù)據類型是否為空說明 goodsidintnot null 主鍵、自增變量 goodsnamevarchar(50)not null goodspricedecimal(18, 2)not null goodstotalintnot nul

10、l goodspicvarchar(50)not null goodsshowtextnot null goodstimedatetimenot null goodsclassintnot null goodssubclassintnot null 3.2.2 商品類型別表 列名數(shù)據類型是否為空說明 bookid intnot null 主鍵、自增變量 bookname intnull 3.2.3 商品子類別表 列名數(shù)據類型是否為空說明 6 classidintnot null 主鍵、自增變量 classnamevarchar(50)null classbookidintnull 3.2.4

11、新聞公告 表 列名數(shù)據類型是否為空說明 idintnot null 主鍵、自增變量 newsnamevarchar(50)null newstexttextnull newstimesmalldatetimenull 3.2.5 用戶表 列名數(shù)據類型是否為空說明 idintnot null 主鍵、自增變量 namevarchar(20)not null passwordvarchar(20)not null nicknamevarchar(20)not null sexchar(10)not null ageintnot null addressvarchar(50)null qqintnul

12、l emailvarchar(50)null myselftextnull moneydecimal(18, 2)null 3.2.6 訂單 表 列名數(shù)據類型是否為空說明 idintnot null 主鍵、自增變量 namevarchar(50)null 訂單人 goodsidintnull goodsnamevarchar(50)null goodspricedecimal(18, 2)null goodstotalintnull 7 第四章 系統(tǒng)功能模塊 4.1 系統(tǒng)各功能模塊劃分 天天書屋系統(tǒng)天天書屋系統(tǒng)屬綜合性系統(tǒng),數(shù)據量大,數(shù)據間的處理復雜。為了更好的 實現(xiàn)購物系統(tǒng)所需的功能,將本系

13、統(tǒng)劃分為 4 個系統(tǒng)模塊: 商品管理系統(tǒng): 客戶可挑選網站內所有商品并訂購, 管理員對商品進行添加、維護; 用戶管理系統(tǒng): 管理員可對普通用戶的賬戶信息進行修改, 新聞管理系統(tǒng): 新聞顯示,新聞發(fā)布,新聞維護; 訂單管理系統(tǒng): 生成訂單顯示,訂單發(fā)送,訂單維護; 4.2 系統(tǒng)功能結構圖 8 首頁 商品分類 新書展示 公告 新書動態(tài) 詳細公告 新書 新書分類 新書展示 新書詳情 購物車 商品選購 結賬付款 登陸系統(tǒng) 賬號登陸 注冊賬號 注冊系統(tǒng) 后臺管理 用 戶 管 理 商 品 管 理 公 告 管 理 退 出 商 品 管 理 商 品 添 加 添 加 公 告 公 告 管 理 用 戶 管 理 前臺功

14、能 充值系統(tǒng) 注冊賬號 登錄賬號 返 回 主 頁 新書詳情 賬號充值 生成訂單 訂 單 管 理 添 加 訂 單 訂 單 管 理 第五章 系統(tǒng)功能實現(xiàn) 根據軟件開發(fā)的基本流程,在完成了系統(tǒng)需求、系統(tǒng)分析、系統(tǒng)設計后,就進入系 統(tǒng)實現(xiàn)階段了,本系統(tǒng)使用三層架構進行開發(fā),以下是整個系統(tǒng)的功能實現(xiàn),包括前 臺的頁面展示和后臺的代碼剖析。 9 51 數(shù)據訪問層 public class db private sqlconnection con; public db() con = new sqlconnection(); con.connectionstring = configurationmanag

15、er.appsettingsconstr.tostring(); public void open() if (con.state = connectionstate.closed) con.open(); public void close() if (con.state = connectionstate.open) con.close(); public datatable dt(string sqlstr) sqldataadapter sda = new sqldataadapter(sqlstr, con); dataset ds = new dataset(); sda.fill

16、(ds); return ds.tables0; public dataset ds(string sqlstr) sqldataadapter sda = new sqldataadapter(sqlstr, con); dataset ds = new dataset(); sda.fill(ds); return ds; public bool exesql(string sqlstr) open(); 10 sqlcommand cmd = new sqlcommand(sqlstr, con); int i = cmd.executenonquery(); close(); if (

17、i 0) return true; return false; public bool execount(string sqlstr) open(); sqlcommand cmd = new sqlcommand(sqlstr, con); int i = convert.toint32(cmd.executescalar(); close(); if (i 0) return true; return false; public string firststr(string sqlstr) open(); sqlcommand cmd = new sqlcommand(sqlstr, co

18、n); string str = convert.tostring(cmd.executescalar(); close(); return str; public datatable dt(string sqlstr, sqlparameter prm, commandtype type) sqlcommand cmd = new sqlcommand(sqlstr, con); cmd.commandtype = type; cmd.parameters.addrange(prm); sqldataadapter sda = new sqldataadapter(cmd); dataset

19、 ds = new dataset(); sda.fill(ds); return ds.tables0; 52 前臺功能 5.2.1 登錄模塊 系統(tǒng)會根據不同的用戶登錄進行不同的操作; 11 string code = textbox1.text; if (tbuser.text.length != 0) if (tbpwd.text.length != 0) if (request.cookiescheckcode.value = code) string sqlstr = select count(*) from 用戶表 where name=username and password=

20、password ; sqlparameter prm = new sqlparameter(username, sqldbtype.varchar), new sqlparameter(password, sqldbtype.varchar) ; prm0.sqlvalue = tbuser.text.trim(); prm1.sqlvalue = tbpwd.text.trim(); if (n.execount(sqlstr, prm) string str = select nickname from 用戶表 where name= + tbuser.text.trim() + ; s

21、essionusername = n.dt(str).rows00.tostring(); response.redirect(login.aspx); 用戶登陸進入頁面:用戶登陸后就可以查看、購買 12 5.2.2 商品分類 5.2.3 充值系統(tǒng) 13 if (textbox1.text.length != 0) if (textbox2.text.length != 0) if (textbox3.text.length != 0) string sql = update 用戶表 set money=money+ + textbox3.text.trim() + where nicknam

22、e= + sessionnickname.tostring() + ; if (n.exesql(sql) = true) label2.text = 充值成功!你充值的金額為 + textbox3.text.trim(); 5.2.4 購物車 14 private void bindshoppingcart() if (sessioncart != null) cart = (datatable)sessioncart; gridview1.datasource = cart; gridview1.databind(); decimal sum = 0; for (int i = 0; i

23、cart.rows.count; i+) sum += convert.todecimal(cart.rowsi4); (textbox)gridview1.rowsi.findcontrol(pronum).attributesonkeyup = value=value.replace(/ d/g,); label1 . text = sum.tostring(); protected void gridview1_rowdatabound(object sender, gridviewroweventargs e) protected void gridview1_rowdeleting(

24、object sender, gridviewdeleteeventargs e) cart = (datatable)sessioncart; cart.rows .removeat (e.rowindex); sessioncart = cart; bindshoppingcart(); 53 后臺管理 5.3.1 商品添加 15 實現(xiàn)代碼: db db = new db(); protected void page_load(object sender, eventargs e) if (!page.ispostback) db.dlbind(dropdownlist1, booknam

25、e, bookid, 商品類型); init(); public void init() string sqlstr = select * from 商品子類 where classbookid= + dropdownlist1.selectedvalue.tostring() + ; dropdownlist2.datatextfield = classname; dropdownlist2.datavaluefield = classbookid; dropdownlist2.datasource = db.dt(sqlstr); dropdownlist2.databind(); pro

26、tected void button1_click(object sender, eventargs e) string goodsname = goodsnamebox.text.trim(); string goodsprice = goodspricebox.text.trim(); string goodstotal = goodstotalbox.text.trim(); string goodsshow = goodsshowbox.text.trim(); string goodstime = datetime.now.tostring(); string goodsclass

27、= dropdownlist1.text.trim(); string goodssubclass = dropdownlist2.text.trim(); 16 string filename = goodspic.postedfile.filename;/上傳文件路徑 string subfilename = filename.substring(filename.lastindexof(.) + 1);/后綴名 string path = server.mappath(img); string imgname = datetime.now.tostring(yyyymmddhhmmssf

28、fff) + . + subfilename; string filepath = path + + imgname; if (goodspic.hasfile) if (subfilename.toupper() = jpg | subfilename.toupper() = bmp | subfilename.toupper() = gif) goodspic.postedfile.saveas(filepath); else page.clientscript.registerstartupscript(page.gettype(), , alert(只能上傳 格式為(jpg,bmp,g

29、if)的圖片!);); return; else page.clientscript.registerstartupscript(page.gettype(), , alert(請選擇圖片!); ); return; string sqlstr = insert into 商品表 (goodsname,goodsprice,goodstotal,goodspic,goodsshow,goodstime,goodsclass,goodssubclass) values( + goodsname + , + goodsprice + , + goodstotal + , + img/ + imgn

30、ame + , + goodsshow + , + goodstime + , + dropdownlist1.selectedvalue.tostring() + , + dropdownlist2.selectedvalue.tostring() + ); if (db.exesql(sqlstr) page.clientscript.registerstartupscript(page.gettype(), , alert(添加成功!); ); /clear(); else page.clientscript.registerstartupscript(page.gettype(), ,

31、 alert(添加失??!); ); 17 5.3.2 用戶管理 實現(xiàn)代碼: private void datatogridview() string sql = select * from 用戶表; gridview1.datasource = n.dt(sql); gridview1.databind(); protected void gridview1_rowdeleting(object sender, gridviewdeleteeventargs e) string strsql = delete from 用戶表 where id = + gridview1.datakeyse.

32、rowindex. value.tostring() + ; if (n.exesql(strsql) = true) datatogridview(); protected void gridview1_rowupdating(object sender, gridviewupdateeventargs e) /更新 string id = this.gridview1.datakeyse.rowindex.value.tostring(); string name = (textbox)(this.gridview1.rowse.rowindex.cells1.controls0).tex

33、t; string password = (textbox)(this.gridview1.rowse.rowindex.cells2.controls0).text; string nickname = (textbox)(this.gridview1.rowse.rowindex.cells3.controls0).text; string sex = (textbox)(this.gridview1.rowse.rowindex.cells4.controls0).text; string age = (textbox)(this.gridview1.rowse.rowindex.cel

34、ls5.controls0).text; string address = (textbox)(this.gridview1.rowse.rowindex.cells6.controls0).text; string qq = (textbox)(this.gridview1.rowse.rowindex.cells7.controls0).text; string email = (textbox)(this.gridview1.rowse.rowindex.cells8.controls0).text; string myself = (textbox)(this.gridview1.ro

35、wse.rowindex.cells9.controls0).text; string money = (textbox)(this.gridview1.rowse.rowindex.cells10.controls0).text; string sql = update 用戶表 set name= + name + , password= + password + , nickname= + nickname + ,sex= + sex + ,age= + age + ,address= + address + , qq= + qq + 18 , email= + email + , mys

36、elf= + myself + ,money= + money + where id = + id + ; if (n.exesql(sql) = true) this.gridview1.editindex = -1; datatogridview(); 5.3.3 公告管理 實現(xiàn)代碼: private void datatogridview() string sql = select * from 新聞公告; gridview1.datasource = n.dt(sql); gridview1.databind(); protected void gridview1_rowdeletin

37、g(object sender, gridviewdeleteeventargs e) string strsql = delete from 新聞公告 where id = + gridview1.datakeyse.rowindex. value.tostring() + ; if (n.exesql(strsql) = true) datatogridview(); protected void gridview1_rowupdating(object sender, gridviewupdateeventargs e) string id = this.gridview1.datake

38、yse.rowindex.value.tostring(); string newsname = (textbox)(this.gridview1.rowse.rowindex.cells1.controls0).text; string newstext = (textbox)(this.gridview1.rowse.rowindex.findcontrol(txttext).text ; string newstime = (textbox)(this.gridview1.rowse.rowindex.cells3.controls0).text; 19 string sql = upd

39、ate 新聞公告 set newsname= + newsname + , newstext= + newstext + , newstime= + newstime + where id = + id + ; if (n.exesql(sql) = true) this.gridview1.editindex = -1; datatogridview(); 5.3.4 添加公告 實現(xiàn)代碼: public bool add() string newsname = textbox1.text; string newstext = textbox2.text; string newstime =

40、datetime.now.tostring(); string sql = insert into 新聞公告(newsname,newstext,newstime)values( + newsname + , + newstext + , + newstime + ); return new db().exesql(sql); protected void button1_click(object sender, eventargs e) if (check() = true) add(); label4.text = 添加成功!; 20 5.3.4 添加訂單 實現(xiàn)代碼 db n = new

41、db(); protected void page_load(object sender, eventargs e) if (!page.ispostback) n.dlbind(dropdownlist1, bookname, bookid, 商品類型); init(); init1(); init2(); public void init() string sqlstr = select * from 商品子類 where classbookid= + dropdownlist1.selectedvalue.tostring() + ; dropdownlist2.datatextfield = classname; dropdownlist2.datavaluefield = classid; dropdownlist2.datasource = n.dt(sqlstr); dropdownlist2.databind(); public void init1() dropdownlist3.datasource = null; stri

溫馨提示

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

評論

0/150

提交評論