Ok, I cant send you the actual code as we have some proprietary calculations in this class. But in the RTSHipping class below is the code ive added/modified. See if this gets you started, feel free to post back here with any questions and ill help as best I can.
Code:
//created a local variable to figure out total num of packages based on 70lb weight break
int numPackages = (int)Math.Ceiling(ShipmentWeight / 70);
//kill this array that was based on Shipment.Count
//rateRequest.Shipment.Package = new ups2.ShipmentPackage[Shipment.Count];
//create this array based on what I determined total package count to be
rateRequest.Shipment.Package = new ups2.ShipmentPackage[numPackages];
//set a local variable remainingWeight to total weight
decimal remainingWeight = ShipmentWeight;
//down below turn the foreach loop into a while using our numPackages as the control variable
// foreach (RTShipping.Package p in Shipment)
while (numPackages > 0)
//right here check if our remaining weight is under our break point, if so set this package to that weight and kill the numPackages control variable
// package weight
if (remainingWeight <= 70)
{
upsPackage.PackageWeight.Weight = remainingWeight;
numPackages = 0;
} else
{
//remainingWeight was over 70, set this package to 70, reduce remainingWeight and reduce numPackages by 1
upsPackage.PackageWeight.Weight = 70;
remainingWeight -= 70;
numPackages--;
}
//upsPackage.PackageWeight.Weight = p.Weight;