public static PostAssetRequest BuildTruckWithAlarm(PostAssetRequest loadRequest) { PostAssetOperation loadOperation = loadRequest.postAssetOperations[0]; var load = loadOperation.Item as Shipment; var equipment = new Equipment { origin = new Place { Item = load.origin.Item }, destination = new EquipmentDestination { Item = new Place { Item = load.destination.Item } }, equipmentType = load.equipmentType }; Availability availability = loadOperation.availability; Dimensions dimensions = loadOperation.dimensions; var alarm = new AlarmSearchCriteria { ageLimitMinutes = 90, originRadius = new Mileage { method = MileageType.Road, miles = 50 }, destinationRadius = new Mileage { method = MileageType.Road, miles = 50 } }; var operation = new PostAssetOperation { availability = availability, alarm = alarm, count = loadOperation.count, countSpecified = true, dimensions = dimensions, Item = equipment, includeAsset = true, includeAssetSpecified = true }; if (loadOperation.stopsSpecified) { operation.stops = loadOperation.stops; operation.stopsSpecified = true; } if (loadOperation.ltlSpecified) { operation.ltl = loadOperation.ltl; operation.ltlSpecified = true; } return(new PostAssetRequest { postAssetOperations = new[] { operation } }); }
public static PostAssetRequest BuildLoad(DateTime when) { string refId = when.Millisecond.ToString(); var shipment = new Shipment { destination = new Place { Item = Destination }, equipmentType = EquipmentType.Flatbed, origin = new Place { Item = Origin }, rate = new ShipmentRate { baseRateDollars = 1700, rateBasedOn = RateBasedOnType.Flat, rateMiles = 951, rateMilesSpecified = true }, truckStops = new TruckStops { enhancements = new[] { TruckStopVideoEnhancement.Flash, TruckStopVideoEnhancement.Highlight }, Item = new ClosestTruckStops(), posterDisplayName = "12345" } }; var postAssetOperation = new PostAssetOperation { availability = new Availability { earliest = GetEarliestAvailability(when), earliestSpecified = true, latest = GetLatestAvailability(when), latestSpecified = true }, comments = new[] { "Call Now!" }, count = 1, countSpecified = true, dimensions = new Dimensions { heightInches = 48, heightInchesSpecified = true, lengthFeet = 30, lengthFeetSpecified = true, volumeCubicFeet = 0, volumeCubicFeetSpecified = false, weightPounds = 45000, weightPoundsSpecified = true }, includeAsset = true, includeAssetSpecified = true, Item = shipment, ltl = true, ltlSpecified = true, postersReferenceId = refId, stops = 0, stopsSpecified = true }; return(new PostAssetRequest { postAssetOperations = new[] { postAssetOperation } }); }