Ejemplo n.º 1
0
 /// <summary>
 /// 保存自定义查询(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="custmerQueryEntity">实体</param>
 /// <returns></returns>
 public void SaveEntity(string keyValue, CustmerQueryEntity custmerQueryEntity)
 {
     try
     {
         if (!string.IsNullOrEmpty(keyValue))
         {
             custmerQueryEntity.Modify(keyValue);
             this.BaseRepository().Update(custmerQueryEntity);
         }
         else
         {
             custmerQueryEntity.Create();
             this.BaseRepository().Insert(custmerQueryEntity);
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除自定义查询条件
 /// </summary>
 /// <param name="keyValue">主键</param>
 public void DeleteEntity(string keyValue)
 {
     try
     {
         CustmerQueryEntity custmerQueryEntity = custmerQueryService.GetEntity(keyValue);
         string             key = cacheKey + custmerQueryEntity.F_ModuleUrl;
         if (!string.IsNullOrEmpty(custmerQueryEntity.F_UserId))
         {
             key += '_' + custmerQueryEntity.F_UserId;
         }
         custmerQueryService.DeleteEntity(keyValue);
         cache.Remove(key, CacheId.custmerQuery);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowBusinessException(ex);
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 删除自定义查询条件
 /// </summary>
 /// <param name="keyValue">主键</param>
 public void DeleteEntity(string keyValue)
 {
     try
     {
         CustmerQueryEntity entity = new CustmerQueryEntity()
         {
             F_CustmerQueryId = keyValue,
         };
         this.BaseRepository().Delete(entity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }