Exemple #1
0
        /// <summary>
        /// 保存微信菜单信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ReturnMsg SaveWxMenuInfo(WctMenuMstrDto dto)
        {
            var rm     = new ReturnMsg();
            var entity = new WctMenuMstr();
            var isOk   = CheckWxMenuInfo(dto, rm);

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

            return(rm);
        }
Exemple #2
0
 /// <summary>
 /// 转换为数据传输对象
 /// </summary>
 /// <param name="entity">实体</param>
 public static WctMenuMstrDto ToDto(this WctMenuMstr entity)
 {
     if (entity == null)
     {
         return(new WctMenuMstrDto());
     }
     return(new WctMenuMstrDto {
         Id = entity.Id,
         MENU_ID_NO = entity.MENU_ID_NO,
         MENU_NAME = entity.MENU_NAME,
         MENU_KEY = entity.MENU_KEY,
         MENU_TYPE = entity.MENU_TYPE,
         MENU_LEVEL = entity.MENU_LEVEL,
         MENU_DISPLAYINDEX = entity.MENU_DISPLAYINDEX,
         MENU_MATERIALTYPEID = entity.MENU_MATERIALTYPEID,
         MENU_PARENTID = entity.MENU_PARENTID,
         MENU_TEXT = entity.MENU_TEXT,
         MENU_MENUURL = entity.MENU_MENUURL,
         MENU_MODULEID = entity.MENU_MODULEID,
         MENU_PAGEPARAMJSON = entity.MENU_PAGEPARAMJSON,
         MENU_ISAUTH = entity.MENU_ISAUTH,
         MENU_STATUS = entity.MENU_STATUS,
         MENU_BELINKEDTYPE = entity.MENU_BELINKEDTYPE,
         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,
         MEDIA_ID = entity.MEDIA_ID,
         BG_NO = entity.BG_NO,
         MENU_ISSECOND = entity.MENU_ISSECOND,
         MENU_APPLET_ID = entity.MENU_APPLET_ID,
         MENU_APPLET_APP_ID = entity.MENU_APPLET_APP_ID
     });
 }