/// <summary>
        /// 转化为SensitiveWordType用于数据库存储
        /// </summary>
        /// <returns>SensitiveWord</returns>
        public SensitiveWordType AsSensitiveWordType()
        {
            SensitiveWordType sensitiveWordType = null;

            if (this.TypeId > 0)
                sensitiveWordType = new SensitiveWordService().GetSensitiveWordType(this.TypeId.Value);
            else
                sensitiveWordType = SensitiveWordType.New();

            sensitiveWordType.Name = this.Name;

            return sensitiveWordType;
        }
Beispiel #2
0
        /// <summary>
        /// 转化为SensitiveWord用于数据库存储
        /// </summary>
        /// <returns>SensitiveWord</returns>
        public SensitiveWord AsSensitiveWord()
        {
            SensitiveWord sensitiveWord = null;

            if (this.Id > 0)
                sensitiveWord = new SensitiveWordService().Get(this.Id.Value);
            else
                sensitiveWord = SensitiveWord.New();

            sensitiveWord.Word = this.Word;
            if (this.TypeId != null)
            {
                sensitiveWord.TypeId = this.TypeId.Value;
            }
            sensitiveWord.Replacement = this.Replacement;

            return sensitiveWord;
        }