Esempio n. 1
0
        public void UpdateObjectFromFields(FrameworkLibrary.Settings settings)
        {
            settings.ShoppingCartTax              = decimal.Parse(ShoppingCartTax.Text);
            settings.MaxRequestLength             = int.Parse(MaxRequestLengthInMB.Text) * (1024 * 1024);
            settings.MaxUploadFileSizePerFile     = int.Parse(MaxUploadFileSizePerFileInMB.Text) * (1024 * 1024);
            settings.GlobalCodeInHead             = MediaDetailsMapper.ConvertUrlsToShortCodes(GlobalCodeInHead.Text);
            settings.GlobalCodeInBody             = MediaDetailsMapper.ConvertUrlsToShortCodes(GlobalCodeInBody.Text);
            settings.SiteOfflineUrl               = SiteOfflineUrl.Text;
            settings.PageNotFoundUrl              = PageNotFoundUrl.Text;
            settings.EnableGlossaryTerms          = EnableGlossaryTerms.Checked;
            settings.OutputCacheDurationInSeconds = long.Parse(OutputCacheDurationInSeconds.Text);

            if (!string.IsNullOrEmpty(SiteOnlineAtDateTime.Text))
            {
                settings.SiteOnlineAtDateTime = DateTime.Parse(SiteOnlineAtDateTime.Text);
            }
            else
            {
                settings.SiteOnlineAtDateTime = DateTime.Now;
            }


            if (!string.IsNullOrEmpty(SiteOfflineAtDateTime.Text))
            {
                settings.SiteOfflineAtDateTime = DateTime.Parse(SiteOfflineAtDateTime.Text);
            }
            else
            {
                settings.SiteOfflineAtDateTime = null;
            }

            settings.DefaultLanguageID   = long.Parse(DefaultLanguageSelector.SelectedValue);
            settings.DefaultMasterPageID = long.Parse(DefaultMasterPageSelector.SelectedValue);
        }
Esempio n. 2
0
        public void UpdateFieldsFromObject(FrameworkLibrary.Settings settings)
        {
            ShoppingCartTax.Text              = settings.ShoppingCartTax.ToString();
            MaxRequestLengthInMB.Text         = (settings.MaxRequestLength / (1024 * 1024)).ToString();
            MaxUploadFileSizePerFileInMB.Text = (settings.MaxUploadFileSizePerFile / (1024 * 1024)).ToString();
            GlobalCodeInHead.Text             = settings.GlobalCodeInHead;
            GlobalCodeInBody.Text             = settings.GlobalCodeInBody;
            OutputCacheDurationInSeconds.Text = settings.OutputCacheDurationInSeconds.ToString();
            PageNotFoundUrl.Text              = settings.PageNotFoundUrl;
            EnableGlossaryTerms.Checked       = settings.EnableGlossaryTerms;

            if (settings.SiteOnlineAtDateTime > DateTime.MinValue)
            {
                SiteOnlineAtDateTime.Text = settings.SiteOnlineAtDateTime.ToString();
            }

            if (settings.SiteOfflineAtDateTime != null)
            {
                SiteOfflineAtDateTime.Text = settings.SiteOfflineAtDateTime.ToString();
            }

            SiteOfflineUrl.Text = settings.SiteOfflineUrl;

            DefaultLanguageSelector.SelectedValue   = settings.DefaultLanguageID.ToString();
            DefaultMasterPageSelector.SelectedValue = settings.DefaultMasterPageID.ToString();
        }