asp二手交易網(wǎng)課程設(shè)計報告

上傳人:仙*** 文檔編號:27708862 上傳時間:2021-08-19 格式:DOC 頁數(shù):21 大小:1.29MB
收藏 版權(quán)申訴 舉報 下載
asp二手交易網(wǎng)課程設(shè)計報告_第1頁
第1頁 / 共21頁
asp二手交易網(wǎng)課程設(shè)計報告_第2頁
第2頁 / 共21頁
asp二手交易網(wǎng)課程設(shè)計報告_第3頁
第3頁 / 共21頁

下載文檔到電腦,查找使用更方便

15 積分

下載資源

還剩頁未讀,繼續(xù)閱讀

資源描述:

《asp二手交易網(wǎng)課程設(shè)計報告》由會員分享,可在線閱讀,更多相關(guān)《asp二手交易網(wǎng)課程設(shè)計報告(21頁珍藏版)》請在裝配圖網(wǎng)上搜索。

1、A 3.5(C#)實(shí)踐教程課程設(shè)計報告題目: 二手交易網(wǎng) 院 系: 專 業(yè): 班 級: 學(xué) 號: 姓 名: 指導(dǎo)老師: 2013年6月28日目錄一、系統(tǒng)設(shè)計要求3二、設(shè)計思路3三、需求分析3四、功能模塊3五、用例圖4六、系統(tǒng)流程圖5七、E-R圖5八、數(shù)據(jù)庫和表設(shè)計7九、調(diào)試程序8十、關(guān)鍵程序代碼12十二、參考書目20十一、總結(jié)20一 系統(tǒng)設(shè)計要求(1)應(yīng)用Visual Studio 設(shè)計、開發(fā)和發(fā)布網(wǎng)站; (2)應(yīng)用HTML相關(guān)知識制作網(wǎng)站頁面;(3)應(yīng)用Table或者CSS對網(wǎng)頁進(jìn)行合理布局;(4)應(yīng)用ASP.NET內(nèi)置對象完成相關(guān)邏輯處理;(5)應(yīng)用ASP.NET各種控件完成相關(guān)模塊的重用

2、;(6)應(yīng)用ADO.NET相關(guān)知識完成數(shù)據(jù)庫的連接與處理二、設(shè)計思路本網(wǎng)站為用戶提供一個二手商品交易的網(wǎng)絡(luò)平臺,為學(xué)生處理個人物品提供一個快捷的途徑,操作簡單。本組設(shè)計網(wǎng)站具有以下特點(diǎn):簡單性:網(wǎng)站設(shè)計操作簡單易懂,用戶操作易上手,方便同學(xué)處理閑置物品。實(shí)用性:系統(tǒng)能完成商品展示管理等功能和管理員對信息的處理,有很好的實(shí)用性。三、需求分析非注冊用戶,瀏覽商品、注冊會員用戶注冊,商品瀏覽、添加商品、添加購物車、用戶結(jié)賬、發(fā)布留言、修改商品、刪除商品等。管理員添加商品、刪除商品、修改商品、留言管理、用戶管理、網(wǎng)址更新維護(hù)等。四、功能模塊功能模塊主頁建立主頁面用戶注冊、登錄模塊用戶注冊登錄用戶注冊用

3、戶管理模塊查看修改用戶信息找回密碼商品管理模塊增加商品修改商品信息商品瀏覽和購物車模塊查看商品信息信息添加物品到購物車清空購物車刪除購物車商品搜索和在線幫助模塊物品的模糊查找在線服務(wù)幫助訂單管理模塊添加訂單處理訂單查看訂單用戶結(jié)賬留言管理模塊留言、查看留言、回復(fù)留言、查看回復(fù)信息五、用例圖六、系統(tǒng)流程圖七、E-R圖真實(shí)姓名用戶密碼性別用戶郵箱電話號碼注冊時間用戶郵編登錄名用戶地址用戶編號年齡真實(shí)姓名管理員密碼管理員登錄名注冊時間郵箱管理員編號管理員商品訂單明細(xì)訂單詳細(xì)表號商品數(shù)量商品代號商品對應(yīng)訂單號備注商品總金額商品商品ID商品種類種類編碼名稱商品原價銷售價格詳細(xì)描述商品圖片用戶登錄留言留言

4、編號留言內(nèi)容留言日期用戶id八、數(shù)據(jù)庫和表設(shè)計管理員表商品表購物車用戶表九、調(diào)試程序注冊登錄上傳頭像修改密碼添加商品主頁留言后臺管理找回密碼十、關(guān)鍵程序代碼登陸后臺代碼using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;public partial class Admin_images_log

5、in : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (SessionUserLoginName = null) else /string UserLoginName = SessionUserLoginName.ToString(); Response.Redirect(index.aspx?UserLoginName= + SessionUserLoginName.ToString(); protected void Button1_Click(object sender, Event

6、Args e) if (TextBox1.Text = ) Response.Write(alert(用戶名不能為空!);localtion=login.aspx); return; else if (TextBox2.Text = ) Response.Write(alert(密碼不能為空!);localtion=login.aspx); return; else string name = TextBox1.Text; string password = TextBox2.Text; string constr = server=.;database=shopdb;trusted_conn

7、ection=true; SqlConnection conn = new SqlConnection(constr); conn.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = select count(*) from users where UserName= + name + and Password= + TextBox2.Text + ; cmd.Connection = conn; /int count = (int)cmd.ExecuteScalar(); if (Convert.ToInt32(cmd.E

8、xecuteScalar() 0) SessionUserLoginName = TextBox1.Text; Response.Write(alert(登錄成功); Response.Redirect(usersnews.aspx?UserLoginName= + TextBox1.Text); else Response.Write(alert(用戶名或密碼錯誤!); return; conn.Close(); 注冊后臺代碼using System;using System.Collections.Generic;using System.Linq;using System.Web;usi

9、ng System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;public partial class Admin_images_addusers : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (SessionUserLoginName = null) else string name = SessionUserLoginName .ToString(); Re

10、sponse.Redirect(index.aspx?sname= + SessionUserLoginName .ToString(); protected void Button1_Click(object sender, EventArgs e) string constr = server=.;database=shopdb;trusted_connection=true; SqlConnection con = new SqlConnection(constr); SqlCommand cmd = new SqlCommand(praddusers, con); cmd.Connec

11、tion = con; cmd.CommandText = praddusers; cmd.CommandType = CommandType.StoredProcedure; SqlParameter sp1 = new SqlParameter(username, SqlDbType.VarChar, 20); sp1.ParameterName = username; sp1.Value = TextBox1.Text; cmd.Parameters.Add(sp1); SqlParameter sp2 = new SqlParameter(password, SqlDbType.Var

12、Char, 20); sp2.ParameterName = password; sp2.Value = TextBox3.Text; cmd.Parameters.Add(sp2); SqlParameter sp3 = new SqlParameter(realname, SqlDbType.VarChar, 20); sp3.ParameterName = realname; sp3.Value = TextBox4.Text; cmd.Parameters.Add(sp3); SqlParameter sp4 = new SqlParameter(sex, SqlDbType.Bit)

13、; sp4.ParameterName = sex; sp4.Value =(RadioButtonList1.SelectedItem.ToString()=男?1:0); cmd.Parameters.Add(sp4); SqlParameter sp5 = new SqlParameter(age, SqlDbType.Int); sp5.ParameterName = age; sp5.Value = TextBox5.Text; cmd.Parameters.Add(sp5); SqlParameter sp6 = new SqlParameter(phonecode , SqlDb

14、Type.VarChar, 20); sp6.ParameterName = phonecode ; sp6.Value = TextBox6.Text; cmd.Parameters.Add(sp6); SqlParameter sp7 = new SqlParameter(Address, SqlDbType.VarChar, 50); sp7.ParameterName = Address; sp7.Value = TextBox7.Text; cmd.Parameters.Add(sp7); SqlParameter sp8 = new SqlParameter(Postcode, S

15、qlDbType.Char, 20); sp8.ParameterName = Postcode; sp8.Value = TextBox8.Text; cmd.Parameters.Add(sp8); SqlParameter sp9 = new SqlParameter(Email, SqlDbType.Char, 20); sp9.ParameterName = Email; sp9.Value = TextBox9.Text; cmd.Parameters.Add(sp9); SqlParameter sp11 = new SqlParameter(UserQue, SqlDbType

16、.VarChar, 50); sp11.ParameterName = UserQue; sp11.Value = TextBox10.Text; cmd.Parameters.Add(sp11); SqlParameter sp12 = new SqlParameter(UserAns, SqlDbType.VarChar, 50); sp12.ParameterName = UserAns; sp12.Value = TextBox11.Text; cmd.Parameters.Add(sp12); SqlParameter sp10 = new SqlParameter( userid,

17、 SqlDbType.Int); sp10.ParameterName = userid; sp10.Direction = ParameterDirection.Output; cmd.Parameters.Add(sp10); con.Open(); cmd.ExecuteNonQuery(); con.Close(); int id = int.Parse(sp10.Value.ToString(); if (id 0) Response.Write(alert(注冊成功); SessionUserLoginName = TextBox1.Text; Response.Redirect(

18、SuccReg.aspx); else Response.Write(alert(注冊失敗!); protected void btnTest_Click(object sender, EventArgs e) if (TextBox1.Text = ) Response.Write(alert(會員登錄名不能為空!);localtion=addusers.aspx); else string constr = server=.;database=shopdb;trusted_connection=true; SqlConnection sqlconn = new SqlConnection(

19、constr); sqlconn.Open(); string sqlstr = select * from Users where UserName= + this.TextBox1.Text + ; SqlCommand sqlcom = new SqlCommand(sqlstr, sqlconn); SqlDataReader read = sqlcom.ExecuteReader(); read.Read(); if (read.HasRows) if (this.TextBox1.Text.Trim() = readUserName.ToString().Trim() Respon

20、se.Write(alert(該會員已經(jīng)注冊過);localtion=adduser.aspx); return; else Response.Write(alert(您可以進(jìn)行正常注冊);localtion=adduser.aspx); read.Close(); sqlconn.Close(); protected void Button2_Click(object sender, EventArgs e) 添加商品后臺代碼using System;using System.Configuration;using System.Data;using System.Linq;using Sy

21、stem.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.IO;public partial class EditGoods : System.Web.UI.Page SqlOperate sqloperate

22、 = new SqlOperate(); SqlConnection sqlconn = new SqlConnection(ConfigurationManager.AppSettingsConnectionString); protected void Page_Load(object sender, EventArgs e) if (SessionUserLoginName = null) Response.Redirect(login.aspx); else protected void Button1_Click(object sender, EventArgs e) string

23、name = TextBox1.Text; string startprice = TextBox2.Text; string saletprice = TextBox3.Text; string typeid = TextBox4.Text; string wareshow = TextBox5.Text; string pictureName = fupPicturePath.FileName; /獲取文件名 string lastName = pictureName.Substring(pictureName.LastIndexOf(.) + 1); /獲取文件后綴名 string co

24、nstr = server=.;database=shopdb;trusted_connection=true; SqlConnection conn = new SqlConnection(constr); conn.Open(); /判斷上傳文件的格式 if (lastName.ToLower() = bmp | lastName.ToLower() = jpg | lastName.ToLower() = gif) int len = fupPicturePath.PostedFile.ContentLength; /獲取文件的大小 Byte pictureData = new Byte

25、len; HttpPostedFile htp = fupPicturePath.PostedFile; Stream srm = htp.InputStream; srm.Read(pictureData, 0, len); /讀取到pictureData中 SqlCommand com = new SqlCommand(insert into goods (modelname,startprice,saleprice,typeid,wareshow,picture) values( + name + , + startprice + , + saletprice + , + typeid

26、+ , + wareshow + ,pictureData), conn); com.Parameters.Add(pictureData, SqlDbType.Image); /指定類型 com.ParameterspictureData.Value = pictureData; /設(shè)置參數(shù)值 com.ExecuteNonQuery(); conn.Close(); Response.Write(alert(上傳成功!);localtion=index.aspx); else /RegisterStartupScript(false, alert(圖片格式不正確!); Response.Write(alert(圖片格式不正確!); 十一、總結(jié)通過這次課程設(shè)計的鍛煉,本組成員受益很大,我們對有了更深層次的了解,更加熟悉和掌握C#語言,解決問題的能力得到了進(jìn)一步提升,團(tuán)隊合作意識更加強(qiáng)烈。有了老師和同學(xué)的幫助,我們又學(xué)到了很多以前未接觸到的知識與技巧,總之,此次實(shí)訓(xùn)讓我們受益匪淺。十二、參考書目ASP.NET開發(fā)實(shí)戰(zhàn)1200例(第卷)清華大學(xué)出版社ASP.NET開發(fā)實(shí)戰(zhàn)寶典,張躍廷 主編,清華大學(xué)出版社,2010;ASP.NET 3.5(C#)實(shí)踐教程,邵良衫主編,清華大學(xué)出版社,2009

展開閱讀全文
溫馨提示:
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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

相關(guān)資源

更多
正為您匹配相似的精品文檔
關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!