public ActionResult UpdateAutoReplyOnKeyWordsRule() { AutoReplyOnKeyWordsRuleEntity args = RequestArgs <AutoReplyOnKeyWordsRuleEntity>(); if (args == null) { return(RespondResult(false, "参数无效。")); } args.Domain = DomainContext.Domain.Id; _settingsManager.UpdateAutoReplyOnKeyWordsRule(args); #region 操作日志 _operatedLogManager.Create(new OperatedLogEntity() { Domain = DomainContext.Domain.Id, AppId = DomainContext.AppId, User = UserContext.User.Id, IP = Request.UserHostAddress, Module = EnumModule.Settings, Description = "更新关键词自动回复" }); #endregion return(RespondResult()); }
public void UpdateAutoReplyOnKeyWordsRule(AutoReplyOnKeyWordsRuleEntity args) { if (args == null) { return; } RemoveAutoReplyOnKeyWordsRule(args.Domain, args.Id); AddAutoReplyOnKeyWordsRule(args); }
public ActionResult GetAutoReplyOnKeyWordsRule() { string id = Request.QueryString["id"]; if (String.IsNullOrEmpty(id)) { return(RespondResult(false, "参数无效。")); } AutoReplyOnKeyWordsRuleEntity rule = _settingsManager.GetAutoReplyOnKeyWordsRule(Guid.Parse(id)); return(RespondDataResult(rule)); }
public AutoReplyOnKeyWordsRuleEntity GetAutoReplyOnKeyWordsRule(Guid id) { AutoReplyOnKeyWordsRuleEntity rule = new AutoReplyOnKeyWordsRuleEntity(); rule.Id = id; if (_dataBase.Fill <AutoReplyOnKeyWordsRuleEntity>(rule)) { List <AttachedWhereItem> attachedWhere = new List <AttachedWhereItem>(); attachedWhere.Add(new AttachedWhereItem("RuleId", rule.Id)); rule.ContentList = _dataBase.Select <AutoReplyOnKeyWordsContentEntity>(attachedWhere); return(rule); } else { return(null); } }
public void AddAutoReplyOnKeyWordsRule(AutoReplyOnKeyWordsRuleEntity args) { if (args == null) { return; } args.CreateTime = DateTime.Now; _dataBase.Insert(args); if (args.ContentList != null) { foreach (var content in args.ContentList) { content.Domain = args.Domain; content.RuleId = args.Id; _dataBase.Insert(content); } } _domainManager.UpdateLastUpdateTime(args.Domain); }