Beispiel #1
0
        /// <summary>
        /// 更新合同信息信息
        /// </summary>
        /// <param name="inputDtos">包含更新信息的合同信息DTO信息</param>
        /// <returns>业务操作结果</returns>
        public OperationResult EditContractPays(params ContractPayInputDto[] inputDtos)
        {
            return(ContractPayRepository.Update(inputDtos,
                                                (dto, entity) => {
            },
                                                (dto, entity) => {
                if (dto.ContractId.HasValue && dto.ContractId.Value > 0)
                {
                    Contract contract = ContractRepository.GetByKey(dto.ContractId.Value);
                    if (contract == null)
                    {
                        throw new Exception("所属合同不存在");
                    }
                    contract.ContractPay = entity;
                    entity.Contract = contract;
                }
                else
                {
                    throw new Exception("没有归属合同");
                }

                return entity;
            }));
        }
Beispiel #2
0
 /// <summary>
 /// 检查信息是否存在
 /// </summary>
 /// <param name="predicate">检查谓语表达式</param>
 /// <param name="id">更新的信息编号</param>
 /// <returns>信息是否存在</returns>
 public bool CheckContractPayExists(Expression <Func <ContractPay, bool> > predicate, int id = 0)
 {
     return(ContractPayRepository.CheckExists(predicate, id));
 }
Beispiel #3
0
 /// <summary>
 /// 删除信息
 /// </summary>
 /// <param name="ids">要删除的编号</param>
 /// <returns>业务操作结果</returns>
 public OperationResult DeleteContractPays(params int[] ids)
 {
     return(ContractPayRepository.Delete(ids));
 }