Ejemplo n.º 1
0
        protected override void AttachChildControls()
        {
            radlAddress           = (Common_ShippingAddressRadioButtonList)FindControl("Common_ShippingAddressesRadioButtonList");
            dropRegions           = (RegionSelector)FindControl("dropRegions");
            txtShipTo             = (TextBox)FindControl("txtShipTo");
            txtAddress            = (TextBox)FindControl("txtAddress");
            txtZipcode            = (TextBox)FindControl("txtZipcode");
            txtCellPhone          = (TextBox)FindControl("txtCellPhone");
            txtTelPhone           = (TextBox)FindControl("txtTelPhone");
            orderOptionList       = (Common_OrderOptionList)FindControl("Common_OrderOptions");
            shippingModeList      = (Common_ShippingModeList)FindControl("Common_ShippingModeList");
            paymentModeList       = (Common_PaymentModeList)FindControl("grd_Common_PaymentModeList");
            inputPaymentModeId    = (HtmlInputHidden)FindControl("inputPaymentModeId");
            inputShippingModeId   = (HtmlInputHidden)FindControl("inputShippingModeId");
            hdbuytype             = (HtmlInputHidden)FindControl("hdbuytype");
            lblPaymentPrice       = (PaymentPriceLabel)FindControl("lblPaymentPrice");
            lblShippModePrice     = (ShippingModePriceLabel)FindControl("lblShippModePrice");
            cartProductList       = (Common_SubmmintOrder_ProductList)FindControl("Common_SubmmintOrder_ProductList");
            cartGiftList          = (Common_SubmmintOrder_GiftList)FindControl("Common_SubmmintOrder_GiftList");
            lblOrderOptionPrice   = (OrderOptionPriceLabel)FindControl("lblOrderOptionPrice");
            litProductAmount      = (Literal)FindControl("litProductAmount");
            litAllWeight          = (WeightLabel)FindControl("litAllWeight");
            litPoint              = (PointTotalLabel)FindControl("litPoint");
            lblOrderTotal         = (OrderTotalPriceLabel)FindControl("lblOrderTotal");
            lblCartTotalPrice     = (CartTotalPriceLabel)FindControl("lblCartTotalPrice");
            txtMessage            = (TextBox)FindControl("txtMessage");
            hlkFeeFreeName        = (HyperLink)FindControl("hlkFeeFreeName");
            lblServiceChargeFree  = (ServiceChargeFreeNameLabel)FindControl("lblServiceChargeFree");
            lblShipChargeFee      = (ShipChargeFeeNameLabel)FindControl("lblShipChargeFee");
            lblPackingChargeFree  = (PackingChargeFreeNameLabel)FindControl("lblPackingChargeFree");
            hlkDiscountName       = (HyperLink)FindControl("hlkDiscountName");
            litDiscountPrice      = (Literal)FindControl("litDiscountPrice");
            htmlCouponCode        = (HtmlInputText)FindControl("htmlCouponCode");
            CmbCoupCode           = (HtmlSelect)FindControl("CmbCoupCode");
            litCouponAmout        = (CouponPriceLabel)FindControl("litCouponAmout");
            btnCreateOrder        = ButtonManager.Create(FindControl("btnCreateOrder"));
            btnCreateOrder.Click += new EventHandler(btnCreateOrder_Click);

            if (!Page.IsPostBack)
            {
                //绑定地址
                BindUserAddress();

                //绑定订单
                orderOptionList.DataSource = ShoppingProcessor.GetUsableOrderLookupLists();
                orderOptionList.DataBind();

                //绑定配送方式
                shippingModeList.DataSource = ShoppingProcessor.GetShippingModes();
                shippingModeList.DataBind();

                //绑定支付方式
                ReBindPayment();

                if (shoppingCart != null)
                {
                    BindPromote(shoppingCart);

                    BindShoppingCartInfo(shoppingCart);

                    CmbCoupCode.DataTextField  = "DisplayText";
                    CmbCoupCode.DataValueField = "ClaimCode";
                    CmbCoupCode.DataSource     = ShoppingProcessor.GetCoupon(shoppingCart.GetTotal());
                    CmbCoupCode.DataBind();

                    ListItem item = new ListItem("", "0");
                    CmbCoupCode.Items.Insert(0, item);

                    hdbuytype.Value = buytype;
                }
            }
        }
Ejemplo n.º 2
0
 protected override void AttachChildControls()
 {
     this.dropRegions         = (RegionSelector)this.FindControl("dropRegions");
     this.txtShipTo           = (System.Web.UI.WebControls.TextBox) this.FindControl("txtShipTo");
     this.txtAddress          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtAddress");
     this.txtZipcode          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtZipcode");
     this.txtCellPhone        = (System.Web.UI.WebControls.TextBox) this.FindControl("txtCellPhone");
     this.txtTelPhone         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtTelPhone");
     this.txtInvoiceTitle     = (System.Web.UI.WebControls.TextBox) this.FindControl("txtInvoiceTitle");
     this.drpShipToDate       = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("drpShipToDate");
     this.litTaxRate          = (System.Web.UI.WebControls.Label) this.FindControl("litTaxRate");
     this.shippingModeList    = (Common_ShippingModeList)this.FindControl("Common_ShippingModeList");
     this.paymentModeList     = (Common_PaymentModeList)this.FindControl("grd_Common_PaymentModeList");
     this.inputPaymentModeId  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("inputPaymentModeId");
     this.inputShippingModeId = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("inputShippingModeId");
     this.hdbuytype           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdbuytype");
     this.pannel_useraddress  = (System.Web.UI.WebControls.Panel) this.FindControl("pannel_useraddress");
     this.lblPaymentPrice     = (FormatedMoneyLabel)this.FindControl("lblPaymentPrice");
     this.lblShippModePrice   = (FormatedMoneyLabel)this.FindControl("lblShippModePrice");
     this.chkTax                = (System.Web.UI.HtmlControls.HtmlInputCheckBox) this.FindControl("chkTax");
     this.cartProductList       = (Common_SubmmintOrder_ProductList)this.FindControl("Common_SubmmintOrder_ProductList");
     this.cartGiftList          = (Common_SubmmintOrder_GiftList)this.FindControl("Common_SubmmintOrder_GiftList");
     this.litProductAmount      = (System.Web.UI.WebControls.Literal) this.FindControl("litProductAmount");
     this.litProductBundling    = (System.Web.UI.WebControls.Literal) this.FindControl("litProductBundling");
     this.litAllWeight          = (System.Web.UI.WebControls.Label) this.FindControl("litAllWeight");
     this.litPoint              = (System.Web.UI.WebControls.Label) this.FindControl("litPoint");
     this.hlkSentTimesPoint     = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkSentTimesPoint");
     this.lblOrderTotal         = (FormatedMoneyLabel)this.FindControl("lblOrderTotal");
     this.txtMessage            = (System.Web.UI.WebControls.TextBox) this.FindControl("txtMessage");
     this.hlkFeeFreight         = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkFeeFreight");
     this.hlkReducedPromotion   = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkReducedPromotion");
     this.lblTotalPrice         = (FormatedMoneyLabel)this.FindControl("lblTotalPrice");
     this.htmlCouponCode        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("htmlCouponCode");
     this.CmbCoupCode           = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("CmbCoupCode");
     this.tbCoupon              = (System.Web.UI.HtmlControls.HtmlTable) this.FindControl("tbCoupon");
     this.litCouponAmout        = (FormatedMoneyLabel)this.FindControl("litCouponAmout");
     this.btnCreateOrder        = ButtonManager.Create(this.FindControl("btnCreateOrder"));
     this.btnCreateOrder.Click += new System.EventHandler(this.btnCreateOrder_Click);
     Hidistro.Membership.Context.SiteSettings masterSettings = Hidistro.Membership.Context.SettingsManager.GetMasterSettings(false);
     if (!this.Page.IsPostBack)
     {
         this.BindUserAddress();
         this.shippingModeList.DataSource = ShoppingProcessor.GetShippingModes();
         this.shippingModeList.DataBind();
         this.ReBindPayment();
         if (this.shoppingCart != null)
         {
             this.litTaxRate.Text = masterSettings.TaxRate.ToString(System.Globalization.CultureInfo.InvariantCulture);
             this.BindShoppingCartInfo(this.shoppingCart);
             if (this.isGroupBuy || this.isCountDown || this.isBundling || this.shoppingCart.LineItems.Count == 0)
             {
                 this.tbCoupon.Visible = false;
             }
             this.CmbCoupCode.DataTextField  = "DisplayText";
             this.CmbCoupCode.DataValueField = "ClaimCode";
             this.CmbCoupCode.DataSource     = ShoppingProcessor.GetCoupon(this.shoppingCart.GetTotal());
             this.CmbCoupCode.DataBind();
             System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem("", "0");
             this.CmbCoupCode.Items.Insert(0, item);
             this.hdbuytype.Value            = this.buytype;
             this.pannel_useraddress.Visible = (!Hidistro.Membership.Context.HiContext.Current.User.IsAnonymous && PersonalHelper.GetShippingAddressCount(Hidistro.Membership.Context.HiContext.Current.User.UserId) > 0);
         }
     }
 }