/// <summary> /// 更新合同级别信息 /// </summary> /// <param name="inputDtos">包含更新信息的合同信息DTO信息</param> /// <returns>业务操作结果</returns> public OperationResult EditContractLevels(params ContractLevelInputDto[] inputDtos) { return(ContractLevelRepository.Update(inputDtos, (dto, entity) => { if (ContractLevelRepository.CheckExists(cl => cl.Name == dto.Name && cl.InitalFee == dto.InitalFee)) { throw new Exception("合同级别:{0},已经存在,不能重复添加"); } }, (dto, entity) => { return entity; })); }
/// <summary> /// 删除合同级别信息 /// </summary> /// <param name="ids">要删除的合同信息编号</param> /// <returns>业务操作结果</returns> public OperationResult DeleteContractLevels(params int[] ids) { return(ContractLevelRepository.Delete(ids)); }
/// <summary> /// 检查合同级别信息是否存在 /// </summary> /// <param name="predicate">检查谓语表达式</param> /// <param name="id">更新的合同信息编号</param> /// <returns>合同信息是否存在</returns> public bool CheckContractLevelExists(Expression <Func <ContractLevel, bool> > predicate, int id = 0) { return(ContractLevelRepository.CheckExists(predicate, id)); }