protected override void AttachChildControls() { this.txtSKU = (System.Web.UI.WebControls.TextBox) this.FindControl("txtSKU"); this.btnSKU = (System.Web.UI.WebControls.Button) this.FindControl("btnSKU"); this.btnClearCart = (ImageLinkButton)this.FindControl("btnClearCart"); this.shoppingCartProductList = (Common_ShoppingCart_ProductList)this.FindControl("Common_ShoppingCart_ProductList"); this.shoppingCartGiftList = (Common_ShoppingCart_GiftList)this.FindControl("Common_ShoppingCart_GiftList"); this.shoppingCartPromoGiftList = (Common_ShoppingCart_PromoGiftList)this.FindControl("Common_ShoppingCart_PromoGiftList"); this.lblTotalPrice = (FormatedMoneyLabel)this.FindControl("lblTotalPrice"); this.lblAmoutPrice = (System.Web.UI.WebControls.Literal) this.FindControl("lblAmoutPrice"); this.lblTax = (System.Web.UI.WebControls.Literal) this.FindControl("lblTax"); this.lblReducedActivity = (System.Web.UI.WebControls.Literal) this.FindControl("lblReducedActivity"); this.hlkReducedPromotion = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkReducedPromotion"); this.btnCheckout = (System.Web.UI.WebControls.Button) this.FindControl("btnCheckout"); this.pnlShopCart = (System.Web.UI.WebControls.Panel) this.FindControl("pnlShopCart"); this.pnlPromoGift = (System.Web.UI.WebControls.Panel) this.FindControl("pnlPromoGift"); this.pnlNoProduct = (System.Web.UI.WebControls.Panel) this.FindControl("pnlNoProduct"); this.hfdIsLogin = (System.Web.UI.WebControls.HiddenField) this.FindControl("hfdIsLogin"); this.btnSKU.Click += new System.EventHandler(this.btnSKU_Click); this.btnClearCart.Click += new System.EventHandler(this.btnClearCart_Click); this.shoppingCartProductList.ItemCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartProductList_ItemCommand); this.shoppingCartProductList.ItemDataBound += shoppingCartProductList_ItemDataBound; this.shoppingCartGiftList.ItemCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartGiftList_ItemCommand); this.shoppingCartGiftList.FreeItemCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartGiftList_FreeItemCommand); this.shoppingCartPromoGiftList.ItemCommand += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.shoppingCartPromoGiftList_ItemCommand); this.btnCheckout.Click += new System.EventHandler(this.btnCheckout_Click); shoppingCart = ShoppingCartProcessor.GetShoppingCart(); if (!HiContext.Current.SiteSettings.IsOpenSiteSale) { this.btnSKU.Visible = false; this.btnCheckout.Visible = false; } if (!HiContext.Current.User.IsAnonymous) { this.hfdIsLogin.Value = "logined"; } System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); this.BindShoppingCart(); sw.Stop(); ErrorLog.Write("PC端购物车加载所用的时间(毫秒):" + sw.ElapsedMilliseconds.ToString()); }
protected override void AttachChildControls() { this.txtSKU = (System.Web.UI.WebControls.TextBox) this.FindControl("txtSKU"); this.btnSKU = (System.Web.UI.WebControls.Button) this.FindControl("btnSKU"); this.btnClearCart = (ImageLinkButton)this.FindControl("btnClearCart"); this.shoppingCartProductList = (Common_ShoppingCart_ProductList)this.FindControl("Common_ShoppingCart_ProductList"); this.shoppingCartGiftList = (Common_ShoppingCart_GiftList)this.FindControl("Common_ShoppingCart_GiftList"); this.shoppingCartPromoGiftList = (Common_ShoppingCart_PromoGiftList)this.FindControl("Common_ShoppingCart_PromoGiftList"); this.lblTotalPrice = (FormatedMoneyLabel)this.FindControl("lblTotalPrice"); this.lblAmoutPrice = (System.Web.UI.WebControls.Literal) this.FindControl("lblAmoutPrice"); this.hlkReducedPromotion = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkReducedPromotion"); this.btnCheckout = (System.Web.UI.WebControls.Button) this.FindControl("btnCheckout"); this.pnlShopCart = (System.Web.UI.WebControls.Panel) this.FindControl("pnlShopCart"); this.pnlPromoGift = (System.Web.UI.WebControls.Panel) this.FindControl("pnlPromoGift"); this.litNoProduct = (System.Web.UI.WebControls.Literal) this.FindControl("litNoProduct"); this.hfdIsLogin = (System.Web.UI.WebControls.HiddenField) this.FindControl("hfdIsLogin"); this.btnSKU.Click += new System.EventHandler(this.btnSKU_Click); this.btnClearCart.Click += new System.EventHandler(this.btnClearCart_Click); this.shoppingCartProductList.ItemCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartProductList_ItemCommand); this.shoppingCartGiftList.ItemCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartGiftList_ItemCommand); this.shoppingCartGiftList.FreeItemCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.shoppingCartGiftList_FreeItemCommand); this.shoppingCartPromoGiftList.ItemCommand += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.shoppingCartPromoGiftList_ItemCommand); this.btnCheckout.Click += new System.EventHandler(this.btnCheckout_Click); if (!Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsOpenSiteSale && !Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings) { this.btnSKU.Visible = false; this.btnCheckout.Visible = false; } if (!this.Page.IsPostBack) { this.BindShoppingCart(); } if (!Hidistro.Membership.Context.HiContext.Current.User.IsAnonymous) { this.hfdIsLogin.Value = "logined"; } }