BulkBlogFileNameUpdateFromDate() public method

public BulkBlogFileNameUpdateFromDate ( System.Guid siteID ) : void
siteID System.Guid
return void
Esempio n. 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            SiteData site = siteHelper.GetCurrentSite();
            string sDatePatternOld = "yy-MM-dd";
            string sTimezoneOld = "ZZZ";

            if (site == null) {
                site = new SiteData();
                site.SiteID = SiteID;
            }

            if (site != null) {
                sDatePatternOld = site.Blog_DatePattern;
                sTimezoneOld = site.TimeZoneIdentifier;

                site.SiteName = txtSiteName.Text;
                site.SiteTagline = txtTagline.Text;
                site.SiteTitlebarPattern = txtTitleBar.Text;
                site.MainURL = txtURL.Text;
                site.MetaKeyword = txtKey.Text;
                site.MetaDescription = txtDescription.Text;
                site.BlockIndex = chkHide.Checked;
                site.SendTrackbacks = chkSendTrackback.Checked;
                site.AcceptTrackbacks = chkAcceptTrackbacks.Checked;

                site.TimeZoneIdentifier = ddlTimeZone.SelectedValue;

                site.Blog_FolderPath = txtFolderPath.Text;
                site.Blog_CategoryPath = txtCategoryPath.Text;
                site.Blog_DatePath = txtDatePath.Text;
                site.Blog_TagPath = txtTagPath.Text;
                site.Blog_EditorPath = txtEditorPath.Text;
                site.Blog_DatePattern = ddlDatePattern.SelectedValue;
                site.Blog_Root_ContentID = ParentPagePicker.SelectedPage;
            }

            site.Save();

            if (sDatePatternOld != ddlDatePattern.SelectedValue || sTimezoneOld != ddlTimeZone.SelectedValue) {
                using (ContentPageHelper cph = new ContentPageHelper()) {
                    cph.BulkBlogFileNameUpdateFromDate(SiteID);
                }
            }

            if (!bNewSite) {
                Response.Redirect(SiteData.CurrentScriptName);
            } else {
                DateTime dtSite = CalcNearestFiveMinTime(SiteData.CurrentSite.Now);

                if (chkHomepage.Checked) {
                    ContentPage pageContents = new ContentPage {
                        SiteID = SiteID,
                        Root_ContentID = Guid.NewGuid(),
                        ContentID = Guid.NewGuid(),
                        EditDate = SiteData.CurrentSite.Now,
                        CreateUserId = SecurityData.CurrentUserGuid,
                        CreateDate = SiteData.CurrentSite.Now,
                        GoLiveDate = dtSite.AddMinutes(-5),
                        RetireDate = dtSite.AddYears(200),
                        TitleBar = "Home",
                        NavMenuText = "Home",
                        PageHead = "Home",
                        FileName = "/home.aspx",
                        PageText = SiteData.StarterHomePageSample,
                        LeftPageText = String.Empty,
                        RightPageText = String.Empty,
                        NavOrder = 0,
                        IsLatestVersion = true,
                        PageActive = true,
                        ShowInSiteNav = true,
                        ShowInSiteMap = true,
                        BlockIndex = false,
                        EditUserId = SecurityData.CurrentUserGuid,
                        ContentType = ContentPageType.PageType.ContentEntry,
                        TemplateFile = SiteData.DefaultTemplateFilename
                    };

                    pageContents.SavePageEdit();
                }

                Response.Redirect(SiteFilename.DashboardURL);
            }
        }