Esempio n. 1
0
 public PageLogModel(PageLog pageLog)
 {
     PageId = pageLog.Id;
     Title = pageLog.Title;
     FileTemplateId = pageLog.FileTemplateId;
     PageTemplateId = pageLog.Page.PageTemplateId;
     Status = pageLog.Status;
     FriendlyUrl = pageLog.FriendlyUrl;
     ParentId = pageLog.ParentId;
 }
Esempio n. 2
0
 public PageManageModel(PageLog log)
     : this(log.Page)
 {
     Content = log.Content;
     Title = log.Title;
     FriendlyUrl = log.FriendlyUrl;
     Caption = log.Caption;
     Status = log.Status;
     FileTemplateId = log.FileTemplateId;
     PageTemplateId = log.PageTemplateId;
     IncludeInSiteNavigation = log.IncludeInSiteNavigation;
     StartPublishingDate = log.StartPublishingDate;
     EndPublishingDate = log.EndPublishingDate;
 }
Esempio n. 3
0
 public PageLogItem(PageLog pageLog)
     : this()
 {
     Id = pageLog.Id;
     PageId = pageLog.PageId;
     SessionId = pageLog.SessionId;
     Title = pageLog.Title;
     ChangeLog = pageLog.ChangeLog;
     FileTemplateId = pageLog.FileTemplateId;
     PageTemplateId = pageLog.Page.PageTemplateId;
     Status = pageLog.Status;
     FriendlyUrl = pageLog.FriendlyUrl;
     ParentId = pageLog.ParentId;
     Created = pageLog.Created;
     Creator = _userServices.GetUser(pageLog.CreatedBy);
 }
Esempio n. 4
0
 public ResponseModel Insert(PageLog pageLog)
 {
     return _pageLogRepository.Insert(pageLog);
 }
Esempio n. 5
0
 public ResponseModel Delete(PageLog pageLog)
 {
     return _pageLogRepository.Delete(pageLog);
 }
Esempio n. 6
0
        /// <summary>
        /// Update data and create change log
        /// </summary>
        /// <param name="pageLog"></param>
        /// <param name="pageLogModel"></param>
        /// <returns></returns>
        private string ChangeLog(PageLog pageLog, PageLogManageModel pageLogModel)
        {
            var changeLog = new StringBuilder();
            const string format = "- Update field: {0}\n";
            if (!ConvertUtilities.Compare(pageLog.Title, pageLogModel.Title))
            {
                changeLog.AppendFormat(format, "Title");
                pageLog.Title = pageLogModel.Title;
            }
            if (!ConvertUtilities.Compare(pageLog.FriendlyUrl, pageLogModel.FriendlyUrl))
            {
                changeLog.AppendFormat(format, "FriendlyUrl");
                pageLog.FriendlyUrl = pageLogModel.FriendlyUrl;
            }
            if (!ConvertUtilities.Compare(pageLog.Content, pageLogModel.Content))
            {
                changeLog.AppendFormat(format, "Content");
                pageLog.Content = pageLogModel.Content;
            }
            if (!ConvertUtilities.Compare(pageLog.ContentWorking, pageLogModel.ContentWorking))
            {
                changeLog.AppendFormat(format, "ContentWorking");
                pageLog.ContentWorking = pageLogModel.ContentWorking;
            }
            if (!ConvertUtilities.Compare(pageLog.Caption, pageLogModel.Caption))
            {
                changeLog.AppendFormat(format, "Caption");
                pageLog.Caption = pageLogModel.Caption;
            }
            if (!ConvertUtilities.Compare(pageLog.CaptionWorking, pageLogModel.CaptionWorking))
            {
                changeLog.AppendFormat(format, "CaptionWorking");
                pageLog.CaptionWorking = pageLogModel.CaptionWorking;
            }
            if (!ConvertUtilities.Compare(pageLog.Status, pageLogModel.Status))
            {
                changeLog.AppendFormat(format, "Status");
                pageLog.Status = pageLogModel.Status;
            }
            if (!ConvertUtilities.Compare(pageLog.Keywords, pageLogModel.Keywords))
            {
                changeLog.AppendFormat(format, "Keywords");
                pageLog.Keywords = pageLogModel.Keywords;
            }
            if (!ConvertUtilities.Compare(pageLog.FileTemplateId, pageLogModel.FileTemplateId))
            {
                changeLog.AppendFormat(format, "FileTemplateId");
                pageLog.FileTemplateId = pageLogModel.FileTemplateId;
            }
            if (!ConvertUtilities.Compare(pageLog.PageTemplateId, pageLogModel.PageTemplateId))
            {
                changeLog.AppendFormat(format, "PageTemplateId");
                pageLog.PageTemplateId = pageLogModel.PageTemplateId;
            }
            if (!ConvertUtilities.Compare(pageLog.ParentId, pageLogModel.ParentId))
            {
                changeLog.AppendFormat(format, "ParentId");
                pageLog.ParentId = pageLogModel.ParentId;
            }
            if (!ConvertUtilities.Compare(pageLog.IncludeInSiteNavigation, pageLogModel.IncludeInSiteNavigation))
            {
                changeLog.AppendFormat(format, "IncludeInSiteNavigation");
                pageLog.IncludeInSiteNavigation = pageLogModel.IncludeInSiteNavigation;
            }
            if (!ConvertUtilities.Compare(pageLog.StartPublishingDate, pageLogModel.StartPublishingDate))
            {
                changeLog.AppendFormat(format, "StartPublishingDate");
                pageLog.StartPublishingDate = pageLogModel.StartPublishingDate;
            }
            if (!ConvertUtilities.Compare(pageLog.EndPublishingDate, pageLogModel.EndPublishingDate))
            {
                changeLog.AppendFormat(format, "EndPublishingDate");
                pageLog.EndPublishingDate = pageLogModel.EndPublishingDate;
            }

            if (!string.IsNullOrEmpty(changeLog.ToString()))
            {
                changeLog.Insert(0, string.Format("** Update Page **\n"));
            }

            return changeLog.ToString();
        }
Esempio n. 7
0
 public ResponseModel Update(PageLog pageLog)
 {
     return _pageLogRepository.Update(pageLog);
 }