Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        currentSite = CMSContext.CurrentSite;

        this.lblTitle.Text = GetString("ShoppingCartPreview.Title");

        if ((ShoppingCartInfoObj != null) && (ShoppingCartInfoObj.CountryID == 0) && (currentSite != null))
        {
            string      countryName = ECommerceSettings.DefaultCountryName(currentSite.SiteName);
            CountryInfo ci          = CountryInfoProvider.GetCountryInfo(countryName);
            ShoppingCartInfoObj.CountryID = (ci != null) ? ci.CountryID : 0;
        }

        this.ShoppingCartControl.ButtonNext.Text = GetString("Ecommerce.OrderPreview.NextButtonText");

        // addresses initialization
        pnlBillingAddress.GroupingText  = GetString("Ecommerce.CartPreview.BillingAddressPanel");
        pnlShippingAddress.GroupingText = GetString("Ecommerce.CartPreview.ShippingAddressPanel");
        pnlCompanyAddress.GroupingText  = GetString("Ecommerce.CartPreview.CompanyAddressPanel");

        FillBillingAddressForm(ShoppingCartInfoObj.ShoppingCartBillingAddressID);
        FillShippingAddressForm(ShoppingCartInfoObj.ShoppingCartShippingAddressID);

        // Load company address
        if (ShoppingCartInfoObj.ShoppingCartCompanyAddressID > 0)
        {
            lblCompany.Text = OrderInfoProvider.GetAddress(ShoppingCartInfoObj.ShoppingCartCompanyAddressID);
            mAddressCount++;
            tdCompanyAddress.Visible = true;
        }
        else
        {
            tdCompanyAddress.Visible = false;
        }

        // Enable sending order notifications when creating order from CMSDesk
        if ((this.ShoppingCartControl.CheckoutProcessType == CheckoutProcessEnum.CMSDeskOrder) ||
            this.ShoppingCartControl.CheckoutProcessType == CheckoutProcessEnum.CMSDeskCustomer)
        {
            chkSendEmail.Visible = true;
            chkSendEmail.Checked = ECommerceSettings.SendOrderNotification(currentSite.SiteName);
            chkSendEmail.Text    = GetString("ShoppingCartPreview.SendNotification");
        }

        // Show tax registration ID and organization ID
        InitializeIDs();

        // shopping cart content table initialization
        gridData.Columns[4].HeaderText = GetString("Ecommerce.ShoppingCartContent.SKUName");
        gridData.Columns[5].HeaderText = GetString("Ecommerce.ShoppingCartContent.SKUUnits");
        gridData.Columns[6].HeaderText = GetString("Ecommerce.ShoppingCartContent.UnitPrice");
        gridData.Columns[7].HeaderText = GetString("Ecommerce.ShoppingCartContent.UnitDiscount");
        gridData.Columns[8].HeaderText = GetString("Ecommerce.ShoppingCartContent.Tax");
        gridData.Columns[9].HeaderText = GetString("Ecommerce.ShoppingCartContent.Subtotal");

        // Product tax summary table initialiazation
        gridTaxSummary.Columns[0].HeaderText = GetString("Ecommerce.CartContent.TaxDisplayName");
        gridTaxSummary.Columns[1].HeaderText = GetString("Ecommerce.CartContent.TaxSummary");

        // Shipping tax summary table initialiazation
        gridShippingTaxSummary.Columns[0].HeaderText = GetString("com.CartContent.ShippingTaxDisplayName");
        gridShippingTaxSummary.Columns[1].HeaderText = GetString("Ecommerce.CartContent.TaxSummary");

        ReloadData();

        // order note initialization
        lblNote.Text = GetString("ecommerce.cartcontent.notelabel");
        if (!this.ShoppingCartControl.IsCurrentStepPostBack)
        {
            // Try to select payment from ViewState first
            object viewStateValue = this.ShoppingCartControl.GetTempValue(ORDER_NOTE);
            if (viewStateValue != null)
            {
                this.txtNote.Text = Convert.ToString(viewStateValue);
            }
            else
            {
                this.txtNote.Text = ShoppingCartInfoObj.ShoppingCartNote;
            }
        }
        // Display/Hide column with applied discount
        gridData.Columns[7].Visible = this.ShoppingCartInfoObj.IsDiscountApplied;


        if (mAddressCount == 2)
        {
            tblAddressPreview.Attributes["class"] = "AddressPreviewWithTwoColumns";
        }
        else if (mAddressCount == 3)
        {
            tblAddressPreview.Attributes["class"] = "AddressPreviewWithThreeColumns";
        }
    }
Пример #2
0
 /// <summary>
 /// Fills shipping address form.
 /// </summary>
 /// <param name="addressId">Shipping address id</param>
 protected void FillShippingAddressForm(int addressId)
 {
     this.lblShip.Text = OrderInfoProvider.GetAddress(addressId);
 }
 /// <summary>
 /// Fills shipping address form.
 /// </summary>
 /// <param name="address">Shipping address</param>
 protected void FillShippingAddressForm(IAddress address)
 {
     lblShip.Text = OrderInfoProvider.GetAddress(address);
 }
 /// <summary>
 /// Fills billing address form.
 /// </summary>
 /// <param name="addressId">Billing address id</param>
 protected void FillBillingAddressForm(int addressId)
 {
     lblBill.Text = OrderInfoProvider.GetAddress(addressId);
 }
 /// <summary>
 /// Fills billing address form.
 /// </summary>
 /// <param name="address">Billing address</param>
 protected void FillBillingAddressForm(IAddress address)
 {
     lblBill.Text = OrderInfoProvider.GetAddress(address);
 }