asp二手交易網(wǎng)課程設(shè)計報告_第1頁
asp二手交易網(wǎng)課程設(shè)計報告_第2頁
asp二手交易網(wǎng)課程設(shè)計報告_第3頁
asp二手交易網(wǎng)課程設(shè)計報告_第4頁
asp二手交易網(wǎng)課程設(shè)計報告_第5頁
已閱讀5頁,還剩16頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、. . . . A 3.5(C#)實踐教程課程設(shè)計報告題目:二手交易網(wǎng) 院 系:專 業(yè):班 級:學(xué) 號:姓 名:指導(dǎo)老師: 2013年6月28日目錄一、系統(tǒng)設(shè)計要求····································&#

2、183;3二、設(shè)計思路·········································3三、需求分析······

3、···································3四、功能模塊··············

4、;···························3五、用例圖······················

5、;·····················4六、系統(tǒng)流程圖···························

6、83;···········5七、E-R圖·····································&#

7、183;·····5八、數(shù)據(jù)庫和表設(shè)計···································7九、調(diào)試程序······

8、83;··································8十、關(guān)鍵程序代碼··············

9、·······················12十二、參考書目·························

10、83;·············20十一、總結(jié)···································&#

11、183;·······20一 系統(tǒng)設(shè)計要求(1)應(yīng)用Visual Studio 設(shè)計、開發(fā)和發(fā)布; (2)應(yīng)用HTML相關(guān)知識制作頁面;(3)應(yīng)用Table或者CSS對網(wǎng)頁進(jìn)行合理布局;(4)應(yīng)用ASP.NET置對象完成相關(guān)邏輯處理;(5)應(yīng)用ASP.NET各種控件完成相關(guān)模塊的重用;(6)應(yīng)用ADO.NET相關(guān)知識完成數(shù)據(jù)庫的連接與處理二、設(shè)計思路本為用戶提供一個二手商品交易的網(wǎng)絡(luò)平臺,為學(xué)生處理個人物品提供一個快捷的途徑,操作簡單。本組設(shè)計具有以下特點:簡單性:設(shè)計操作簡單易懂,用戶操作易上手,方便同學(xué)處理閑置物品。實用

12、性:系統(tǒng)能完成商品展示管理等功能和管理員對信息的處理,有很好的實用性。三、需求分析非注冊用戶,瀏覽商品、注冊會員用戶注冊,商品瀏覽、添加商品、添加購物車、用戶結(jié)賬、發(fā)布留言、修改商品、刪除商品等。管理員添加商品、刪除商品、修改商品、留言管理、用戶管理、網(wǎng)址更新維護等。四、功能模塊功能模塊主頁建立主頁面用戶注冊、登錄模塊用戶注冊登錄用戶注冊用戶管理模塊查看修改用戶信息找回密碼商品管理模塊增加商品修改商品信息商品瀏覽和購物車模塊查看商品信息信息添加物品到購物車清空購物車刪除購物車商品搜索和在線幫助模塊物品的模糊查找在線服務(wù)幫助訂單管理模塊添加訂單處理訂單查看訂單用戶結(jié)賬留言管理模塊留言、查看留言、

13、回復(fù)留言、查看回復(fù)信息五、用例圖六、系統(tǒng)流程圖七、E-R圖真實XX用戶密碼性別用戶郵箱 號碼注冊時間用戶 登錄名用戶地址用戶編號年齡真實XX管理員密碼管理員登錄名注冊時間郵箱管理員編號管理員商品訂單明細(xì)訂單詳細(xì)表號商品數(shù)量商品代號商品對應(yīng)訂單號備注商品總金額商品商品ID商品種類種類編碼名稱商品原價銷售價格詳細(xì)描述商品圖片用戶登錄留言留言編號留言內(nèi)容留言日期用戶id八、數(shù)據(jù)庫和表設(shè)計管理員表商品表購物車用戶表九、調(diào)試程序注冊登錄上傳頭像修改密碼添加商品主頁留言后臺管理找回密碼十、關(guān)鍵程序代碼登陸后臺代碼using System;using System.Collections.Generic;u

14、sing System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;publicpartialclassAdmin_images_login : System.Web.UI.Pageprotectedvoid Page_Load(object sender, EventArgs e) if (Session"UserLoginName" = null) else /string U

15、serLoginName = Session"UserLoginName".ToString(); Response.Redirect("index.aspx?UserLoginName=" + Session"UserLoginName".ToString(); protectedvoid Button1_Click(object sender, EventArgs e) if (TextBox1.Text = "") Response.Write("<script language='j

16、avascript'>alert('用戶名不能為空!');localtion='login.aspx'</script>");return; else if (TextBox2.Text = "") Response.Write("<script language='javascript'>alert('密碼不能為空!');localtion='login.aspx'</script>");return; else

17、string name = TextBox1.Text;string password = TextBox2.Text;string constr = "server=.;database=shopdb;trusted_connection=true"SqlConnection conn = newSqlConnection(constr); conn.Open();SqlCommand cmd = newSqlCommand(); cmd mandText = "select count(*) from users where UserName='&qu

18、ot; + name + "'and Password='" + TextBox2.Text + "'" cmd.Connection = conn;/int count = (int)cmd.ExecuteScalar();if (Convert.ToInt32(cmd.ExecuteScalar() > 0) Session"UserLoginName" = TextBox1.Text; Response.Write("<script>alert('登錄成功')&

19、lt;/script>"); Response.Redirect("usersnews.aspx?UserLoginName=" + TextBox1.Text); else Response.Write("<script>alert('用戶名或密碼錯誤!')</script>");return; conn.Close(); 注冊后臺代碼using System;using System.Collections.Generic;using System.Linq;using System.Web;u

20、sing System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;publicpartialclassAdmin_images_addusers : System.Web.UI.Pageprotectedvoid Page_Load(object sender, EventArgs e) if (Session"UserLoginName " = null) else string name = Session"UserLoginName

21、 ".ToString(); Response.Redirect("index.aspx?sname=" + Session"UserLoginName ".ToString(); protectedvoid Button1_Click(object sender, EventArgs e) string constr = "server=.;database=shopdb;trusted_connection=true"SqlConnection con = newSqlConnection(constr);SqlComm

22、and cmd = newSqlCommand("praddusers", con); cmd.Connection = con; cmd mandText = "praddusers" cmd mandType = CommandType.StoredProcedure;SqlParameter sp1 = newSqlParameter("username", SqlDbType.VarChar, 20); sp1.ParameterName = "username" sp1.Value = TextBox1.

23、Text; cmd.Parameters.Add(sp1);SqlParameter sp2 = newSqlParameter("password", SqlDbType.VarChar, 20); sp2.ParameterName = "password" sp2.Value = TextBox3.Text; cmd.Parameters.Add(sp2);SqlParameter sp3 = newSqlParameter("realname", SqlDbType.VarChar, 20); sp3.ParameterNam

24、e = "realname" sp3.Value = TextBox4.Text; cmd.Parameters.Add(sp3);SqlParameter sp4 = newSqlParameter("sex", SqlDbType.Bit); sp4.ParameterName = "sex" sp4.Value =(RadioButtonList1.SelectedItem.ToString()="男"?1:0); cmd.Parameters.Add(sp4);SqlParameter sp5 = newS

25、qlParameter("age", SqlDbType.Int); sp5.ParameterName = "age" sp5.Value = TextBox5.Text; cmd.Parameters.Add(sp5);SqlParameter sp6 = newSqlParameter("phonecode ", SqlDbType.VarChar, 20); sp6.ParameterName = "phonecode " sp6.Value = TextBox6.Text; cmd.Parameters.

26、Add(sp6);SqlParameter sp7 = newSqlParameter("Address", SqlDbType.VarChar, 50); sp7.ParameterName = "Address" sp7.Value = TextBox7.Text; cmd.Parameters.Add(sp7);SqlParameter sp8 = newSqlParameter("Postcode", SqlDbType.Char, 20); sp8.ParameterName = "Postcode" s

27、p8.Value = TextBox8.Text; cmd.Parameters.Add(sp8);SqlParameter sp9 = newSqlParameter("Email", SqlDbType.Char, 20); sp9.ParameterName = "Email" sp9.Value = TextBox9.Text; cmd.Parameters.Add(sp9);SqlParameter sp11 = newSqlParameter("UserQue", SqlDbType.VarChar, 50); sp11.

28、ParameterName = "UserQue" sp11.Value = TextBox10.Text; cmd.Parameters.Add(sp11);SqlParameter sp12 = newSqlParameter("UserAns", SqlDbType.VarChar, 50); sp12.ParameterName = "UserAns" sp12.Value = TextBox11.Text; cmd.Parameters.Add(sp12);SqlParameter sp10 = newSqlParamete

29、r(" userid", 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("<script>alert('注

30、冊成功')</script>"); Session"UserLoginName" = TextBox1.Text; Response.Redirect("SuccReg.aspx"); else Response.Write("<script>alert('注冊失敗!')</script>"); protectedvoid btnTest_Click(object sender, EventArgs e) if (TextBox1.Text = "&quo

31、t;) Response.Write("<script language='javascript'>alert('會員登錄名不能為空!');localtion='addusers.aspx'</script>"); else string constr = "server=.;database=shopdb;trusted_connection=true"SqlConnection sqlconn = newSqlConnection(constr); sqlconn.Open();

32、string sqlstr = "select * from Users where UserName='" + this.TextBox1.Text + "'"SqlCommand sqlcom = newSqlCommand(sqlstr, sqlconn);SqlDataReader read = sqlcom.ExecuteReader(); read.Read();if (read.HasRows) if (this.TextBox1.Text.Trim() = read"UserName".ToString

33、().Trim() Response.Write("<script language='javascript'>alert('該會員已經(jīng)注冊過');localtion='adduser.aspx'</script>");return; else Response.Write("<script language='javascript'>alert('您可以進(jìn)行正常注冊');localtion='adduser.aspx'</sc

34、ript>"); read.Close(); sqlconn.Close(); protectedvoid Button2_Click(object sender, EventArgs e) 添加商品后臺代碼using System;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web

35、.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.IO;publicpartialclassEditGoods : System.Web.UI.PageSqlOperate sqloperate = newSqlOperate();SqlConnection sqlconn = newSqlConnection(ConfigurationManager.AppSettings"Connection

36、String");protectedvoid Page_Load(object sender, EventArgs e) if (Session"UserLoginName" = null) Response.Redirect("login.aspx"); else protectedvoid Button1_Click(object sender, EventArgs e) string name = TextBox1.Text;string startprice = TextBox2.Text;string saletprice = Tex

37、tBox3.Text;string typeid = TextBox4.Text;string wareshow = TextBox5.Text;string pictureName = fupPicturePath.FileName; /獲取文件名string lastName = pictureName.Substring(pictureName.LastIndexOf(".") + 1); /獲取文件后綴名string constr = "server=.;database=shopdb;trusted_connection=true"SqlConnection conn = newSqlConnection(constr); conn.Open();/判斷上傳文件的格式if (lastName.ToLower() = "bmp" | lastName.ToLower() = "jpg" | lastName.ToLower() = "gif") int len = fupPicturePath.PostedFile.Con

溫馨提示

  • 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論