/// <summary> /// Update data and create change log /// </summary> /// <param name="pageTemplateLog"></param> /// <param name="pageTemplateLogModel"></param> /// <returns></returns> private string ChangeLog(PageTemplateLog pageTemplateLog, PageTemplateLogManageModel pageTemplateLogModel) { var changeLog = new StringBuilder(); const string format = "- Update field: {0}\n"; if (!ConvertUtilities.Compare(pageTemplateLog.Name, pageTemplateLogModel.Name)) { changeLog.AppendFormat(format, "Name"); pageTemplateLog.Name = pageTemplateLogModel.Name; } if (!ConvertUtilities.Compare(pageTemplateLog.Content, pageTemplateLogModel.Content)) { changeLog.AppendFormat(format, "Content"); pageTemplateLog.Content = pageTemplateLogModel.Content; } if (!ConvertUtilities.Compare(pageTemplateLog.ParentId, pageTemplateLogModel.ParentId)) { changeLog.AppendFormat(format, "ParentId"); pageTemplateLog.ParentId = pageTemplateLogModel.ParentId; } if (!string.IsNullOrEmpty(changeLog.ToString())) { changeLog.Insert(0, string.Format("** Update Page Template **\n")); } return(changeLog.ToString()); }
/// <summary> /// Update data and create change log /// </summary> /// <param name="styleLog"></param> /// <param name="styleLogModel"></param> /// <returns></returns> private string ChangeLog(StyleLog styleLog, StyleLogManageModel styleLogModel) { var changeLog = new StringBuilder(); const string format = "- Update field: {0}\n"; if (!ConvertUtilities.Compare(styleLog.Name, styleLogModel.Name)) { changeLog.AppendFormat(format, "Name"); styleLog.Name = styleLogModel.Name; } if (!ConvertUtilities.Compare(styleLog.Content, styleLogModel.Content)) { changeLog.AppendFormat(format, "Content"); styleLog.Content = styleLogModel.Content; } if (!string.IsNullOrEmpty(changeLog.ToString())) { changeLog.Insert(0, "** Update Style **\n"); } return(changeLog.ToString()); }
/// <summary> /// Update data and create change log /// </summary> /// <param name="templateLog"></param> /// <param name="templateLogModel"></param> /// <returns></returns> private string ChangeLog(TemplateLog templateLog, TemplateLogManageModel templateLogModel) { var changeLog = new StringBuilder(); const string format = "- Update field: {0}\n"; if (!ConvertUtilities.Compare(templateLog.Name, templateLogModel.Name)) { changeLog.AppendFormat(format, "Name"); templateLog.Name = templateLogModel.Name; } if (!ConvertUtilities.Compare(templateLog.Content, templateLogModel.Content)) { changeLog.AppendFormat(format, "Content"); templateLog.Content = templateLogModel.Content; } if (!string.IsNullOrEmpty(changeLog.ToString())) { changeLog.Insert(0, string.Format("** Update Template **\n")); } return(changeLog.ToString()); }
/// <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()); }