Ejemplo n.º 1
0
        public async Task <IActionResult> PutVoyageSlotToken([FromRoute] long id, [FromBody] VoyageSlotToken voyageSlotToken)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != voyageSlotToken.VoyageSlotTokenId)
            {
                return(BadRequest());
            }

            _context.Entry(voyageSlotToken).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VoyageSlotTokenExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutCarrierEmployee([FromRoute] long id, [FromBody] CarrierEmployee carrierEmployee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != carrierEmployee.UserId)
            {
                return(BadRequest());
            }

            _context.Entry(carrierEmployee).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CarrierEmployeeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutPort([FromRoute] long id, [FromBody] Port port)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != port.PortId)
            {
                return(BadRequest());
            }

            _context.Entry(port).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PortExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutSlotTokenSellOrder([FromRoute] long id, [FromBody] SlotTokenSellOrder slotTokenSellOrder)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != slotTokenSellOrder.SlotTokenSellOrderId)
            {
                return(BadRequest());
            }

            _context.Entry(slotTokenSellOrder).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SlotTokenSellOrderExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutContainerYardLocation([FromRoute] long id, [FromBody] ContainerYardLocation containerYardLocation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != containerYardLocation.ContainerYardLocationId)
            {
                return(BadRequest());
            }

            _context.Entry(containerYardLocation).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ContainerYardLocationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutShipmentJob([FromRoute] long id, [FromBody] ShipmentJob shipmentJob)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != shipmentJob.ShipmentJobId)
            {
                return(BadRequest());
            }

            _context.Entry(shipmentJob).State = EntityState.Modified;
            _context.TransactionHistory.Add(new TransactionHistory
            {
                Id          = shipmentJob.ShipmentJobId + 20000,
                Date        = DateTime.Now.ToLongTimeString(),
                Identity    = shipmentJob.Carrier,
                Participant = shipmentJob.Carrier,
                Transaction = "PutShipmentJob"
            });

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ShipmentJobExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutOrganisation([FromRoute] long id, [FromBody] Organisation organisation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != organisation.OrganisationId)
            {
                return(BadRequest());
            }

            _context.Entry(organisation).State = EntityState.Modified;
            _context.TransactionHistory.Add(new TransactionHistory
            {
                Id          = organisation.OrganisationId + 50000,
                Date        = DateTime.Now.ToLongTimeString(),
                Identity    = organisation.OrganisationId.ToString(),
                Participant = organisation.OrganisationId.ToString(),
                Transaction = "PutOrganisation"
            });

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OrganisationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutSlotTokenBuyOrder([FromRoute] long id, [FromBody] SlotTokenBuyOrder slotTokenBuyOrder)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != slotTokenBuyOrder.SlotTokenBuyOrderId)
            {
                return(BadRequest());
            }

            _context.Entry(slotTokenBuyOrder).State = EntityState.Modified;
            _context.TransactionHistory.Add(new TransactionHistory
            {
                Id          = slotTokenBuyOrder.SlotTokenBuyOrderId + 70000,
                Date        = DateTime.Now.ToLongTimeString(),
                Identity    = slotTokenBuyOrder.LastModifiedByUser,
                Participant = slotTokenBuyOrder.LastModifiedByUser,
                Transaction = "PutSlotTokenBuyOrder"
            });
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SlotTokenBuyOrderExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }