public void CreateOutboundLDM(OutboundFlight outboundFlight, LDMDTO dto)
        {
            var outboundLoadDistributionMessage = this.mapper.Map <LoadDistributionMessage>(dto);

            this.dbContext.LoadDistributionMessages.Add(outboundLoadDistributionMessage);
            this.dbContext.SaveChanges();

            outboundLoadDistributionMessage.OutboundFlight   = outboundFlight;
            outboundLoadDistributionMessage.OutboundFlightId = outboundFlight.FlightId;
            this.dbContext.SaveChanges();
        }
        public void CreateOutboundCPM(OutboundFlight outboundFlight, CPMDTO dto)
        {
            var outboundContainerPalletMessage = mapper.Map <ContainerPalletMessage>(dto);

            this.dbContext.ContainerPalletMessages.Add(outboundContainerPalletMessage);
            this.dbContext.SaveChanges();

            outboundContainerPalletMessage.OutboundFlight   = outboundFlight;
            outboundContainerPalletMessage.OutboundFlightId = outboundFlight.FlightId;
            outboundFlight.OutboundMessages.Add(outboundContainerPalletMessage);
            this.dbContext.SaveChanges();
        }
Ejemplo n.º 3
0
        public string IsAircraftOfACertainType(OutboundFlight flight)
        {
            string type = string.Empty;

            if (flight.Aircraft.Type.ToString() == "B763" || flight.Aircraft.Type.ToString() == "B788")
            {
                type = flight.Aircraft.Type.ToString();
            }
            else
            {
                return(null);
            }
            return(type);
        }
        public List <Container> AddContainersToOutboundFlight(OutboundFlight outbound, int amountOfOutboundContainersToCreate)
        {
            var listOfContainers = new List <Container>();

            for (int i = 0; i < amountOfOutboundContainersToCreate; i++)
            {
                var container = new Container
                {
                    OutboundFlight   = outbound,
                    OutboundFlightId = outbound.FlightId
                };
                listOfContainers.Add(container);
                this.dbContext.Containers.Add(container);
                this.dbContext.SaveChanges();
            }

            return(listOfContainers);
        }
        public void RegisterOutboundFlight(FlightInputModel outboundFlightInputModel)
        {
            string[] splitFlightNumbers =
                outboundFlightInputModel
                .FlightNumber
                .Split("/", StringSplitOptions.RemoveEmptyEntries);

            string outboundFlightNumber = splitFlightNumbers[1];

            var newOutboundFlight = new OutboundFlight
            {
                FlightNumber    = outboundFlightNumber,
                HandlingStation = outboundFlightInputModel.HandlingStation,
                BookedPAX       = outboundFlightInputModel.BookedPax,
                STD             = outboundFlightInputModel.STD,
                Destination     = outboundFlightInputModel.Destination
            };

            this.dbContext.OutboundFlights.Add(newOutboundFlight);
            this.dbContext.SaveChanges();
        }
Ejemplo n.º 6
0
        public void CreateDepartureMovement(DateTime[] dates, string supplementaryInformation, int totalPax, OutboundFlight outboundFlight)
        {
            var departureMovement = new DepartureMovement
            {
                OffBlockTime             = dates[0],
                TakeoffTime              = dates[1],
                SupplementaryInformation = supplementaryInformation,
                TotalPAX         = totalPax,
                OutboundFlightId = outboundFlight.FlightId,
                OutboundFlight   = outboundFlight,
                DateOfMovement   = DateTime.UtcNow
            };

            this.dbContext.DepartureMovements.Add(departureMovement);
            this.dbContext.SaveChanges();

            outboundFlight.DepartureMovementId = departureMovement.Id;
            this.dbContext.SaveChanges();
        }