Пример #1
0
        public ActionResult GetAutoReplyOnSubscribe()
        {
            AutoReplyOnSubscribeEntity result =
                _settingsManager.GetAutoReplyOnSubscribe(DomainContext.Domain.Id);

            return(RespondDataResult(result));
        }
Пример #2
0
        public ActionResult SaveAutoReplyOnSubscribe()
        {
            AutoReplyOnSubscribeEntity args = RequestArgs <AutoReplyOnSubscribeEntity>();

            if (args == null)
            {
                return(RespondResult(false, "参数无效。"));
            }

            args.Domain = DomainContext.Domain.Id;
            _settingsManager.SaveAutoReplyOnSubscribe(DomainContext, 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());
        }
Пример #3
0
        public AutoReplyOnSubscribeEntity GetAutoReplyOnSubscribe(Guid domainId)
        {
            AutoReplyOnSubscribeEntity autoReplyOnSubscribeEntity = new AutoReplyOnSubscribeEntity();

            autoReplyOnSubscribeEntity.Domain = domainId;

            if (_dataBase.Fill <AutoReplyOnSubscribeEntity>(autoReplyOnSubscribeEntity))
            {
                return(autoReplyOnSubscribeEntity);
            }
            else
            {
                return(null);
            }
        }
Пример #4
0
        public void SaveAutoReplyOnSubscribe(DomainContext domainContext, AutoReplyOnSubscribeEntity args)
        {
            if (args == null)
            {
                return;
            }

            lock (domainContext)
            {
                _dataBase.Remove(args);
                _dataBase.Insert(args);

                _domainManager.UpdateLastUpdateTime(domainContext.Domain.Id);
            }
        }