当前位置: 首页>>代码示例>>C#>>正文


C# ContentPage.SavePageEdit方法代码示例

本文整理汇总了C#中Carrotware.CMS.Core.ContentPage.SavePageEdit方法的典型用法代码示例。如果您正苦于以下问题:C# ContentPage.SavePageEdit方法的具体用法?C# ContentPage.SavePageEdit怎么用?C# ContentPage.SavePageEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Carrotware.CMS.Core.ContentPage的用法示例。


在下文中一共展示了ContentPage.SavePageEdit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnSave_Click

        protected void btnSave_Click(object sender, EventArgs e)
        {
            pageContents = new ContentPage(SiteID, ContentPageType.PageType.ContentEntry);

            DateTime dtSite = CMSConfigHelper.CalcNearestFiveMinTime(SiteData.CurrentSite.Now);

            int iOrder = pageHelper.GetMaxNavOrder(SiteID) + 1;
            Guid? parentContentID = ParentPagePicker.SelectedPage;

            pageContents.Parent_ContentID = parentContentID;

            pageContents.TitleBar = txtTitle.Text;
            pageContents.NavMenuText = txtNav.Text;
            pageContents.PageHead = txtHead.Text;
            pageContents.FileName = txtFileName.Text;

            pageContents.MetaDescription = txtDescription.Text;
            pageContents.MetaKeyword = txtKey.Text;

            pageContents.Heartbeat_UserId = SecurityData.CurrentUserGuid;
            pageContents.EditHeartbeat = dtSite.AddMinutes(5);

            pageContents.EditUserId = SecurityData.CurrentUserGuid;
            pageContents.IsLatestVersion = true;
            pageContents.EditDate = SiteData.CurrentSite.Now;
            pageContents.NavOrder = iOrder;
            pageContents.PageActive = false;
            pageContents.ShowInSiteMap = true;
            pageContents.ShowInSiteNav = true;
            pageContents.ContentType = ContentPageType.PageType.ContentEntry;

            pageContents.GoLiveDate = dtSite;
            pageContents.RetireDate = dtSite.AddYears(200);

            pageContents.SavePageEdit();

            pnlAdd.Visible = false;
            pnlSaved.Visible = true;

            litPageName.Text = pageContents.FileName;
            lnkNew.NavigateUrl = pageContents.FileName;

            if (pageContents.FileName.ToLowerInvariant().EndsWith(SiteData.DefaultDirectoryFilename)) {
                VirtualDirectory.RegisterRoutes(true);
            }

            Master.ShowSave();
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:48,代码来源:PageAddChild.aspx.cs

示例2: CreateEmptyHome

		private void CreateEmptyHome() {
			DateTime dtSite = CMSConfigHelper.CalcNearestFiveMinTime(SiteData.CurrentSite.Now);

			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",
				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();
		}
开发者ID:ninianne98,项目名称:CarrotCakeCMS-MVC,代码行数:32,代码来源:CmsAdminController.cs

示例3: btnSave_Click

        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);
            }
        }
开发者ID:sunsiz,项目名称:CarrotCakeCMS,代码行数:83,代码来源:SiteInfo.aspx.cs


注:本文中的Carrotware.CMS.Core.ContentPage.SavePageEdit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。