Ejemplo n.º 1
0
 /// <summary>
 /// 保存实体数据(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键</param>
 /// <param name="entity">实体</param>
 public void SaveEntity(string keyValue, tc_IDCardEntity entity)
 {
     try
     {
         if (!string.IsNullOrEmpty(keyValue))
         {
             entity.Modify(keyValue);
             this.BaseRepository().Update(entity);
         }
         else
         {
             entity.Create();
             this.BaseRepository().Insert(entity);
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 保存实体数据(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键</param>
 /// <param name="entity">实体</param>
 /// <returns></returns>
 public void SaveEntity(string keyValue, tc_IDCardEntity tc_IDCardEntity)
 {
     try
     {
         iDCardService.SaveEntity(keyValue, tc_IDCardEntity);
     }
     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
     {
         tc_IDCardEntity entity = new tc_IDCardEntity()
         {
             F_IDCardId   = keyValue,
             F_DeleteMark = 1
         };
         this.BaseRepository().Update(entity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
     //var db = this.BaseRepository().BeginTrans();
     //try
     //{
     //    db.Delete<tc_IDCardEntity>(t => t.F_IDCardId == keyValue);
     //    db.Commit();
     //}
     //catch (Exception ex)
     //{
     //    db.Rollback();
     //    if (ex is ExceptionEx)
     //    {
     //        throw;
     //    }
     //    else
     //    {
     //        throw ExceptionEx.ThrowServiceException(ex);
     //    }
     //}
 }