public class Package
{
///
/// Default constructor
///
public Package()
{
_LabelType = LabelType.FullLabel;
_LabelImageType = LabelImageType.TIF;
_ServiceType = ServiceType.First_Class;
}
private LabelType _LabelType;
///
/// Defines the type of Label to use for the package
///
public LabelType LabelType
{
get { return _LabelType; }
set { _LabelType = value; }
}
private Address _FromAddress = new Address();
///
/// An Address Object representing the address this package is being shipped from.
///
public Address FromAddress
{
get { return _FromAddress; }
set { _FromAddress = value; }
}
private Address _ToAddress = new Address();
///
/// An Address object representing the address this package is being shipped to.
///
public Address ToAddress
{
get { return _ToAddress; }
set { _ToAddress = value; }
}
private int _WeightInOunces = 0;
///
/// The weight, in ounces, this package weighs.
///
public int WeightInOunces
{
get { return _WeightInOunces; }
set { _WeightInOunces = value; }
}
private ServiceType _ServiceType;
///
/// The service that package is to be shipped.
///
public ServiceType ServiceType
{
get { return _ServiceType; }
set { _ServiceType = value; }
}
private bool _SeparateReceiptPage = false;
///
/// If True a separate reciept page will be generated along with the shipping label.
///
public bool SeparateReceiptPage
{
get { return _SeparateReceiptPage; }
set { _SeparateReceiptPage = value; }
}
private string _OriginZipcode = string.Empty;
///
/// The Zip code of where the package orginated. Used for the rating of this package.
///
public string OriginZipcode
{
get { return _OriginZipcode; }
set { _OriginZipcode = value; }
}
private LabelImageType _LabelImageType = LabelImageType.TIF;
///
/// The type of label to be printed for this package
///
public LabelImageType LabelImageType
{
get { return _LabelImageType; }
set { _LabelImageType = value; }
}
private DateTime _ShipDate = DateTime.Now;
///
/// The date this package will be shipped.
///
public DateTime ShipDate
{
get { return _ShipDate; }
set { _ShipDate = value; }
}
private string _ReferenceNumber = "";
///
/// Customer reference number which will be printed on the shipping label.
///
public string ReferenceNumber
{
get { return _ReferenceNumber; }
set { _ReferenceNumber = value; }
}
private bool _AddressServiceRequested = false;
///
/// If True the package's destination address will be check to ensure it is a valid address
///
public bool AddressServiceRequested
{
get { return _AddressServiceRequested; }
set { _AddressServiceRequested = value; }
}
private byte[] _ShippingLabel;
///
/// The actual shipping label image in it's raw byte array form.
///
public byte[] ShippingLabel
{
get { return _ShippingLabel; }
set { _ShippingLabel = value; }
}
private PackageType _PackageType;
///
/// The package type which is being shipped/
///
public PackageType PackageType
{
get { return _PackageType; }
set { _PackageType = value; }
}
private PackageSize _PackageSize;
///
/// The size of the package being shipped.
///
public PackageSize PackageSize
{
get { return _PackageSize; }
set { _PackageSize = value; }
}
}
public enum PackageType { None, Flat_Rate_Envelope, Flat_Rate_Box };
public enum PackageSize { None, Regular, Large, Oversize };
public enum LabelImageType { TIF, PDF, None };
public enum ServiceType { Priority, First_Class, Parcel_Post, Bound_Printed_Matter, Media_Mail, Library_Mail };
public enum LabelType { FullLabel = 1, DeliveryConfirmationBarcode = 2 };