Example #1
0
 protected void btnClear_Click(object sender, EventArgs e)
 {
     HiCache.Clear();
     this.ShowMsg("清空缓存成功", true);
 }
Example #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            masterSettings.SiteName          = this.txtSiteName.Text.Trim();
            masterSettings.ServicePhone      = this.txtServicePhone.Text.Trim();
            masterSettings.SiteUrl           = this.txtDomainName.Text.Trim();
            masterSettings.Footer            = this.fkFooter.Text;
            masterSettings.RegisterAgreement = this.fckRegisterAgreement.Text;
            ProductImagesInfo productImagesInfo = this.SaveDefaultImage();

            if (productImagesInfo != null)
            {
                masterSettings.DefaultProductImage      = productImagesInfo.ImageUrl1;
                this.hidOldImages.Value                 = productImagesInfo.ImageUrl1;
                masterSettings.DefaultProductThumbnail1 = productImagesInfo.ThumbnailUrl40;
                masterSettings.DefaultProductThumbnail2 = productImagesInfo.ThumbnailUrl60;
                masterSettings.DefaultProductThumbnail3 = productImagesInfo.ThumbnailUrl100;
                masterSettings.DefaultProductThumbnail4 = productImagesInfo.ThumbnailUrl160;
                masterSettings.DefaultProductThumbnail5 = productImagesInfo.ThumbnailUrl180;
                masterSettings.DefaultProductThumbnail6 = productImagesInfo.ThumbnailUrl220;
                masterSettings.DefaultProductThumbnail7 = productImagesInfo.ThumbnailUrl310;
                masterSettings.DefaultProductThumbnail8 = productImagesInfo.ThumbnailUrl410;
            }
            else if (this.hidUploadImages.Value.Trim().Length == 0)
            {
                masterSettings.DefaultProductImage      = string.Empty;
                this.hidOldImages.Value                 = string.Empty;
                masterSettings.DefaultProductThumbnail1 = string.Empty;
                masterSettings.DefaultProductThumbnail2 = string.Empty;
                masterSettings.DefaultProductThumbnail3 = string.Empty;
                masterSettings.DefaultProductThumbnail4 = string.Empty;
                masterSettings.DefaultProductThumbnail5 = string.Empty;
                masterSettings.DefaultProductThumbnail6 = string.Empty;
                masterSettings.DefaultProductThumbnail7 = string.Empty;
                masterSettings.DefaultProductThumbnail8 = string.Empty;
            }
            string text = this.UploadSiteLogo();

            this.hidOldLogo.Value                = text;
            masterSettings.LogoUrl               = text;
            masterSettings.DecimalLength         = this.dropBitNumber.SelectedValue;
            masterSettings.SiteDescription       = Globals.StripAllTags(this.txtSiteDescription.Text.Trim());
            masterSettings.SearchMetaDescription = Globals.StripAllTags(this.txtSearchMetaDescription.Text.Trim());
            masterSettings.SearchMetaKeywords    = Globals.StripAllTags(this.txtSearchMetaKeywords.Text.Trim());
            masterSettings.AutoRedirectClient    = this.txtAutoRedirectClient.Value.ToBool();
            masterSettings.PolyapiAppId          = Globals.StripAllTags(this.txtPolyapiAppId.Text);
            masterSettings.PolyapiKey            = Globals.StripAllTags(this.txtPolyapiKey.Text);
            if (!string.IsNullOrEmpty(this.txtQQMapAppKey.Text))
            {
                masterSettings.QQMapAPIKey = Globals.StripAllTags(this.txtQQMapAppKey.Text);
            }
            if (this.ValidationSettings(masterSettings))
            {
                Globals.EntityCoding(masterSettings, true);
                SettingsManager.Save(masterSettings);
                HiCache.Clear();
                this.ShowMsg("成功修改了商城基本信息", true);
                masterSettings = SettingsManager.GetMasterSettings();
                this.LoadSiteContent(masterSettings);
            }
        }