public TemplateManageModel(TemplateLog log) : this() { Id = log.TemplateId; Name = log.Name; Content = log.Content; DataType = log.DataType; }
public TemplateLogItem(TemplateLog model) : this() { Id = model.Id; Name = model.Name; SessionId = model.SessionId; ChangeLog = model.ChangeLog; Created = model.Created; }
public ResponseModel Insert(TemplateLog templateLog) { return _templateLogRepository.Insert(templateLog); }
public ResponseModel Delete(TemplateLog templateLog) { return _templateLogRepository.Delete(templateLog); }
/// <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(); }
public ResponseModel Update(TemplateLog templateLog) { return _templateLogRepository.Update(templateLog); }