コード例 #1
0
        /// <summary>
        /// Updates the vehicle schedule.
        /// </summary>
        /// <param name="vehicleSchedule">The vehicle schedule.</param>
        /// <returns>The updated vehicle schedule.</returns>
        public VehicleSchedule UpdateVehicleSchedule(VehicleSchedule vehicleSchedule)
        {
            var existingRoadSchedule = this.GetVehicleSchedule(vehicleSchedule.Id);

            if (existingRoadSchedule != null)
            {
                DataModelUpdater.UpdateVehicleSchedule(vehicleSchedule, ref existingRoadSchedule);
                this.context.Update(existingRoadSchedule);
                this.context.SaveChanges();
            }

            return(existingRoadSchedule);
        }
コード例 #2
0
        /// <summary>
        /// Updates the route schedule.
        /// </summary>
        /// <param name="routeSchedule">The route schedule.</param>
        /// <returns>The updated route schedule.</returns>
        public RouteSchedule UpdateRouteSchedule(RouteSchedule routeSchedule)
        {
            var existingRoadSchedule = this.GetRouteSchedule(routeSchedule.Id);

            if (existingRoadSchedule != null)
            {
                DataModelUpdater.UpdateRouteSchedule(routeSchedule, ref existingRoadSchedule);
                this.context.Update(existingRoadSchedule);
                this.context.SaveChanges();
            }

            return(existingRoadSchedule);
        }
コード例 #3
0
        /// <summary>
        /// Updates the operator.
        /// </summary>
        /// <param name="fleetOperator">The fleet operator.</param>
        public Operator UpdateOperator(Operator fleetOperator)
        {
            var existingOperator = this.context.Operators.FirstOrDefault(x => x.Id == fleetOperator.Id);

            if (existingOperator != null)
            {
                DataModelUpdater.UpdateOperator(fleetOperator, ref existingOperator);
                this.context.Update(existingOperator);
                this.context.SaveChanges();
            }

            return(existingOperator);
        }
コード例 #4
0
        /// <summary>
        /// Updates the drop-off point.
        /// </summary>
        /// <param name="dropOffPoint">The drop-off point .</param>
        /// <returns>The updated drop-off point.</returns>
        public DropOffPoint UpdateDropOffPoint(DropOffPoint dropOffPoint)
        {
            var existingDropOffPoint = this.GetDropOffPoint(dropOffPoint.Id);

            if (existingDropOffPoint != null)
            {
                DataModelUpdater.UpdateDropOffPoint(dropOffPoint, ref existingDropOffPoint);
                this.context.DropOffPoints.Update(existingDropOffPoint);
                this.context.SaveChanges();
            }

            return(existingDropOffPoint);
        }
コード例 #5
0
        /// <summary>
        /// Updates the route.
        /// </summary>
        /// <param name="route">The route.</param>
        /// <returns>The updated route.</returns>
        public Route UpdateRoute(Route route)
        {
            var existingRoute = this.GetRoute(route.Id);

            if (existingRoute != null)
            {
                DataModelUpdater.UpdateRoute(route, ref existingRoute);
                this.context.Routes.Update(existingRoute);
                this.context.SaveChanges();
            }

            return(existingRoute);
        }
コード例 #6
0
        /// <summary>
        /// Updates the pickup point.
        /// </summary>
        /// <param name="pickupPoint">The pickup point.</param>
        /// <returns>The updated pickup point.</returns>
        public PickupPoint UpdatePickupPoint(PickupPoint pickupPoint)
        {
            var existingPickupPoint = this.GetPickupPoint(pickupPoint.Id);

            if (existingPickupPoint != null)
            {
                DataModelUpdater.UpdatePickupPoint(pickupPoint, ref existingPickupPoint);
                this.context.PickupPoints.Update(existingPickupPoint);
                this.context.SaveChanges();
            }

            return(existingPickupPoint);
        }
コード例 #7
0
        /// <summary>
        /// Updates the user credential.
        /// </summary>
        /// <param name="userCredential">The user credential.</param>
        public UserCredential UpdateUserCredential(UserCredential userCredential)
        {
            var existingUserCredential = this.context.UserCredentials.FirstOrDefault(x => x.Id == userCredential.Id);

            if (existingUserCredential != null)
            {
                DataModelUpdater.UpdateUserCredentials(userCredential, ref existingUserCredential);
                this.context.UserCredentials.Update(existingUserCredential);
                this.context.SaveChanges();
            }

            return(existingUserCredential);
        }
コード例 #8
0
        /// <summary>
        /// Updates the booking office.
        /// </summary>
        /// <param name="bookingOffice">The booking office.</param>
        public BookingOffice UpdateBookingOffice(BookingOffice bookingOffice)
        {
            var existingBookingOffice = this.GetBookingOffice(bookingOffice.Id);

            if (existingBookingOffice != null)
            {
                DataModelUpdater.UpdateBookingOffice(bookingOffice, ref existingBookingOffice);
                this.context.BookingOffices.Update(existingBookingOffice);
                this.context.SaveChanges();
            }

            return(existingBookingOffice);
        }
コード例 #9
0
        /// <summary>
        /// Updates the waypoint.
        /// </summary>
        /// <param name="waypoint">The waypoint.</param>
        /// <returns>The updated waypoint.</returns>
        public Waypoint UpdateWaypoint(Waypoint waypoint)
        {
            var existingWaypoint = this.GetWaypoint(waypoint.Id);

            if (existingWaypoint != null)
            {
                DataModelUpdater.UpdateWaypoint(waypoint, ref existingWaypoint);
                this.context.Waypoints.Update(existingWaypoint);
                this.context.SaveChanges();
            }

            return(existingWaypoint);
        }
コード例 #10
0
        /// <summary>
        /// Updates the destination.
        /// </summary>
        /// <param name="destination">The destination.</param>
        public Destination UpdateDestination(Destination destination)
        {
            var existingDestination = this.GetDestination(destination.Id);

            if (existingDestination != null)
            {
                DataModelUpdater.UpdateDestination(destination, ref existingDestination);
                this.context.Destinations.Update(existingDestination);
                this.context.SaveChanges();
            }

            return(existingDestination);
        }
コード例 #11
0
        /// <summary>
        /// Updates the vehicle.
        /// </summary>
        /// <param name="vehicle">The vehicle.</param>
        public Vehicle UpdateVehicle(Vehicle vehicle)
        {
            var existingVehicleDetail = this.GetVehicle(vehicle.Id);

            if (existingVehicleDetail != null)
            {
                DataModelUpdater.UpdateVehicle(vehicle, ref existingVehicleDetail);
                this.context.Vehicles.Update(existingVehicleDetail);
                this.context.SaveChanges();
            }

            return(existingVehicleDetail);
        }
コード例 #12
0
        /// <summary>
        /// Updates the amenity.
        /// </summary>
        /// <param name="amenity">The amenity.</param>
        /// <returns>The updated amenity.</returns>
        public Amenity UpdateAmenity(Amenity amenity)
        {
            var existingAmenity = this.GetAmenity(amenity.Id);

            if (existingAmenity != null)
            {
                DataModelUpdater.UpdateAmenity(amenity, ref existingAmenity);
                this.context.Update(existingAmenity);
                this.context.SaveChanges();
            }

            return(existingAmenity);
        }
コード例 #13
0
        /// <summary>
        /// Updates the seat layout.
        /// </summary>
        /// <param name="seatLayout">The seat layout.</param>
        /// <returns>The updated seat layout.</returns>
        public SeatLayout UpdateSeatLayout(SeatLayout seatLayout)
        {
            var existingSeatLayout = this.GetSeatLayout(seatLayout.Id);

            if (existingSeatLayout != null)
            {
                DataModelUpdater.UpdateSeatLayout(seatLayout, ref existingSeatLayout);
                this.context.Update(existingSeatLayout);
                this.context.SaveChanges();
            }

            return(existingSeatLayout);
        }
コード例 #14
0
        /// <summary>
        /// Updates the seat class.
        /// </summary>
        /// <param name="seat class">The seat class.</param>
        /// <returns>The updated seat class.</returns>
        public SeatClass UpdateSeatClass(SeatClass seatClass)
        {
            var existingSeatClass = this.GetSeatClass(seatClass.Id);

            if (existingSeatClass != null)
            {
                DataModelUpdater.UpdateSeatClass(seatClass, ref existingSeatClass);
                this.context.Update(existingSeatClass);
                this.context.SaveChanges();
            }

            return(existingSeatClass);
        }