本文整理汇总了C#中Carrotware.CMS.Core.SiteData.ConvertSiteTimeToUTC方法的典型用法代码示例。如果您正苦于以下问题:C# SiteData.ConvertSiteTimeToUTC方法的具体用法?C# SiteData.ConvertSiteTimeToUTC怎么用?C# SiteData.ConvertSiteTimeToUTC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carrotware.CMS.Core.SiteData
的用法示例。
在下文中一共展示了SiteData.ConvertSiteTimeToUTC方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
public void Save()
{
if (!this.IsWidgetPendingDelete) {
SiteData site = new SiteData(CompiledQueries.cqGetSiteFromRootContentID(db, this.Root_ContentID));
carrot_Widget w = CompiledQueries.cqGetRootWidget(db, this.Root_WidgetID);
bool bAdd = false;
if (w == null) {
bAdd = true;
w = new carrot_Widget();
}
if (this.Root_WidgetID == Guid.Empty) {
this.Root_WidgetID = Guid.NewGuid();
}
if (this.GoLiveDate.Year < 1900) {
this.GoLiveDate = site.Now.AddMinutes(-5);
}
if (this.RetireDate.Year < 1900) {
this.RetireDate = site.Now.AddYears(200);
}
w.Root_WidgetID = this.Root_WidgetID;
w.WidgetOrder = this.WidgetOrder;
w.Root_ContentID = this.Root_ContentID;
w.PlaceholderName = this.PlaceholderName;
w.ControlPath = this.ControlPath.Replace("~~/", "~/");
w.WidgetActive = this.IsWidgetActive;
w.GoLiveDate = site.ConvertSiteTimeToUTC(this.GoLiveDate);
w.RetireDate = site.ConvertSiteTimeToUTC(this.RetireDate);
carrot_WidgetData wd = new carrot_WidgetData();
wd.Root_WidgetID = w.Root_WidgetID;
wd.WidgetDataID = Guid.NewGuid();
wd.IsLatestVersion = true;
wd.ControlProperties = this.ControlProperties;
wd.EditDate = DateTime.UtcNow;
carrot_WidgetData oldWD = CompiledQueries.cqGetWidgetDataByRootID(db, this.Root_WidgetID);
//only add a new entry if the widget has some sort of change in the data stored.
if (oldWD != null) {
if (oldWD.ControlProperties != wd.ControlProperties) {
oldWD.IsLatestVersion = false;
db.carrot_WidgetDatas.InsertOnSubmit(wd);
}
} else {
db.carrot_WidgetDatas.InsertOnSubmit(wd);
}
if (bAdd) {
db.carrot_Widgets.InsertOnSubmit(w);
}
db.SubmitChanges();
} else {
DeleteAll();
}
}
示例2: PerformCommonSave
private void PerformCommonSave(SiteData pageSite, carrot_RootContent rc, carrot_Content c)
{
c.NavOrder = this.NavOrder;
if (this.ContentType == ContentPageType.PageType.BlogEntry) {
this.PageSlug = ContentPageHelper.ScrubFilename(this.Root_ContentID, this.PageSlug);
this.FileName = ContentPageHelper.CreateFileNameFromSlug(this.SiteID, this.GoLiveDate, this.PageSlug);
c.NavOrder = SiteData.BlogSortOrderNumber;
}
rc.GoLiveDate = pageSite.ConvertSiteTimeToUTC(this.GoLiveDate);
rc.RetireDate = pageSite.ConvertSiteTimeToUTC(this.RetireDate);
rc.GoLiveDateLocal = pageSite.ConvertUTCToSiteTime(rc.GoLiveDate);
rc.PageSlug = this.PageSlug;
rc.PageThumbnail = this.Thumbnail;
c.Root_ContentID = this.Root_ContentID;
rc.Heartbeat_UserId = this.Heartbeat_UserId;
rc.EditHeartbeat = this.EditHeartbeat;
rc.FileName = this.FileName;
rc.PageActive = this.PageActive;
rc.ShowInSiteNav = this.ShowInSiteNav;
rc.BlockIndex = this.BlockIndex;
rc.ShowInSiteMap = this.ShowInSiteMap;
rc.FileName = ContentPageHelper.ScrubFilename(this.Root_ContentID, rc.FileName);
c.Parent_ContentID = this.Parent_ContentID;
c.IsLatestVersion = true;
c.TitleBar = this.TitleBar;
c.NavMenuText = this.NavMenuText;
c.PageHead = this.PageHead;
c.PageText = this.PageText;
c.LeftPageText = this.LeftPageText;
c.RightPageText = this.RightPageText;
c.EditUserId = this.EditUserId;
c.CreditUserId = this.CreditUserId;
c.EditDate = DateTime.UtcNow;
c.TemplateFile = this.TemplateFile;
FixMeta();
c.MetaKeyword = this.MetaKeyword.Replace("\r\n", " ").Replace("\n", " ").Replace("\r", " ").Replace(" ", " ");
c.MetaDescription = this.MetaDescription.Replace("\r\n", " ").Replace("\n", " ").Replace("\r", " ").Replace(" ", " ");
this.Root_ContentID = rc.Root_ContentID;
this.ContentID = c.ContentID;
this.FileName = rc.FileName;
this.EditDate = pageSite.ConvertUTCToSiteTime(c.EditDate);
this.CreateDate = pageSite.ConvertUTCToSiteTime(rc.CreateDate);
this.GoLiveDate = pageSite.ConvertUTCToSiteTime(rc.GoLiveDate);
this.RetireDate = pageSite.ConvertUTCToSiteTime(rc.RetireDate);
}
示例3: PerformCommonSaveRoot
private void PerformCommonSaveRoot(SiteData pageSite, carrot_RootContent rc)
{
rc.Root_ContentID = this.Root_ContentID;
rc.PageActive = true;
rc.BlockIndex = false;
rc.ShowInSiteMap = true;
rc.SiteID = this.SiteID;
rc.ContentTypeID = ContentPageType.GetIDByType(this.ContentType);
rc.CreateDate = DateTime.UtcNow;
if (this.CreateUserId != Guid.Empty) {
rc.CreateUserId = this.CreateUserId;
} else {
rc.CreateUserId = SecurityData.CurrentUserGuid;
}
rc.GoLiveDate = pageSite.ConvertSiteTimeToUTC(this.GoLiveDate);
rc.RetireDate = pageSite.ConvertSiteTimeToUTC(this.RetireDate);
if (this.CreateDate.Year > 1950) {
rc.CreateDate = pageSite.ConvertSiteTimeToUTC(this.CreateDate);
}
}
示例4: GetSingleMonthBlogUpdateList
public List<ContentDateLinks> GetSingleMonthBlogUpdateList(SiteData currentSite, DateTime monthDate, bool bActiveOnly)
{
List<ContentDateLinks> lstContent = new List<ContentDateLinks>();
DateTime dateBegin = monthDate.AddDays(0 - monthDate.Day).AddDays(1);
DateTime dateEnd = dateBegin.AddMonths(1).AddMilliseconds(-1);
if (currentSite != null) {
dateBegin = currentSite.ConvertSiteTimeToUTC(dateBegin);
dateEnd = currentSite.ConvertSiteTimeToUTC(dateEnd);
}
IQueryable<vw_carrot_Content> query1 = CannedQueries.GetLatestBlogListDateRange(db, currentSite.SiteID, dateBegin, dateEnd, bActiveOnly);
lstContent = (from p in query1
group p by p.GoLiveDateLocal.Date into g
select new ContentDateLinks { PostDate = g.Key, UseCount = g.Count() }).ToList();
lstContent.ToList().ForEach(q => q.TheSite = currentSite);
return lstContent;
}