コード例 #1
0
        private void LoadStoreSettings()
        {
            DataModel.Store store = StoreContext.CurrentStore;

            txtStoreName.Text = store.Name;
            txtOrderCompletedEmailRecipient.Text = store.GetSetting(StoreSettingNames.OrderCompletedEmailRecipient);
            txtCustomerServiceEmail.Text         = store.GetSetting(StoreSettingNames.CustomerServiceEmailAddress);
            txtOrderNumberPrefix.Text            = store.GetSetting(StoreSettingNames.OrderNumberPrefix);

            ddlDefaultCountryCode.Items.Clear();
            ddlDefaultCountryCode.Items.AddRange(DnnHelper.GetCountryListItems().ToArray());
            ddlDefaultCountryCode.Items.Insert(0, "");
            ddlDefaultCountryCode.TrySetSelectedValue(store.GetSetting(StoreSettingNames.DefaultCountryCode));

            ddlCurrency.Items.Clear();
            ddlCurrency.Items.AddRange(CurrencyCollection.All().Select(x => new ListItem()
            {
                Value = x.Code, Text = string.Format("{0} - {1}", x.Code, x.Description)
            }).ToArray());
            ddlCurrency.Items.Insert(0, new ListItem());
            ddlCurrency.SelectedValue = store.GetSetting(StoreSettingNames.CurrencyCode);

            string ccTypes = store.GetSetting(StoreSettingNames.AcceptedCreditCards) ?? string.Empty;

            if (string.IsNullOrEmpty(ccTypes))
            {
                chklAcceptedCreditCards.SetAllSelected();
            }
            else
            {
                string[] ccTypesArray = ccTypes.Split(',');
                chklAcceptedCreditCards.SetSelectedValues(ccTypesArray);
            }

            chkLoadJQueryUi.Checked = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.IncludeJQueryUi)).GetValueOrDefault(true);

            // Store Location / Address
            txtStorePhone.Text      = store.GetSetting(StoreSettingNames.StorePhoneNumber);
            txtStoreStreet.Text     = store.GetSetting(StoreSettingNames.StoreAddressStreet);
            txtStoreCity.Text       = store.GetSetting(StoreSettingNames.StoreAddressCity);
            txtStoreRegion.Text     = store.GetSetting(StoreSettingNames.StoreAddressRegion);
            txtStorePostalCode.Text = store.GetSetting(StoreSettingNames.StoreAddressPostalCode);
            ddlStoreCountryCode.Items.Clear();
            ddlStoreCountryCode.Items.AddRange(DnnHelper.GetCountryListItems().ToArray());
            ddlStoreCountryCode.Items.Insert(0, "");
            ddlStoreCountryCode.TrySetSelectedValue(store.GetSetting(StoreSettingNames.StoreAddressCountryCode));

            chkCheckoutAllowAnonymous.Checked        = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.CheckoutAllowAnonymous)).GetValueOrDefault(true);
            chkCheckoutShowCreateAccountLink.Checked = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.CheckoutShowCreateAccountLink)).GetValueOrDefault(true);

            chkTaxShipping.Checked = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.TaxShipping)).GetValueOrDefault(true);

            chkSendPaymentCompleteEmail.Checked = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.SendPaymentCompleteEmail)).GetValueOrDefault(true);
            chkSendOrderReceivedEmail.Checked   = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.SendOrderReceivedEmail)).GetValueOrDefault(true);

            chkShowShippingEstimateBox.Checked = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.ShowShippingEstimate)).GetValueOrDefault(true);
            chkShowCouponBox.Checked           = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.ShowCouponBox)).GetValueOrDefault(true);
            chkQuantityAndPrice.Checked        = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.ShowPriceAndQuantityInCatalog)).GetValueOrDefault(false);

            chkShowPrices.Checked        = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.ShowPrices)).GetValueOrDefault(true);
            chkEnableCheckout.Checked    = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.EnableCheckout)).GetValueOrDefault(true);
            chkRequireOrderNotes.Checked = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.RequireOrderNotes)).GetValueOrDefault(false);

            chkForceSslCheckout.Checked  = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.ForceSslCheckout)).GetValueOrDefault(false);
            chkDisplaySiteCredit.Checked = WA.Parser.ToBool(store.GetSetting(StoreSettingNames.DisplaySiteCredit)).GetValueOrDefault(true);
            txtUrlToPostOrder.Text       = store.GetSetting(StoreSettingNames.UrlToPostCompletedOrder);
        }