《B2C电子商务网站源代码(共20页).doc》由会员分享,可在线阅读,更多相关《B2C电子商务网站源代码(共20页).doc(20页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上综合实训(课程设计)项目 ASP.NET 专 业: 计算机应用技术 课程名称: ASP.NET 系 部: 计算机与信息工程系 班 级: 指导教师: 高 祖 彦 完成时间: 2011-11-22 学生姓名: 谈锐 学 号: 恩施职业技术学院学生综合实训(课程设计)评分表学生姓名谈锐专业计算机应用班级课程名称A综合实训项目(课程设计题目)B2C完成时间2011-11-22实训总结(设计说明)摘要通过这次实验我自己动手用做了一个电子商务网站,在制作的过程中我学到了许多知识,为以后的工作打下良好的基础。指导教师意见 指导教师签字: 年 月 日 综合实训(课程设计)成绩数据库名
2、:db_NetStore表名:sysdiagrams1序号列名数据类型长度小数位标识主键允许空默认值说明1namesysname2560否2principal_idint40否3diagram_idint40是是否4versionint40是5definitionvarbinaryMAX0是表名:tb_Admin序号列名数据类型长度小数位标识主键允许空默认值说明1AdminIDint40是是否2AdminNamevarchar500否3Passwordvarchar500否4RealNamevarchar500否5Emailvarchar500否6LoadDatedatetime83否getd
3、ate表名:tb_BookInfo序号列名数据类型长度小数位标识主键允许空默认值说明1BookIDint40是是否2ClassIDint40否3BookNamevarchar500否4BookIntroducentext160否5Authorvarchar500否6Companyvarchar500否7BookUrlvarchar2000否8MarketPricefloat80否9HotPricefloat80否10Isrefinementbit10否11IsHotbit10否12IsDiscountbit10否13LoadDatedatetime83否getdate表名:tb_Class序号
4、列名数据类型长度小数位标识主键允许空默认值说明1ClassIDint40是是否2ClassNamevarchar500否3CategoryUrlvarchar500否表名:tb_Detail序号列名数据类型长度小数位标识主键允许空默认值说明1DetailIDint40是是否2BookIDint40否3Numint40否4OrderIDint40否5TotailPricefloat80否6Remarkvarchar2000是表名:tb_Image序号列名数据类型长度小数位标识主键允许空默认值说明1ImageIDint40是是否2ImageNamevarchar500否3ImageUrlvarch
5、ar2000否表名:tb_LeaveWord序号列名数据类型长度小数位标识主键允许空默认值说明1IDint40是是否2Uidnvarchar500否3Subjectnvarchar500否4Contentntext160是5DateTimedatetime83否6IPnvarchar200否表名:tb_Member序号列名数据类型长度小数位标识主键允许空默认值说明1MemberIDint40是是否2UserNamevarchar500否3Passwordvarchar500否4RealNamevarchar500否5Sexbit10否6Phonecodevarchar200否7Emailvar
6、char500否8Addressvarchar2000否9PostCodechar100否10LoadDatedatetime83否getdate表名:tb_OrderInfo序号列名数据类型长度小数位标识主键允许空默认值说明1OrderIDint40是是否2OrderDatedatetime83否getdate3BooksFeefloat80否4ShipFeefloat80否5TotalPricefloat80否6ShipTypevarchar500否7ReceiverNamevarchar500否8ReceiverPhonevarchar200否9ReceiverPostCodechar1
7、00否10ReceiverAddressvarchar2000否11ReceiverEmailvarchar500否12IsConfirmbit10否013IsSendbit10否014IsEndbit10否015AdminIDint40是16ConfirmTimedatetime83是表名:tb_Reply序号列名数据类型长度小数位标识主键允许空默认值说明1IDint40是是否2UNamenvarchar500是3Contentntext160是4DateTimedatetime83是5ReplyIDint40是6IPnvarchar200是using System;using System
8、.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;using System.Collections;public partial class _Default : System.Web.UI
9、.Page CommonClass ccObj = new CommonClass(); GoodsClass gcObj = new GoodsClass(); protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) RefineBind(); HotBind(); DiscountBind(); /绑定市场价格 public string GetVarMKP(string strMarketPrice) return ccObj.VarStr(strMarketPrice, 2); /绑定热卖价格 publ
10、ic string GetVarHot(string strHotPrice) return ccObj.VarStr(strHotPrice, 2); protected void RefineBind() gcObj.DLDeplayGI(1, this.dLRefine, Refine); protected void HotBind() gcObj.DLDeplayGI(3, this.dlHot, Hot); protected void DiscountBind() gcObj.DLDeplayGI(2, this.dlDiscount, Discount); public voi
11、d AddressBack(DataListCommandEventArgs e) Sessionaddress = ; Sessionaddress = Default.aspx; Response.Redirect(/showInfo.aspx?id= + Convert.ToInt32(e.CommandArgument.ToString(); protected void dLRefine_ItemCommand(object source, DataListCommandEventArgs e) if (e.CommandName = detailSee) AddressBack(e
12、); else if (e.CommandName = buy) AddShopCart(e); protected void dlDiscount_ItemCommand(object source, DataListCommandEventArgs e) if (e.CommandName = detailSee) AddressBack(e); else if (e.CommandName = buy) AddShopCart(e); protected void dlHot_ItemCommand(object source, DataListCommandEventArgs e) i
13、f (e.CommandName = detailSee) AddressBack(e); else if (e.CommandName = buy) AddShopCart(e); / / 向购物车中添加新商品 / / / 获取或设置可选参数, / 该参数与关联的 CommandName / 一起被传递到 Command 事件。 / public void AddShopCart(DataListCommandEventArgs e) Hashtable hashCar; if (SessionShopCart = null) /如果用户没有分配购物车 hashCar = new Hasht
14、able(); /新生成一个 hashCar.Add(e.CommandArgument, 1); /添加一个商品 SessionShopCart = hashCar; /分配给用户 else /用户已经有购物车 hashCar = (Hashtable)SessionShopCart;/得到购物车的hash表 if (hashCar.Contains(e.CommandArgument)/购物车中已有此商品,商品数量加1 int count = Convert.ToInt32(hashCare.CommandArgument.ToString();/得到该商品的数量 hashCare.Com
15、mandArgument = (count + 1);/商品数量加1 else hashCar.Add(e.CommandArgument, 1);/如果没有此商品,则新添加一个项 protected void Button1_Click(object sender, EventArgs e) using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using
16、System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class Manage_Login : System.Web.UI.Page CommonClass ccObj = new CommonClass(); DBClass dbObj = new DBClass(); protected void Page_Load(object sender, EventAr
17、gs e) if (!IsPostBack) this.labCode.Text =ccObj.RandomNum(4);/产生验证码 protected void btnLogin_Click(object sender, EventArgs e) /判断用户是否已输入了必要的信息 if (this.txtAdminName.Text.Trim() = | this.txtAdminPwd.Text.Trim() = ) Response.Write(ccObj.MessageBox(登录名和密码不能为空!); else /判断用户输入的验证码是否正确 if (txtAdminCode.Te
18、xt.Trim() = labCode.Text.Trim() /定义一个字符串,获取用户信息 string strSql = select * from tb_Admin where AdminName=+this.txtAdminName.Text.Trim()+ and Password=+this.txtAdminPwd.Text.Trim()+; DataTable dsTable=dbObj.GetDataSetStr(strSql, tbAdmin); if (dsTable.Rows.Count 0) SessionAID = Convert.ToInt32(dsTable.R
19、ows00.ToString();/保存用户ID SessionAName = dsTable.Rows01.ToString();/保存用户名 Response.Write(window.open(AdminIndex.aspx);window.close();); else Response.Write(ccObj.MessageBox(您输入的用户名或密码错误,请重新输入!); else Response.Write(ccObj.MessageBox(验证码输入有误,请重新输入!); protected void btnCancel_Click(object sender, EventA
20、rgs e) Response.Write(window.close();location=javascript:history.go(-1);); using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using
21、System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class feedback : System.Web.UI.Page CommonClass ccObj = new CommonClass(); DBClass dbObj = new DBClass(); protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) if (SessionUserName = null) Response.Redirect(Default.
22、aspx); protected void btnOK_Click(object sender, EventArgs e) if (SessionUserName = null) Response.Redirect(Default.aspx); else string strSql = INSERT INTO tb_LeaveWord(Uid,Subject,Content,DateTime,IP); strSql += VALUES( + SessionUserName.ToString() + , + this.txtTitle.Text + ; strSql += , + this.Fr
23、eeTextBox1.Text + , + DateTime.Now + ; strSql += , + Request.UserHostAddress + ); dbObj.ExecNonQuery(dbObj.GetCommandStr(strSql); Response.Write(ccObj.MessageBox(添加成功!, Default.aspx); protected void Button1_Click(object sender, EventArgs e) this.txtTitle.Text = ; this.FreeTextBox1.Text = ; protected void btnBack_Click(object sender, EventArgs e) Response.Redirect(Default.aspx); 专心-专注-专业