예제 #1
0
 /// <summary>
 /// 保存(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="newsEntity">新闻公告实体</param>
 /// <returns></returns>
 public void SaveEntity(string keyValue, NewsEntity newsEntity)
 {
     try
     {
         newsService.SaveEntity(keyValue, newsEntity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowBusinessException(ex);
         }
     }
 }
예제 #2
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="keyValue">主键</param>
 public void DeleteEntity(string keyValue)
 {
     try
     {
         NewsEntity entity = new NewsEntity()
         {
             F_NewsId = keyValue,
         };
         this.BaseRepository().Delete(entity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }