コード例 #1
0
    protected void uxUpdateButton_Click(object sender, EventArgs e)
    {
        if (DataAccessContext.Configurations.GetValue("BaseWebsiteCurrency") == CurrentCurrencyCode)
        {
            if (uxIsEnabledCheck.Checked == false)
            {
                uxMessage.DisplayError(Resources.CurrencyMessages.UpdateDefaultError);
                return;
            }
        }

        try
        {
            Currency currency = DataAccessContext.CurrencyRepository.GetOne(CurrentCurrencyCode);
            currency = SetUpCurrency(currency);
            DataAccessContext.CurrencyRepository.Save(currency, uxCurrencyCodeText.Text.Trim());

            if (DataAccessContext.Configurations.GetValue("BaseWebsiteCurrency") == CurrentCurrencyCode &&
                uxCurrencyCodeText.Text != CurrentCurrencyCode)
            {
                DataAccessContext.ConfigurationRepository.UpdateValue(DataAccessContext.Configurations["BaseWebsiteCurrency"], uxCurrencyCodeText.Text);
                AdminUtilities.LoadSystemConfig();
            }

            AdminUtilities.ClearCurrencyCache();

            uxMessage.DisplayMessage(Resources.CurrencyMessages.UpdateSuccess);
            CurrentCurrencyCode = uxCurrencyCodeText.Text.Trim();

            PopulateControl();
        }
        catch (Exception ex)
        {
            uxMessage.DisplayException(ex);
        }
    }
コード例 #2
0
    protected void uxUpdateButton_Click(object sender, EventArgs e)
    {
        try
        {
            uxTaxConfig.Update();
            uxProductImageSizeConfig.Update();
            uxDisplay.Update();
            uxRatingReview.Update();
            uxGiftCertificate.Update();
            uxWholesale.Update();
            uxEmailNotification.Update();
            uxUploadConfig.Update();
            uxSeo.Update();
            uxSystemConfig.Update();
            uxAffiliateConfig.Update();
            uxShippingTracking.Update();
            uxDownloadCount.Update();
            uxeBayConfig.Update();

            DataAccessContext.ConfigurationRepository.UpdateValue(
                DataAccessContext.Configurations["UseCustomTimeZone"],
                uxUseTimeZoneDrop.SelectedValue);

            DataAccessContext.ConfigurationRepository.UpdateValue(
                DataAccessContext.Configurations["CustomTimeZone"],
                uxCustomTimeZoneDrop.SelectedValue);


            DataAccessContext.ConfigurationRepository.UpdateValue(
                DataAccessContext.Configurations["WebServiceAdminUser"],
                uxWebServiceAdminUserText.Text);

            AdminUtilities.LoadSystemConfig();
            AdminUtilities.ClearCurrencyCache();

            uxMessage.DisplayMessage(Resources.SetupMessages.UpdateSuccess);

            SiteMapManager.ClearCache();
            PopulateControls();

            SetUpUrlCultureID();

            DataAccessContext.ConfigurationRepository.UpdateValue(
                DataAccessContext.Configurations["DownloadExpirePeriod"],
                uxDownloadExpirePeriodText.Text);

            DataAccessContext.ConfigurationRepository.UpdateValue(
                DataAccessContext.Configurations["AnonymousCheckoutAllowed"],
                uxAllowAnonymousCheckoutDropDown.SelectedValue);

            DataAccessContext.ConfigurationRepository.UpdateValue(
                DataAccessContext.Configurations["ShippingMerchantCountry"],
                uxMerchantCountryList.CurrentSelected);

            DataAccessContext.ConfigurationRepository.UpdateValue(
                DataAccessContext.Configurations["ShippingIncludeDiscount"],
                uxShippingIncludeDiscountDrop.SelectedValue);

            SetDefaultCurrency();
            SystemConfig.Load();

            UpdatePanel headerPanel = (UpdatePanel)WebUtilities.FindControlRecursive(this.Page, "uxHeaderUpdatePanel");
            if (headerPanel != null)
            {
                Control paymentLink = (Control)WebUtilities.FindControlRecursive(headerPanel, "PaymentLink");
                if (paymentLink != null)
                {
                    paymentLink.Visible = DataAccessContext.Configurations.GetBoolValue("VevoPayPADSSMode");
                    headerPanel.Update();
                }
            }
        }
        catch (Exception ex)
        {
            uxMessage.DisplayException(ex);
        }
    }