最新b2c电子商务源代码.doc
精品资料b2c电子商务源代码.综合实训(课程设计)项目 ASP.NET 专 业: 计算机应用技术 课程名称: ASP.NET 系 部: 计算机与信息工程系 班 级: 091311 指导教师: 高 祖 彦 完成时间: 2011-11-22 学生姓名: 谈锐 学 号: 09131120 恩施职业技术学院学生综合实训(课程设计)评分表学生姓名谈锐专业计算机应用班级091311课程名称A综合实训项目(课程设计题目)B2C完成时间2011-11-22实训总结(设计说明)摘要通过这次实验我自己动手用做了一个电子商务网站,在制作的过程中我学到了许多知识,为以后的工作打下良好的基础。指导教师意见 指导教师签字: 年 月 日 综合实训(课程设计)成绩数据库名:db_NetStore表名:sysdiagrams1序号列名数据类型长度小数位标识主键允许空默认值说明1namesysname2560否2principal_idint40否3diagram_idint40是是否4versionint40是5definitionvarbinaryMAX0是表名:tb_Admin序号列名数据类型长度小数位标识主键允许空默认值说明1AdminIDint40是是否2AdminNamevarchar500否3Passwordvarchar500否4RealNamevarchar500否5Emailvarchar500否6LoadDatedatetime83否getdate表名:tb_BookInfo序号列名数据类型长度小数位标识主键允许空默认值说明1BookIDint40是是否2ClassIDint40否3BookNamevarchar500否4BookIntroducentext160否5Authorvarchar500否6Companyvarchar500否7BookUrlvarchar2000否8MarketPricefloat80否9HotPricefloat80否10Isrefinementbit10否11IsHotbit10否12IsDiscountbit10否13LoadDatedatetime83否getdate表名:tb_Class序号列名数据类型长度小数位标识主键允许空默认值说明1ClassIDint40是是否2ClassNamevarchar500否3CategoryUrlvarchar500否表名:tb_Detail序号列名数据类型长度小数位标识主键允许空默认值说明1DetailIDint40是是否2BookIDint40否3Numint40否4OrderIDint40否5TotailPricefloat80否6Remarkvarchar2000是表名:tb_Image序号列名数据类型长度小数位标识主键允许空默认值说明1ImageIDint40是是否2ImageNamevarchar500否3ImageUrlvarchar2000否表名:tb_LeaveWord序号列名数据类型长度小数位标识主键允许空默认值说明1IDint40是是否2Uidnvarchar500否3Subjectnvarchar500否4Contentntext160是5DateTimedatetime83否6IPnvarchar200否表名:tb_Member序号列名数据类型长度小数位标识主键允许空默认值说明1MemberIDint40是是否2UserNamevarchar500否3Passwordvarchar500否4RealNamevarchar500否5Sexbit10否6Phonecodevarchar200否7Emailvarchar500否8Addressvarchar2000否9PostCodechar100否10LoadDatedatetime83否getdate表名:tb_OrderInfo序号列名数据类型长度小数位标识主键允许空默认值说明1OrderIDint40是是否2OrderDatedatetime83否getdate3BooksFeefloat80否4ShipFeefloat80否5TotalPricefloat80否6ShipTypevarchar500否7ReceiverNamevarchar500否8ReceiverPhonevarchar200否9ReceiverPostCodechar100否10ReceiverAddressvarchar2000否11ReceiverEmailvarchar500否12IsConfirmbit10否013IsSendbit10否014IsEndbit10否015AdminIDint40是16ConfirmTimedatetime83是表名:tb_Reply序号列名数据类型长度小数位标识主键允许空默认值说明1IDint40是是否2UNamenvarchar500是3Contentntext160是4DateTimedatetime83是5ReplyIDint40是6IPnvarchar200是using System;using System.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.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); /绑定热卖价格 public 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 void AddressBack(DataListCommandEventArgs e) Session"address" = "" Session"address" = "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); 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) if (e.CommandName = "detailSee") AddressBack(e); else if (e.CommandName = "buy") AddShopCart(e); / <summary> / 向购物车中添加新商品 / </summary> / <param name="e"> / 获取或设置可选参数, / 该参数与关联的 CommandName / 一起被传递到 Command 事件。 / </param> public void AddShopCart(DataListCommandEventArgs e) Hashtable hashCar; if (Session"ShopCart" = null) /如果用户没有分配购物车 hashCar = new Hashtable(); /新生成一个 hashCar.Add(e.CommandArgument, 1); /添加一个商品 Session"ShopCart" = hashCar; /分配给用户 else /用户已经有购物车 hashCar = (Hashtable)Session"ShopCart"/得到购物车的hash表 if (hashCar.Contains(e.CommandArgument)/购物车中已有此商品,商品数量加1 int count = Convert.ToInt32(hashCare.CommandArgument.ToString();/得到该商品的数量 hashCare.CommandArgument = (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 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, EventArgs 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.Text.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) Session"AID" = Convert.ToInt32(dsTable.Rows00.ToString();/保存用户ID Session"AName" = dsTable.Rows01.ToString();/保存用户名 Response.Write("<script language=javascript>window.open('AdminIndex.aspx');window.close();</script>"); else Response.Write(ccObj.MessageBox("您输入的用户名或密码错误,请重新输入!"); else Response.Write(ccObj.MessageBox("验证码输入有误,请重新输入!"); protected void btnCancel_Click(object sender, EventArgs e) Response.Write("<script>window.close();location='javascript:history.go(-1)'</script>"); 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 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 (Session"UserName" = null) Response.Redirect("Default.aspx"); protected void btnOK_Click(object sender, EventArgs e) if (Session"UserName" = null) Response.Redirect("Default.aspx"); else string strSql = "INSERT INTO tb_LeaveWord(Uid,Subject,Content,DateTime,IP)" strSql += " VALUES('" + Session"UserName".ToString() + "','" + this.txtTitle.Text + "'" strSql += ",'" + this.FreeTextBox1.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");