《2022年asp二手交易网课程方案设计书.docx》由会员分享,可在线阅读,更多相关《2022年asp二手交易网课程方案设计书.docx(17页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精品学习资源封面欢迎下载精品学习资源作者: PanHongliang仅供个人学习A 3.5C#实践教程课程设计报告题目:二手交易网欢迎下载精品学习资源院系:专业:班级:学号:姓名: 指导老师:2021年 6 月 28 日目录一、系统设计要求3二、设计思路3三、需求分析3四、功能模块3五、用例图4六、系统流程图5七、E-R 图5八、数据库和表设计7九、调试程序8十、关键程序代码12十二、参考书目20十一、总结20一系统设计要求( 1)应用 Visual Studio设计、开发和发布网站;( 2)应用 HTML相关学问制作网站页面;欢迎下载精品学习资源( 3)应用 Table 或者 CSS对网页进
2、行合理布局;( 4)应用 ASP.NET内置对象完成相关规律处理;( 5)应用 ASP.NET各种控件完成相关模块的重用;( 6)应用 ADO.NET相关学问完成数据库的连接与处理二、设计思路本网站为用户供应一个二手商品交易的网络平台,为同学处理个人物品供应一个快捷的途径,操作简洁;本组设计网站具有以下特点:简洁性:网站设计操作简洁易懂,用户操作易上手,便利同学处理闲置物品;有用性:系统能完成商品呈现治理等功能和治理员对信息的处理,有很好的有用性;三、需求分析非注册用户,浏览商品、注册会员用户注册,商品浏览、添加商品、添加购物车、用户结账、发布留言、修改商品、删除商品等;主页用户注册、登录模块
3、用户治理模块商品治理模块商品浏览和购物车模块功能模块商品搜寻和在线帮忙模块订单治理模块留言治理模块建立主页面用户注册登录用户注册查看修改用户信息找回密码增加商品修改商品信息查看商品信息信息添加物品到购物车清空购物车删除购物车物品的模糊查找在线服务帮忙 添加订单处理订单查看订单用户结账留言、查看留言、回复留言、查看回复信息治理员添加商品、删除商品、修改商品、留言治理、用户治理、网址更新爱护等;四、功能模块五、用例图六、系统流程图七、 E-R 图欢迎下载精品学习资源用户编号注册时间商品总金额真实姓名备注治理员编号用户邮箱登录名真实姓名商品 ID八、数据库和表设计订单管详理细员表表号用户密码用户登录
4、 用户商品订单明细治理员邮箱用户商地品址对应订单号商品种类商品表邮编治理员留密言码电话号码购物车商品代号性别管商年理品龄员数登量录名注册时间种类编码用户表留言编号九、调试程序注册商品用户 id名称商品原价登录留言内容上传头像销售价格留言日期修改密码详细描述添加商品主页商品图片留言后台治理找回密码十、关键程序代码登陆后台代码using System ;using System.Collections.Generic;using System.Linq;using System.Web ;using System.Web.UI ;using System.Web.UI.WebControls;us
5、ing System.Data.SqlClient;using System.Data;publicpartialclassAdmin_images_login: System.Web.UI.Page欢迎下载精品学习资源protectedvoidPage_Load objectsender,EventArgseifSessionUserLoginName =null else/string UserLoginName = SessionUserLoginName.ToString;Response.Redirectindex.aspx.UserLoginName=+ SessionUserLo
6、ginName .ToString;protectedvoidButton1_Clickobjectsender,EventArgseifTextBox1.Text = Response.Writealert用户名不能为空! ;localtion=login.aspx ;return;elseifTextBox2.Text = Response.Writealert密码不能为空! ;localtion=login.aspx ;return;elsestringname = TextBox1.Text;stringpassword = TextBox2.Text;stringconstr =se
7、rver=.;database=shopdb ; trusted_connection=true;SqlConnectionconn =newSqlConnectionconstr;conn.Open;SqlCommandcmd =newSqlCommand ;cmd.CommandText =select count* from users where UserName= + name +and Password=+ TextBox2.Text +;cmd.Connection = conn;/int count = intcmd.ExecuteScalar;if Convert .ToIn
8、t32cmd.ExecuteScalar 0SessionUserLoginName = TextBox1.Text;欢迎下载精品学习资源Response.Writealert登录成功 ;Response.Redirectusersnews.aspx.UserLoginName=+ TextBox1.Text;欢迎下载精品学习资源elseResponse.Writealert用户名或密码错误!欢迎下载精品学习资源 ;return;conn.Close;注册后台代码using System ;using System.Collections.Generic;using System.Linq;u
9、singSystem.Web ;usingSystem.Web.UI ;usingSystem.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;publicpartialclassAdmin_images_addusers: System.Web.UI.PageprotectedvoidPage_Load objectsender,EventArgseifSessionUserLoginName =nullelsestringname = SessionUserLoginName .ToString;Respon
10、se.Redirectindex.aspx.sname=+ SessionUserLoginName .ToString;protectedvoidButton1_Clickobjectsender,EventArgsestringconstr =server=.;database=shopdb ; trusted_connection=true;SqlConnectioncon =newSqlConnectionconstr;SqlCommandcmd =newSqlCommand praddusers, con;cmd.Connection = con;欢迎下载精品学习资源cmd.Comm
11、andText =praddusers;cmd.CommandType =CommandTyp.eStoredProcedure;SqlParametersp1 =newSqlParameter username,SqlDbType.VarChar, 20;sp1.ParameterName =username;sp1.Value = TextBox1.Text;cmd.Parameters.Addsp1;SqlParametersp2 =newSqlParameter password ,SqlDbType.VarChar, 20;sp2.ParameterName =password ;s
12、p2.Value = TextBox3.Text;cmd.Parameters.Addsp2;SqlParametersp3 =newSqlParameter realname ,SqlDbType.VarChar, 20;sp3.ParameterName =realname ;sp3.Value = TextBox4.Text;cmd.Parameters.Addsp3;SqlParametersp4 =newSqlParameter sex,SqlDbType.Bit;sp4.ParameterName =sex;sp4.Value =RadioButtonList1.SelectedI
13、tem.ToString= 男 .1:0 ;cmd.Parameters.Addsp4;SqlParametersp5 =newSqlParameter age,SqlDbType.Int;sp5.ParameterName =age;sp5.Value = TextBox5.Text;cmd.Parameters.Addsp5;SqlParametersp6 =newSqlParameter phonecode ,SqlDbType.VarChar, 20;sp6.ParameterName =phonecode ;sp6.Value = TextBox6.Text;cmd.Paramete
14、rs.Addsp6;SqlParametersp7 =newSqlParameter Address ,SqlDbType.VarChar, 50;sp7.ParameterName =Address ;sp7.Value = TextBox7.Text;cmd.Parameters.Addsp7;SqlParametersp8 =newSqlParameter Postcode ,SqlDbType.Char, 20;sp8.ParameterName =Postcode ;sp8.Value = TextBox8.Text;cmd.Parameters.Addsp8;SqlParamete
15、rsp9 =newSqlParameter Email ,SqlDbType.Char, 20;sp9.ParameterName =Email ;sp9.Value = TextBox9.Text;cmd.Parameters.Addsp9;SqlParametersp11 =newSqlParameter UserQue,SqlDbType.VarChar, 50;sp11.ParameterName =UserQue;sp11.Value = TextBox10.Text;cmd.Parameters.Addsp11;欢迎下载精品学习资源SqlParametersp12 =newSqlP
16、arameter UserAns, sp12.ParameterName =UserAns;SqlDbType.VarChar, 50;欢迎下载精品学习资源sp12.Value = TextBox11.Text;cmd.Parameters.Addsp12;SqlParametersp10 =newSqlParameter userid,SqlDbType.Int;sp10.ParameterName =userid ;sp10.Direction =ParameterDirection.Output ;cmd.Parameters.Addsp10;con.Open;cmd.ExecuteNo
17、nQuery;con.Close;intid =int .Parsesp10.Value.ToString;ifid 0欢迎下载精品学习资源elseResponse.Writealert注册成功 ;SessionUserLoginName = TextBox1.Text;Response.RedirectSuccReg.aspx ;Response.Writealert注册失败 . ;欢迎下载精品学习资源protectedvoidbtnTest_Clickobjectsender,EventArgseifTextBox1.Text = Response.Writealert会员登录名不能为空!
18、 ;localtion=addusers.aspx ;elsestringconstr =server=.;database=shopdb ; trusted_connection=true;SqlConnectionsqlconn =newSqlConnectionconstr;sqlconn.Open;stringsqlstr= select* from Users where UserName= + this .TextBox1.Text+ ;SqlCommandsqlcom =newSqlCommandsqlstr, sqlconn;SqlDataReaderread = sqlcom
19、.ExecuteReader;read.Read;ifread.HasRowsif this.TextBox1.Text.Trim = readUserName .ToString.TrimResponse.Writealert该会员已经注册过 ;localtion=adduser.aspx ;return;欢迎下载精品学习资源elseResponse.Writealert您可以进行欢迎下载精品学习资源正常注册 ;localtion=adduser.aspx ;read.Close;sqlconn.Close;protectedvoidButton2_Clickobjectsender,Eve
20、ntArgse添加商品后台代码usingSystem ;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web ;usingSystem.Web.Security;usingSystem.Web.UI ;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlCli
21、ent;using System.IO;publicpartialclassEditGoods : System.Web.UI.PageSqlOperatesqloperate =newSqlOperate ;SqlConnectionsqlconn =newSqlConnection ConfigurationManager.AppSettingsConnectionString ;protectedvoidPage_Load objectsender,EventArgseifSessionUserLoginName =null Response.Redirectlogin.aspx ;el
22、se欢迎下载精品学习资源protectedvoidButton1_Clickobjectsender,EventArgsestringname = TextBox1.Text; stringstartprice = TextBox2.Text;stringsaletprice = TextBox3.Text;stringtypeid = TextBox4.Text;stringwareshow = TextBox5.Text;stringpictureName = fupPicturePath.FileName;/ 猎取文件名stringlastName = pictureName.Subst
23、ringpictureName.LastIndexOf. + 1; /猎取文件后缀名stringconstr =server=.;database=shopdb ; trusted_connection=true;SqlConnectionconn =newSqlConnectionconstr;conn.Open;/ 判定上传文件的格式iflastName.ToLower= bmp |lastName.ToLower= jpg|lastName.ToLower= gifintlen = fupPicturePath.PostedFile.ContentLength;/ 猎取文件的大小Byte
24、 pictureData =newByte len;HttpPostedFilehtp = fupPicturePath.PostedFile;Stream srm = htp.InputStream;srm.ReadpictureData, 0, len;/ 读取到pictureData中SqlCommandcom =newSqlCommand insert into goods modelname,startprice,saleprice,typeid,wareshow,picturevalues+ name + ,+ startprice +,+ saletprice +,+ typei
25、d +,+ wareshow + ,pictureData, conn;com.Parameters.AddpictureData,SqlDbType.Image ;/ 指定类型com.ParameterspictureData.Value = pictureData;/ 设置参数值com.ExecuteNonQuery;conn.Close;Response.Writealert上传成功! ;localtion=index.aspx ;else/RegisterStartupScriptfalse,alert图片格式不正确! !;Response.Writealert图片格式不正确! ;十一
26、、总结欢迎下载精品学习资源通过这次课程设计的锤炼,本组成员受益很大,我们对 有了更深层次的明白, 更加熟识和把握 C#语言,解决问题的才能得到了进一步提升,团队合作意识更加猛烈;有了老师和同学的帮忙, 我们又学到了很多以前未接触到的学问与技巧,总之, 此次实训让我们受益匪浅;十二、参考书目ASP.NET 开发实战 1200 例(其次卷)清华高校出版社ASP.NET开发实战宝典 ,张跃廷主编,清华高校出版社,2021 ;ASP.NET 3.5C# 实践教程,邵良衫主编,清华高校出版社,2021版权申明本文部分内容,包括文字、图片、以及设计等在网上搜集整理;版权为潘宏亮个人全部This artic
27、leincludessome parts,includingtext,pictures, and design. Copyright is Pan Hongliangs personal ownership.用户可将本文的内容或服务用于个人学习、 争论或观看, 以及其他非商业性或非盈利性用途, 但同时应遵守著作权法及其他相关法律的规定,不得侵害本网站及相关权益人的合法权益;除此以外,将本文任何内容或服务用于其他用途时, 须征得本人及相关权益人的书面许可,并支付酬劳;Users may use the contents or services of this article for person
28、al study, research or appreciation, and othernon-commercial or non-profit purposes, but at the same time, they shall abide by the provisions of copyright law and other relevant laws, and shall not infringe upon the legitimaterightsof thiswebsiteand itsrelevantobligees.In addition, when any content o
29、r service of this article is used for otherpurposes, written permission and remuneration shall be欢迎下载精品学习资源obtained from the person concerned and the relevant obligee.转载或引用本文内容必需是以新闻性或资料性公共免费信息为使用目的的合理、善意引用,不得对本文内容原意进行曲解、修改,并自负版权等法律责任;Reproduction or quotation of the content of this articlemust be reasonableand good-faithcitationforthe use of newsor informative public free information. It shall notmisinterpret or modify the original intention of the contentof this article, and shall bear legal liability such ascopyright.欢迎下载
限制150内