Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((null != ProductsBase.SessionInfo && ProductsBase.SessionInfo.IsEventTicketMode) || this.ShoppingCart.OrderCategory == OrderCategoryType.HSO)
            {
                divHFF.Visible = false;
                hffPanel.Update();
                if (HLConfigManager.Configurations.DOConfiguration.IsChina)
                {
                    hlHFF.Visible    = false;
                    hffPanel.Visible = false;
                }
                return;
            }
            if (HLConfigManager.Configurations.DOConfiguration.IsChina)
            {
                if (CatalogProvider.IsPreordering(ShoppingCart.CartItems, (ShoppingCart.DeliveryInfo != null ? ShoppingCart.DeliveryInfo.WarehouseCode : string.Empty)))
                {
                    hlHFF.Visible    = false;
                    hffPanel.Visible = false;
                    return;
                }
            }
            // Verify special rules to show the module
            ShowModule();
            if (!divHFF.Visible)
            {
                return;
            }

            hlHFF.NavigateUrl = HLConfigManager.Configurations.DOConfiguration.HFFUrl;
            hlHFF.Visible     = !string.IsNullOrEmpty(hlHFF.NavigateUrl) &&
                                HLConfigManager.Configurations.DOConfiguration.ShowHFFBox;

            if (!IsPostBack)
            {
                //tbQuantity.Attributes["onkeypress"] = "Numeric(event, this)";

                // tbQuantity.Text = HLConfigManager.Configurations.DOConfiguration.HFFHerbalifeDefaultValue.ToString();
                var OrderTotals = ShoppingCart != null ? ShoppingCart.Totals != null ? ShoppingCart.Totals as OrderTotals_V02 : null : null;
                if (HLConfigManager.Configurations.DOConfiguration.IsChina && OrderTotals != null && OrderTotals.Donation > 0 && SessionInfo.StandAloneDonationNotSubmit > 0)
                {
                    SessionInfo.ClearStandAloneDonation();
                    OnStandAloneDonationClear(this, e);
                }
                lblHFFMsg.Text = string.Empty;
                divMsg.Visible = false;
                DefaultRightRialDonation();
                btnSelf.CssClass = "activeTab";
            }
            if (!IsChina)
            {
                lblHFFCurrencyType.Text = HLConfigManager.Configurations.DOConfiguration.HasHFFUnitDescription
                                              ? HLConfigManager.Configurations.DOConfiguration.HFFUnitDescription
                                              : HLConfigManager.Configurations.CheckoutConfiguration.CurrencySymbol;
            }
            ClearDonation.Visible = ClearDonation2.Visible = ClearBehalfDonation2.Visible = HLConfigManager.Configurations.DOConfiguration.CanCancelDonation;

            if (ClearDonation.Visible || ClearDonation2.Visible || ClearBehalfDonation2.Visible)
            {
                if (this.ShoppingCart.Totals != null)
                {
                    OrderTotals_V02 totals = ShoppingCart.Totals as OrderTotals_V02;
                    if (totals != null)
                    {
                        ClearDonation.Visible = ClearDonation2.Visible = ClearBehalfDonation2.Visible = totals.Donation > decimal.Zero;
                    }
                }
            }
        }