Exemplo n.º 1
0
        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 });
            }
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        public IHttpActionResult GetNewAirport()
        {
            AirportDataDO airportData = new AirportDataDO();

            return Ok(airportData);
        }