/// <summary> /// 保存更新数据 /// </summary> /// <param name="keyValue">主键</param> /// <param name="entity">实体对象</param> public void SaveEntity(string keyValue, DemoleaveEntity entity) { try { if (string.IsNullOrEmpty(keyValue)) { entity.Create(); this.BaseRepository().Insert(entity); } else { entity.Modify(keyValue); this.BaseRepository().Update(entity); } } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }
/// <summary> /// 保存更新数据 /// </summary> /// <param name="keyValue">主键</param> /// <param name="entity">实体对象</param> public void SaveEntity(string keyValue, DemoleaveEntity entity) { try { demoleaveService.SaveEntity(keyValue, entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } }