/// <summary> /// 保存实体数据(新增、修改) /// <param name="keyValue">主键</param> /// <summary> /// <returns></returns> public void SaveEntity(string keyValue, F_Base_BlackListEntity 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); } } }
/// <summary> /// 将人员添加到黑名单 /// <param name="keyValue">主键</param> /// <summary> /// <returns></returns> public void AddBlack(string keyValue, F_Base_BlackListEntity entity) { try { tempUserService.AddBlack(keyValue, entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } }
/// <summary> /// 保存实体数据(新增、修改) /// <param name="keyValue">主键</param> /// <summary> /// <returns></returns> public void SaveEntity(string keyValue, F_Base_BlackListEntity entity) { try { blackService.SaveEntity(keyValue, entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } }
/// <summary> /// 将临时工添加到黑名单 /// <param name="keyValue">主键</param> /// <summary> /// <returns></returns> public void AddBlack(string keyValue, F_Base_BlackListEntity entity) { try { entity.Create(); entity.F_TempUserId = keyValue; //如果将用户加入黑名单,同时该用户在用户表中代表无效状态 this.BaseRepository().ExecuteBySql("UPDATE LR_Base_TempUser SET F_EnabledMark=0 WHERE F_UserId='" + keyValue + "'"); //往黑名单表中插入一条记录 this.BaseRepository().Insert(entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }