private LogisticsListDto PrepareLogisticsListDto(Logistics logistics) { var dto = ObjectMapper.Map <LogisticsListDto>(logistics); dto.Prefix = CommonHelper.ChangeByName(dto.Name.Substring(0, 1)); if (dto.Prefix.IsNullOrWhiteSpace()) { dto.Prefix = logistics.Memo?.Substring(0, 1) ?? string.Empty; } return(dto); }
public async Task <EntityDto <long> > CreateOrUpdateLogistics(CreateOrUpdateLogisticsInput input) { Logistics logistics = null; if (input.Id.HasValue && input.Id.Value > 0) { logistics = await UpdateLogisticsAsync(input); } else { logistics = await CreateLogisticsAsync(input); } await CurrentUnitOfWork.SaveChangesAsync(); return(new EntityDto <long> { Id = logistics.Id }); }
/// <summary> /// 更新物流 /// </summary> /// <param name="logistics"></param> public virtual async Task UpdateAsync(Logistics logistics) { await LogisticsRepository.UpdateAsync(logistics); }
/// <summary> /// 删除物流 /// </summary> /// <param name="logistics"></param> public virtual async Task DeleteAsync(Logistics logistics) { await LogisticsRepository.DeleteAsync(logistics); }
/// <summary> /// 添加物流 /// </summary> /// <param name="logistics"></param> public virtual async Task CreateAsync(Logistics logistics) { await LogisticsRepository.InsertAsync(logistics); }