Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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
            });
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新物流
 /// </summary>
 /// <param name="logistics"></param>
 public virtual async Task UpdateAsync(Logistics logistics)
 {
     await LogisticsRepository.UpdateAsync(logistics);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 删除物流
 /// </summary>
 /// <param name="logistics"></param>
 public virtual async Task DeleteAsync(Logistics logistics)
 {
     await LogisticsRepository.DeleteAsync(logistics);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 添加物流
 /// </summary>
 /// <param name="logistics"></param>
 public virtual async Task CreateAsync(Logistics logistics)
 {
     await LogisticsRepository.InsertAsync(logistics);
 }