public IHttpActionResult PostAirport(AirportDataDO airportData) { using (var transaction = this.unitOfWork.BeginTransaction()) { var newLot = this.lotRepository.CreateLot("Airport"); var partVersion = newLot.CreatePart("airportData", airportData, this.userContext); int airportCaseTypeId = this.caseTypeRepository.GetCaseTypesForSet("Airport").Single().GvaCaseTypeId; this.caseTypeRepository.AddCaseTypes(newLot, new int[] { airportCaseTypeId }); newLot.Commit(this.userContext, lotEventDispatcher); this.unitOfWork.Save(); this.lotRepository.ExecSpSetLotPartTokens(partVersion.PartId); transaction.Commit(); return Ok(new { id = newLot.LotId }); } }
public IHttpActionResult PostAirportData(int lotId, AirportDataDO airportData) { using (var transaction = this.unitOfWork.BeginTransaction()) { var lot = this.lotRepository.GetLotIndex(lotId); var partVersion = lot.UpdatePart("airportData", airportData, this.userContext); lot.Commit(this.userContext, this.lotEventDispatcher); this.unitOfWork.Save(); this.lotRepository.ExecSpSetLotPartTokens(partVersion.PartId); transaction.Commit(); return Ok(); } }
public IHttpActionResult GetNewAirport() { AirportDataDO airportData = new AirportDataDO(); return Ok(airportData); }