Exemplo n.º 1
0
        /// <summary>
        /// 更新业务信息
        /// </summary>
        /// <param name="inputDtos"></param>
        /// <returns></returns>
        public async Task <OperationResult> Update(params BusinessNodeInputDto[] inputDtos)
        {
            inputDtos.CheckNotNull("inputDtos");
            foreach (BusinessNodeInputDto dtoData in inputDtos)
            {
                if (string.IsNullOrEmpty(dtoData.BusinessName))
                {
                    return(new OperationResult(OperationResultType.Error, "请正确填写业务名称,业务名称不能为空。"));
                }
                if (BusinessNodeRepository.CheckExists(x => x.BusinessName == dtoData.BusinessName && x.Id != dtoData.Id))
                {
                    return(new OperationResult(OperationResultType.Error, $"业务点名称 {dtoData.BusinessName} 的数据已被使用,请使用其他名称。"));
                }
            }
            var result = await BusinessNodeRepository.UpdateAsync(inputDtos);

            return(result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 检查业务点信息是否存在
 /// </summary>
 /// <param name="predicate">检查谓语表达式</param>
 /// <param name="id">更新的业务点编号</param>
 /// <returns>业务点数据是否存在</returns>
 public bool CheckBusinessNodeExists(Expression <Func <BusinessNode, bool> > predicate, Guid id) => BusinessNodeRepository.CheckExists(predicate, id);