Пример #1
0
        public async Task <PopularResult <string> > UpdateAsync(VehicleMileageDto dto)
        {
            var result = new PopularResult <string>();

            dto.Vehicle = null;
            var vehicleMileage = ObjectMapper.Map <VehicleMileageDto, VehicleMileageEntity>(dto);
            await _vehicleMileageRepository.UpdateAsync(vehicleMileage);

            result.Success("更新成功");
            return(result);
        }
Пример #2
0
        public async Task <PopularResult <string> > InsertAsync(VehicleMileageDto dto)
        {
            var result         = new PopularResult <string>();
            var entity         = ObjectMapper.Map <VehicleMileageDto, VehicleMileageEntity>(dto);
            var vehicleMileage = await _vehicleMileageRepository.InsertAsync(entity);

            if (vehicleMileage == null)
            {
                result.Failed("添加失败");
                return(result);
            }
            result.Success("添加成功");
            return(result);
        }
Пример #3
0
 public async Task <PopularResult <string> > UpdateAsync([FromBody] VehicleMileageDto dto)
 {
     return(await _vehicleMileageService.UpdateAsync(dto));
 }
Пример #4
0
 public async Task <PopularResult <string> > InsertAsync([FromBody] VehicleMileageDto dto)
 {
     dto.Creator    = LoginUser.Id;
     dto.CreateTime = LoginUser.SysteDate;
     return(await _vehicleMileageService.InsertAsync(dto));
 }