public void SavePageEdit()
{
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();
}
if (this.Parent_ContentID == Guid.Empty) {
this.Parent_ContentID = null;
}
carrot_RootContent rc = CompiledQueries.cqGetRootContentTbl(_db, this.SiteID, this.Root_ContentID);
carrot_Content oldC = CompiledQueries.cqGetLatestContentTbl(_db, this.SiteID, this.Root_ContentID);
bool bNew = false;
if (rc == null) {
rc = new carrot_RootContent();
PerformCommonSaveRoot(site, rc);
_db.carrot_RootContents.InsertOnSubmit(rc);
bNew = true;
}
carrot_Content c = new carrot_Content();
c.ContentID = Guid.NewGuid();
if (!bNew) {
oldC.IsLatestVersion = false;
}
PerformCommonSave(site, rc, c);
_db.carrot_Contents.InsertOnSubmit(c);
SaveKeywordsAndTags(_db);
_db.SubmitChanges();
SaveTrackbacks();
}
}