/// <summary> /// 保存实体数据(新增、修改) /// <param name="keyValue">主键</param> /// <summary> /// <returns></returns> public void SaveEntity(int keyValue, dm_apply_partners_recordEntity entity) { try { if (keyValue > 0) { entity.Modify(keyValue); this.BaseRepository("dm_data").Update(entity); } else { entity.Create(); this.BaseRepository("dm_data").Insert(entity); } } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }
public void CheckAppPartnersRecord(dm_apply_partners_recordEntity entity) { IRepository db = null; try { if (entity.status == 1) { dm_apply_partners_recordEntity dm_Apply_Partners_RecordEntity = GetEntity(entity.id); dm_userEntity dm_UserEntity = new dm_userEntity(); dm_UserEntity.partnersstatus = 2; dm_UserEntity.partners = 20000 + dm_Apply_Partners_RecordEntity.user_id; dm_UserEntity.id = dm_Apply_Partners_RecordEntity.user_id; dm_Apply_Partners_RecordEntity.status = entity.status; db = this.BaseRepository("dm_data").BeginTrans(); db.Update(dm_UserEntity); entity.Modify(entity.id); db.Update(entity); db.Commit(); } } catch (Exception ex) { if (db != null) { db.Rollback(); } if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }