Ejemplo n.º 1
0
 public bool UpdateMeasurement(MeasurementUpdateRequest request)
 {
     return(_measurementRepository.UpdateMeasurement(new Measurement
     {
         Id = request.Id,
         MeasurementPointId = request.MeasurementPointId,
         ShopId = request.ShopId,
         VehicleId = request.VehicleId,
         Date = request.Date,
         Flush = request.Flush,
         Gap = request.Gap
     }));
 }
Ejemplo n.º 2
0
 public IActionResult Create([FromBody] MeasurementRequest request)
 {
     CreateMeasures(request.Measurements);
     foreach (var reqMeasurement in request.Measurements)
     {
         var measurement = new Measurement
         {
             UserId    = CurrentUserId,
             MeasureId = reqMeasurement.MeasureId.Value,
             Time      = request.Time,
             Value     = reqMeasurement.Value
         };
         if (reqMeasurement.MeasurementId.HasValue)
         {
             measurement.Id = reqMeasurement.MeasurementId.Value;
             measurementRepository.UpdateMeasurement(measurement);
         }
         else
         {
             measurementRepository.CreateMeasurement(measurement);
         }
     }
     return(Ok());
 }
Ejemplo n.º 3
0
 public void UpdateMeasurement(string userId, MeasurementDto measurementDto)
 {
     _repository.UpdateMeasurement(userId, measurementDto);
 }