public void SavePageAsDraft()
{
using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
SiteData site = SiteData.GetSiteFromCache(this.SiteID);
if (this.Root_ContentID == Guid.Empty) {
this.Root_ContentID = Guid.NewGuid();
}
if (this.ContentID == Guid.Empty) {
this.ContentID = Guid.NewGuid();
}
carrot_RootContent rc = CompiledQueries.cqGetRootContentTbl(_db, this.SiteID, this.Root_ContentID);
if (rc == null) {
rc = new carrot_RootContent();
PerformCommonSaveRoot(site, rc);
_db.carrot_RootContents.InsertOnSubmit(rc);
}
carrot_Content c = new carrot_Content();
c.ContentID = Guid.NewGuid();
PerformCommonSave(site, rc, c);
c.IsLatestVersion = false; // draft, leave existing version latest
_db.carrot_Contents.InsertOnSubmit(c);
SaveKeywordsAndTags(_db);
_db.SubmitChanges();
this.IsLatestVersion = c.IsLatestVersion;
SaveTrackbacks();
}
}