/// <summary> /// 更新某个TrialDetailGroup信息 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <Guid> UpdateTrialDetailGroup(TrialDetailGroupDto input) { var role = await _trialDetailGroupRepository.GetAsync(input.Id.GetValueOrDefault()); role.TrialId = input.TrialId; role.GroupOrder = input.GroupOrder; role.BaseInfo = input.BaseInfo; role.TrialParam = input.TrialParam; role.TrialResultOne = input.TrialResultOne; role.TrialResultTwo = input.TrialResultTwo; role.Remark = input.Remark; return(role.Id); }
/// <summary> /// 添加TrialDetailGroup /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <Guid> AddTrialDetailGroup(TrialDetailGroupDto input) { var role = new TrialDetailGroup { TrialId = input.TrialId, GroupOrder = input.GroupOrder, BaseInfo = input.BaseInfo, TrialParam = input.TrialParam, TrialResultOne = input.TrialResultOne, TrialResultTwo = input.TrialResultTwo, Remark = input.Remark }; await _trialDetailGroupRepository.InsertAsync(role); return(role.Id); }
/// <summary> /// 获取TrialDetailGroup /// </summary> /// <param name="input"></param> /// <returns></returns> public List <TrialDetailGroupDto> GetTrialDetailGroups(TrialDetailGroupDto input) { return(_trialDetailGroupRepository .AsNoTracking() .WhereIf(input.Id.HasValue, x => x.Id == input.Id) //.WhereIf(!string.IsNullOrEmpty(input.Name), x => x.Name == input.Name) .WhereIf(input.TrialId.HasValue, x => x.TrialId == input.TrialId) .WhereIf(input.GroupOrder.HasValue, x => x.GroupOrder == input.GroupOrder) .WhereIf(input.BaseInfo.HasValue, x => x.BaseInfo == input.BaseInfo) .WhereIf(input.TrialParam.HasValue, x => x.TrialParam == input.TrialParam) .WhereIf(input.TrialResultOne.HasValue, x => x.TrialResultOne == input.TrialResultOne) .WhereIf(input.TrialResultTwo.HasValue, x => x.TrialResultTwo == input.TrialResultTwo) .OrderBy(p => p.CreationTime) .ProjectTo <TrialDetailGroupDto>(Configuration) .ToList()); }