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;
public partial class cart : System.Web.UI.Page
{
public MyDb dd = new MyDb();
public string AddProID;
protected string RefreshID;
// public string total;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//if (RefreshID == "")
//{
// RefreshID =System.DateTime.Now.Ticks.ToString();
//}
if (Request.Params["mode"] == "view") //检测是否为直接查看购物车。
{
ViewShoppingCart();
Caculator();
}
if (Request.Params["productID"] != null || Request.Params["productID"] != "")
{
this.rnd.Text = Request["item"];
AddProID = Request["productID"];
UpdateShoppingCart();
Caculator();
}
}
}
public void CreateCartTable() //创建购物车
{
DataSet ds = new DataSet();
DataTable newDT = new DataTable("CartTable");
ds.Tables.Add(newDT);
DataColumn newDC;
newDC = new DataColumn("ProductID", System.Type.GetType("System.Int32"));
ds.Tables["CartTable"].Columns.Add(newDC);
newDC = new DataColumn("Name", System.Type.GetType("System.String"));
newDC.DefaultValue = 1;
ds.Tables["CartTable"].Columns.Add(newDC);
newDC = new DataColumn("max", System.Type.GetType("System.String"));
ds.Tables["