计算机毕业设计购物车功能介绍:
2. Gwclist(购物车)
此模块显示已经选择完但未生成订单的商品信息列表,显示此次购物的总数量和总金额。可以对其生成定单,删除操作。如图:
以下是引用片段:
private void initDg() { //将购物车的当前人员的数据显示在当前列表中 DataTable tmpda=new DataTable(); tmpda=Sql2000DB.Get_Table ("select * from GWC,spxx,splb where GWC.spid=spxx.spid and spxx.lbid=splb.lbid and Gwc.id='"+ Session["UserID"].ToString() +"'"); this.dg.DataSource=tmpda; this.dg.DataBind(); //从数据库中计算出购物车中当前人员的总数量和总金额 tmpda=Sql2000DB.Get_Table("select sum(gwc.Sl),sum(gwc.sl * spxx.jg) from GWC,spxx where spxx.spid=gwc.spid and Gwc.id='"+ Session["UserID"].ToString() +"'"); if(tmpda.Rows.Count>0 ) { this.Label1.Text=tmpda.Rows[0][0].ToString(); this.Label2.Text=tmpda.Rows[0][1].ToString(); } } private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 if(!Page.IsPostBack) { //查询数据库中的购物车显示总数量和总金额 DataTable tmpda=new DataTable(); tmpda=Sql2000DB.Get_Table ("select * from GWC,spxx,splb where GWC.spid=spxx.spid and spxx.lbid=splb.lbid and Gwc.id='"+ Session["UserID"].ToString() +"'"); this.dg.DataSource=tmpda; this.dg.DataBind(); //从数据库中计算出购物车中此会员的总数量和总金额 tmpda=Sql2000DB.Get_Table("select sum(gwc.Sl),sum(gwc.sl * spxx.jg) from GWC,spxx where spxx.spid=gwc.spid and Gwc.id='"+ Session["UserID"].ToString() +"'"); if(tmpda.Rows.Count>0 ) { this.TextBox3.Text=tmpda.Rows[0][0].ToString(); this.TextBox4.Text=tmpda.Rows[0][1].ToString(); } //初始化显示控件内容 this.TextBox1.Text=string.Format("{0:0000}",DateTime.Now.Year) + string.Format("{0:00}",DateTime.Now.Day) +string.Format("{0:00}",DateTime.Now.Hour) +string.Format("{0:00}",DateTime.Now.Second ); this.TextBox2.Text=Session["UserID"].ToString(); this.TextBox6.Text=DateTime.Now.Date.ToShortDateString(); this.LinkButton2.Attributes.Add("onclick","return confirm('订单生成以后只能等待确认,您不能再继续操作,是否确认生成订单?');"); } } |
〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
第13页为计算机毕业论文留言模块介绍......