Beispiel #1
0
        /// <summary>
        /// 保存回复信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ReturnMsg SaveReplyInfo(WctReplyMstrDto dto)
        {
            var rm     = new ReturnMsg();
            var entity = new WctReplyMstr();
            var isOk   = CheckReplyInfo(dto, rm);

            if (!isOk.IsSuccess)
            {
                return(rm);
            }
            if (string.IsNullOrEmpty(dto.Id))
            {
                dto.Id           = Guid.NewGuid().ToString("N");
                dto.REPLY_STATUS = "未发布";
                dto.REPLY_ID_NO  = AbpSession.ORG_NO;
                _initHelper.InitAdd(dto, AbpSession.USR_ID, AbpSession.ORG_NO, AbpSession.BG_NO);
                entity = dto.ToEntity();
                _wctReplyMstrRepository.Insert(entity);
            }
            else
            {
                _initHelper.InitUpdate(dto, AbpSession.USR_ID);
                entity = dto.ToEntity();
                _wctReplyMstrRepository.Update(entity);
            }
            rm.IsSuccess = true;

            return(rm);
        }
 /// <summary>
 /// 转换为数据传输对象
 /// </summary>
 /// <param name="entity">实体</param>
 public static WctReplyMstrDto ToDto(this WctReplyMstr entity)
 {
     if (entity == null)
     {
         return(new WctReplyMstrDto());
     }
     return(new WctReplyMstrDto {
         Id = entity.Id,
         REPLY_KEYWORD = entity.REPLY_KEYWORD,
         REPLY_CONTENT_TYPE = entity.REPLY_CONTENT_TYPE,
         REPLY_TEXT = entity.REPLY_TEXT,
         REPLY_ID_NO = entity.REPLY_ID_NO,
         REPLY_TYPE = entity.REPLY_TYPE,
         REPLY_DISPLAY_INDEX = entity.REPLY_DISPLAY_INDEX,
         CREATE_ORG_NO = entity.CREATE_ORG_NO,
         CREATE_PSN = entity.CREATE_PSN,
         CREATE_DATE = entity.CREATE_DATE,
         UPDATE_PSN = entity.UPDATE_PSN,
         UPDATE_DATE = entity.UPDATE_DATE,
         UDF1 = entity.UDF1,
         UDF2 = entity.UDF2,
         UDF3 = entity.UDF3,
         UDF4 = entity.UDF4,
         UDF5 = entity.UDF5,
         UDF6 = entity.UDF6,
         UDF7 = entity.UDF7,
         UDF8 = entity.UDF8,
         UDF9 = entity.UDF9,
         UDF10 = entity.UDF10,
         DEL_FLAG = entity.DEL_FLAG,
         MATERIAL_IDS = entity.MATERIAL_IDS,
         REPLY_STATUS = entity.REPLY_STATUS,
         MEDIA_ID = entity.MEDIA_ID,
         BG_NO = entity.BG_NO
     });
 }