public async Task <ActionResult> CorrectWagonsList(CorrectMsg correctMsg) { var vagons = JsonSerializer.Deserialize <List <VagonModel> >(correctMsg.VagonsInfo); await _trainRepository.CorrectVagons(correctMsg.TrainIndex, vagons, correctMsg.DatOper, station); return(Ok()); }
public async Task <ActionResult> DetachWagons(CorrectMsg correctMsg) { var vagons = JsonSerializer.Deserialize <List <VagonModel> >(correctMsg.VagonsInfo); var wagonNums = vagons.Select(w => w.Num).ToList(); var trainId = _trainRepository.FindTrain(correctMsg.TrainIndex).Result.Uid; await wagonOperationsService.AddWagonOperations(trainId, OperationCode.DetachWagons, wagonNums, correctMsg.DatOper, station); return(Ok()); }