using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using CommonV2; public partial class cart : System.Web.UI.UserControl { protected void Page_Load(object sender, System.EventArgs e) { PopulateCart(); } public void PopulateCart() { if (Util.DefaultSystemSetting.Flag_SellingPrice) eCateLib.UpdateOldCartItemPrice(); ShoppingCartProxy scp = Util.ShoppingCartProxy; GridView1.DataSource = scp.GetAll(Util.GetShoppingCartId); GridView1.DataBind(); if (GridView1.Rows.Count < 1) tbCart.Visible = false; else tbCart.Visible = true; } protected void btRFQ_Click(object sender, System.EventArgs e) { Util.TmpString=""; Response.Redirect("~/cart/checkout.aspx"); } protected void GridView1_OnRowDeleting(object sender, GridViewDeleteEventArgs e) { } protected void GridView1_OnRowCommand(object sender, GridViewCommandEventArgs e) { if (Request["x"] == null || Request["y"] == null) { // somehow, it postback twice in IE, so to work around, check mouse click, //valid posting does have mouse click, the ghost posting, without mouse click,end the response. Response.End(); } else { if (e.CommandName == "Delete") { ShoppingCartProxy scp = Util.ShoppingCartProxy; scp.DelItem(Util.GetShoppingCartId, Convert.ToInt32(GridView1.DataKeys[Convert.ToInt32(e.CommandArgument)].Value)); PopulateCart(); } } } }