/// <summary>
        /// 新增保险续保/门店宣传
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public StoreAdvertiseMstr InsertAdvertise(StoreAdvertiseMstrDto dto)
        {
            StoreAdvertiseMstr mstr = null;

            try
            {
                if (!EnableStoreAdvertiseList(Convert.ToInt32(dto.ADVERTISE_CATEGORY)))
                {
                    return(null);
                }

                if (string.IsNullOrEmpty(dto.Id))
                {
                    //新增
                    dto.Id = Guid.NewGuid().ToString("N");
                    _initHelper.InitAdd(dto, AbpSession.USR_ID, AbpSession.ORG_NO, AbpSession.BG_NO);
                    mstr = _storeAdvertiseMstrRepository.Insert(dto.ToEntity());
                }
                else
                {
                    //修改
                    _initHelper.InitUpdate(dto, AbpSession.USR_ID);
                    mstr = _storeAdvertiseMstrRepository.Update(dto.ToEntity());
                }
                return(mstr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
 public ActionResult InsertAdvertise([FromBody] StoreAdvertiseMstrDto dto)
 {
     try
     {
         var result = _storeAdvertiseMstrService.InsertAdvertise(dto);
         if (result == null)
         {
             return(Fail("保存失败"));
         }
         return(Success("保存成功", result));
     }
     catch (Exception ex)
     {
         return(Fail("保存失败:" + ex.Message));
     }
 }