/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }