/// <summary> /// 保存 /// </summary> /// <param name="keyValue">主键</param> /// <param name="functionEntity">功能信息</param> /// <param name="functionSchemeEntity">功能模板信息</param> public void SaveEntity(string keyValue, FunctionEntity functionEntity, FunctionSchemeEntity functionSchemeEntity) { try { functionSerivce.SaveEntity(keyValue, functionEntity, functionSchemeEntity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } }
/// <summary> /// 保存 /// </summary> /// <param name="keyValue">主键</param> /// <param name="functionEntity">功能信息</param> /// <param name="functionSchemeEntity">功能模板信息</param> public void SaveEntity(string keyValue, FunctionEntity functionEntity, FunctionSchemeEntity functionSchemeEntity) { IRepository db = new RepositoryFactory().BaseRepository().BeginTrans(); try { #region 模板信息 if (string.IsNullOrEmpty(functionEntity.F_SchemeId)) { functionSchemeEntity.Create(); db.Insert(functionSchemeEntity); functionEntity.F_SchemeId = functionSchemeEntity.F_Id; } else { functionSchemeEntity.Modify(functionEntity.F_SchemeId); db.Update(functionSchemeEntity); } #endregion if (string.IsNullOrEmpty(keyValue)) { functionEntity.Create(); db.Insert(functionEntity); } else { functionEntity.Modify(keyValue); db.Update(functionEntity); } db.Commit(); } catch (Exception ex) { db.Rollback(); if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }