예제 #1
0
 /// <summary>
 /// 保存岗位(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="postEntity">岗位实体</param>
 /// <returns></returns>
 public void SaveEntity(string keyValue, PostEntity postEntity)
 {
     try
     {
         if (!string.IsNullOrEmpty(keyValue))
         {
             postEntity.Modify(keyValue);
             this.BaseRepository().Update(postEntity);
         }
         else
         {
             postEntity.Create();
             this.BaseRepository().Insert(postEntity);
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
예제 #2
0
        /// <summary>
        /// 虚拟删除
        /// </summary>
        /// <param name="keyValue">主键</param>
        public void VirtualDelete(string keyValue)
        {
            var db = this.BaseRepository().BeginTrans();

            try
            {
                PostEntity entity = new PostEntity()
                {
                    F_PostId     = keyValue,
                    F_DeleteMark = 1
                };
                db.Update(entity);
                db.ExecuteBySql(" Detete  From LR_BASE_USERRELATION where F_OBJECTID = @keyValue  ", new { keyValue = keyValue });

                //db.Delete<UserRelationEntity>(t=>t.F_ObjectId == keyValue);

                db.Commit();
            }
            catch (Exception ex)
            {
                db.Rollback();
                if (ex is ExceptionEx)
                {
                    throw;
                }
                else
                {
                    throw ExceptionEx.ThrowServiceException(ex);
                }
            }
        }
예제 #3
0
 /// <summary>
 /// 保存岗位(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="postEntity">岗位实体</param>
 /// <returns></returns>
 public void SaveEntity(string keyValue, PostEntity postEntity)
 {
     try
     {
         cache.Remove(cacheKey + postEntity.F_CompanyId, CacheId.post);
         postService.SaveEntity(keyValue, postEntity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowBusinessException(ex);
         }
     }
 }
예제 #4
0
 /// <summary>
 /// 虚拟删除
 /// </summary>
 /// <param name="keyValue">主键</param>
 public void VirtualDelete(string keyValue)
 {
     try
     {
         PostEntity entity = GetEntity(keyValue);
         cache.Remove(cacheKey + entity.F_CompanyId, CacheId.post);
         postService.VirtualDelete(keyValue);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowBusinessException(ex);
         }
     }
 }