Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OrderMonth.RegisterOrderMonthControls(pnlOrderMonth, lblOrderMonthChanged, ProductsBase.IsEventTicketMode,
                                                  pnlOrderMonthLabel);

            string levelDSType = (Page as ProductsBase).Level;

            if (levelDSType == "DS")
            {
                imgOrderMonth.Visible = true;
            }
            else
            {
                imgOrderMonth.Visible = false;
            }
            var control = loadPurchasingLimitsControl(false);

            if (control != null)
            {
                pnlPurchaseLimits.Visible = true;
                pnlPurchaseLimits.Controls.Add(control);
            }
            if (!IsPostBack)
            {
                if (null != ProductsBase.SessionInfo && ProductsBase.SessionInfo.IsEventTicketMode)
                {
                    divDiscountRate.Visible = false;
                }

                BindTotals();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var PLControl = loadPurchasingLimitsControl(false) as PurchasingLimits_IT;

            if (PLControl != null)
            {
                if (ShoppingCart.IsSavedCart || ShoppingCart.IsFromCopy)
                {
                    PLControl.HideEmptyListItem = false;
                }
                pnlPurchaseLimits.Controls.Add(PLControl);
            }
            _shoppingCart = (Page as ProductsBase).ShoppingCart;
            //purchasingLimits = HL.MyHerbalife.Providers.PurchasingLimitProvider.GetPurchasingLimits(DistributorID, user.Value.DSSubType);
            OrderMonth.RegisterOrderMonthControls(pnlOrderMonth, lblOrderMonthChanged, ProductsBase.IsEventTicketMode,
                                                  pnlOrderMonthLabel);
            BindTotals();
            if (_shoppingCart.OrderCategory == ServiceProvider.CatalogSvc.OrderCategoryType.ETO ||
                !HLConfigManager.Configurations.CheckoutConfiguration.HasEarnBase)
            {
                trEarnBase.Visible = false;
            }
            string levelDSType = (Page as ProductsBase).Level;

            if (levelDSType == "DS")
            {
                imgOrderMonth.Visible = true;
            }
            else
            {
                imgOrderMonth.Visible = false;
            }

            if (imgEarnBase != null)
            {
                imgEarnBase.Visible = CheckoutTotalsDetailed.ShowEarnBaseHelpInfo();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HLConfigManager.Configurations.DOConfiguration.IsChina && HLConfigManager.Configurations.PaymentsConfiguration.ShowBigGrandTotal)
            {
                lblGrandTotal.Attributes.Add("class", "Title");
                lblDisplayGrandTotal.Attributes.Add("class", "Title");
            }
            if (IsChina)
            {
                blErrors.Items.Clear();
            }

            MyHLShoppingCart shoppingCart = (Page as ProductsBase).ShoppingCart;

            OrderMonth.RegisterOrderMonthControls(pnlOrderMonth, lblOrderMonthChanged, ProductsBase.IsEventTicketMode,
                                                  pnlOrderMonthLabel);

            var control = loadPurchasingLimitsControl(false);

            if (control != null)
            {
                pnlPurchaseLimits.Visible = true;
                pnlPurchaseLimits.Controls.Add(control);
            }

            if (HLConfigManager.Configurations.CheckoutConfiguration.YourPriceWithAllCharges)
            {
                shoppingCart.Calculate();
            }
            BindTotals();
            if (trYourLevel != null)
            {
                trYourLevel.Visible = false;                      // Hide row by default
            }
            if (shoppingCart.OrderCategory == OrderCategoryType.ETO ||
                !HLConfigManager.Configurations.CheckoutConfiguration.HasEarnBase)
            {
                if (shoppingCart.OrderCategory == OrderCategoryType.ETO ||
                    !HLConfigManager.Configurations.CheckoutConfiguration.HasSummaryEarnBase)
                {
                    trEarnBase.Visible = false;
                }
            }
            if (!HLConfigManager.Configurations.CheckoutConfiguration.HasSubTotal)
            {
                divDistributorSubtotal.Visible = false;
            }
            if (HLConfigManager.Configurations.CheckoutConfiguration.HidePHShippingForETO)
            {
                if (SessionInfo.IsEventTicketMode)
                {
                    trPackingHandling.Visible = false;
                    if (HLConfigManager.Configurations.CheckoutConfiguration.ShowDistributorSubTotalForETO)
                    {
                        divDistributorSubtotal.Visible = true;
                    }
                    else
                    {
                        divDistributorSubtotal.Visible = false;
                    }
                    if (HLConfigManager.Configurations.CheckoutConfiguration.ShowVolumePoinsForETO)
                    {
                        trVolumePoints.Visible = true;
                    }
                    else
                    {
                        trVolumePoints.Visible = false;
                    }
                }
            }
            if (!HLConfigManager.Configurations.CheckoutConfiguration.HasOrderMonthVolumePoints)
            {
                trOrderMonthVP.Visible = false;
            }
            string levelDSType = (Page as ProductsBase).Level;

            if (levelDSType == "DS")
            {
                imgOrderMonth.Visible = true;
            }
            else
            {
                imgOrderMonth.Visible = false;
            }

            if (imgEarnBase != null)
            {
                imgEarnBase.Visible = CheckoutTotalsDetailed.ShowEarnBaseHelpInfo();
            }

            if (HLConfigManager.Configurations.DOConfiguration.IsChina)
            {
                if (HLConfigManager.Configurations.CheckoutConfiguration.HasOtherCharges)
                {
                    trOtherCharges.Visible = true;
                }

                // Conditioning tax vat row visibility.
                if (trTaxVat != null)
                {
                    trTaxVat.Visible = HLConfigManager.Configurations.CheckoutConfiguration.HasTaxVat;
                }

                if (HLConfigManager.Configurations.CheckoutConfiguration.HasLocalTax)
                {
                    trLocalTax.Visible = true;
                }

                if (HLConfigManager.Configurations.CheckoutConfiguration.HideFreightCharges && ShoppingCart.DeliveryInfo.Option == DeliveryOptionType.Pickup)
                {
                    trShippingCharge.Visible = false;
                }

                if (HLConfigManager.Configurations.CheckoutConfiguration.HideShippingCharges)
                {
                    trShippingCharge.Visible = false;
                }

                if (!HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPrice)
                {
                    if (trRetailPrice != null)
                    {
                        trRetailPrice.Visible = false;
                    }
                }
                else if (SessionInfo.IsEventTicketMode && trRetailPrice != null)
                {
                    trRetailPrice.Visible = HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPriceForETO;
                }

                if (trPackingHandling != null)
                {
                    trPackingHandling.Visible = false;
                }

                if (HLConfigManager.Configurations.CheckoutConfiguration.HasLogisticCharges)
                {
                    if (trLogisticCharge != null)
                    {
                        trLogisticCharge.Visible = true;
                    }
                }

                if (ShoppingCart.DeliveryInfo != null)
                {
                    if (ShoppingCart.DeliveryInfo.Option == DeliveryOptionType.Pickup)
                    {
                        if (HLConfigManager.Configurations.CheckoutConfiguration.HasPickupCharge)
                        {
                            if (lblDisplayShippingCharges != null)
                            {
                                lblDisplayShippingCharges.Text = (string)GetLocalResourceObject("lblDisplayPickupCharges");
                            }
                        }
                        else
                        {
                            trShippingCharge.Visible = false;
                        }
                    }
                }

                if (DistributorOrderingProfile != null && DistributorOrderingProfile.IsPC)
                {
                    if ((ShoppingCart.PcLearningDeliveryoption == ServiceProvider.CatalogSvc.DeliveryOptionType.Unknown &&
                         shoppingCart.DeliveryOption == ServiceProvider.CatalogSvc.DeliveryOptionType.Shipping) || ShoppingCart.PcLearningDeliveryoption == ServiceProvider.CatalogSvc.DeliveryOptionType.Shipping)
                    {
                        trPCLearningPoint.Visible      = true;
                        trPCLearningPointLimit.Visible = true;
                        GetEligibleUsePoint();
                    }
                    else
                    {
                        trPCLearningPoint.Visible      = false;
                        trPCLearningPointLimit.Visible = false;
                    }
                }
                else if (ShoppingCart.OrderCategory == OrderCategoryType.ETO && SessionInfo != null && !SessionInfo.IsReplacedPcOrder)
                {
                    trPCLearningPoint.Visible      = true;
                    trPCLearningPointLimit.Visible = true;
                    GetEligibleUseETOPoints();
                }
                else
                {
                    trPCLearningPoint.Visible      = false;
                    trPCLearningPointLimit.Visible = false;
                }
            }
            else
            {
                if (trDiscountTotal != null)
                {
                    trDiscountTotal.Visible = HLConfigManager.Configurations.CheckoutConfiguration.ShowDisocuntTotal;
                }
            }

            if (DistributorOrderingProfile != null && DistributorOrderingProfile.IsPC)
            {
                trVolumePoints.Visible = false;
            }

            if (!HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPrice)
            {
                if (trRetailPrice != null)
                {
                    trRetailPrice.Visible = false;
                }
            }
            else if (SessionInfo.IsEventTicketMode && trRetailPrice != null)
            {
                trRetailPrice.Visible = HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPriceForETO;
            }

            if (HLConfigManager.Configurations.DOConfiguration.IsChina)
            {
                if (!HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPrice)
                {
                    if (trRetailPrice != null)
                    {
                        trRetailPrice.Visible = false;
                    }
                }
                else if (SessionInfo.IsEventTicketMode && trRetailPrice != null)
                {
                    trRetailPrice.Visible = HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPriceForETO;
                }
                trWeight.Visible = false;
            }
            else
            {
                trGrandTotal.Visible              = false;
                trPackingHandling.Visible         = false;
                lblDisplayPackageHandling.Visible = false;
                lblPackageHandling.Visible        = false;
                trOtherCharges.Visible            = false;
                trLogisticCharge.Visible          = false;
                trShippingCharge.Visible          = !string.IsNullOrEmpty(lblShippingCharges.Text) && HLConfigManager.Configurations.DOConfiguration.ShowFreightChrageonCOP1 &&
                                                    shoppingCart.DeliveryInfo != null && shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Shipping;
                trTaxVat.Visible               = false;
                trLocalTax.Visible             = false;
                trPCLearningPoint.Visible      = false;
                trPCLearningPointLimit.Visible = false;
            }

            if (HLConfigManager.Configurations.DOConfiguration.AllowHAP && ShoppingCart.OrderCategory == OrderCategoryType.HSO)
            {
                trOrderMonth.Visible   = false;
                trOrderMonthVP.Visible = false;
                if (ShoppingCart.DsType != null && ShoppingCart.DsType == ServiceProvider.DistributorSvc.Scheme.Member)
                {
                    trEarnBase.Visible = trDiscountRate.Visible = false;
                    if (trYourLevel != null)
                    {
                        trYourLevel.Visible = true;
                    }
                    lblYourLevel.Text = GetGlobalResourceString(string.Format("DisplayLevel_{0}", ProductsBase.LevelSubType), defaultValue: string.Empty);
                }
            }

            if (trWeight != null)
            {
                trWeight.Visible = HLConfigManager.Configurations.CheckoutConfiguration.DisplayWeight && !SessionInfo.IsEventTicketMode;
            }

            if (HLConfigManager.Configurations.DOConfiguration.DisplayBifurcationKeys &&
                ShoppingCart.DsType != null && ShoppingCart.DsType == ServiceProvider.DistributorSvc.Scheme.Member)
            {
                lblDisplayVolumePoints.Text = (string)GetLocalResourceObject("lblDisplayVolumePointsResource1MB.Text");
            }
        }