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