Class Shipment
Shipment contains information about the particular shipment. Line Items will reference the shipment object they belong to.
Implements
Inherited Members
Namespace: Mediachase.Commerce.Orders
Assembly: Mediachase.Commerce.dll
Version: 12.17.2Syntax
public class Shipment : OrderStorageBase, IXmlSerializable, IStorageObject, ICloneable, ISerializable, IShipment, IExtendedProperties, IShipmentDiscountAmount, IShipmentInventory, IShipmentCalculatedAmount
Constructors
Shipment()
Initializes a new instance of the Shipment class.
Declaration
public Shipment()
Shipment(SerializationInfo, StreamingContext)
Initializes a new instance of the Shipment class.
Declaration
protected Shipment(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The info. |
System.Runtime.Serialization.StreamingContext | context | The context. |
Properties
Discounts
Gets the discounts.
Declaration
public ShipmentDiscountCollection Discounts { get; }
Property Value
Type | Description |
---|---|
ShipmentDiscountCollection | The discounts. |
LazyILineItems
Declaration
protected IList<ILineItem> LazyILineItems { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<ILineItem> |
LineItemIndexes
Gets the line item indexes. This is a string collection of LineItem indexes in the LineItemCollection.
Declaration
public string[] LineItemIndexes { get; }
Property Value
Type | Description |
---|---|
System.String[] | The line item ids. |
LineItems
Gets the collection of line items
Declaration
public ICollection<ILineItem> LineItems { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<ILineItem> | The line items. |
MarketService
Declaration
public Injected<IMarketService> MarketService { get; set; }
Property Value
Type | Description |
---|---|
EPiServer.ServiceLocation.Injected<IMarketService> |
OperationKeys
Gets the inventory operation keys map.
Declaration
public IDictionary<int, IEnumerable<string>> OperationKeys { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.Int32, System.Collections.Generic.IEnumerable<System.String>> |
OperationKeysMap
Gets the mapping between line item index and operation keys
Declaration
public ConcurrentDictionary<int, IEnumerable<string>> OperationKeysMap { get; }
Property Value
Type | Description |
---|---|
System.Collections.Concurrent.ConcurrentDictionary<System.Int32, System.Collections.Generic.IEnumerable<System.String>> |
OrderFormId
Gets or sets the order form id.
Declaration
public int OrderFormId { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The order form id. |
OrderGroupId
Gets or sets the order group id.
Declaration
public int OrderGroupId { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The order group id. |
Parent
Gets the parent Order Form.
Declaration
public OrderForm Parent { get; }
Property Value
Type | Description |
---|---|
OrderForm | The parent. |
PickListId
Gets the pick list id.
Declaration
public int? PickListId { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> | The pick list id. |
PrevStatus
Gets or sets the previous status
Declaration
public string PrevStatus { get; set; }
Property Value
Type | Description |
---|---|
System.String | The state of the prev. |
ShipmentId
Gets the shipment id.
Declaration
public int ShipmentId { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The shipment id. |
ShipmentTrackingNumber
Gets or sets the shipment tracking number.
Declaration
public string ShipmentTrackingNumber { get; set; }
Property Value
Type | Description |
---|---|
System.String | The shipment tracking number. |
ShippingAddressId
Gets or sets the shipping address name.
Declaration
public string ShippingAddressId { get; set; }
Property Value
Type | Description |
---|---|
System.String | The shipping address id. |
ShippingCalculator
Declaration
public Injected<IShippingCalculator> ShippingCalculator { get; set; }
Property Value
Type | Description |
---|---|
EPiServer.ServiceLocation.Injected<IShippingCalculator> |
ShippingDiscountAmount
Gets or sets the shipping discount amount.
Declaration
public decimal ShippingDiscountAmount { get; set; }
Property Value
Type | Description |
---|---|
System.Decimal | The shipping discount amount. |
ShippingMethodId
Gets or sets the shipping method id.
Declaration
public Guid ShippingMethodId { get; set; }
Property Value
Type | Description |
---|---|
System.Guid | The shipping method id. |
ShippingMethodName
Gets or sets the name of the shipping method.
Declaration
public string ShippingMethodName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the shipping method. |
ShippingSubTotal
Declaration
public decimal ShippingSubTotal { get; set; }
Property Value
Type | Description |
---|---|
System.Decimal |
ShippingTax
Gets or sets the shipping tax.
Declaration
public decimal ShippingTax { get; set; }
Property Value
Type | Description |
---|---|
System.Decimal | The shipping tax. |
ShippingTotal
Gets the total shipping cost, including shipping discounts (if any) and shipping tax (if prices excludes tax).
Declaration
public decimal ShippingTotal { get; }
Property Value
Type | Description |
---|---|
System.Decimal | The shipping total. |
Status
Gets or sets the status.
Declaration
public string Status { get; set; }
Property Value
Type | Description |
---|---|
System.String | The status. |
SubTotal
Gets or sets the sub total.
Declaration
public decimal SubTotal { get; set; }
Property Value
Type | Description |
---|---|
System.Decimal | The sub total. |
WarehouseCode
Gets or sets the warehouse code
Declaration
public string WarehouseCode { get; set; }
Property Value
Type | Description |
---|---|
System.String | The warehouse code. |
Methods
AcceptChanges()
Accepts the changes.
Declaration
public override void AcceptChanges()
Overrides
AddInventoryOperationKey(Int32, IEnumerable<String>)
Adds the inventory operation key mapping.
Declaration
public void AddInventoryOperationKey(int lineItemIndex, IEnumerable<string> operationKeys)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | The line item index. |
System.Collections.Generic.IEnumerable<System.String> | operationKeys | The collection of operation keys. |
AddLineItemIndex(Int32)
Adds the index of the line item.
Declaration
public void AddLineItemIndex(int lineItemIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | Index of the line item. |
AddLineItemIndex(Int32, Decimal)
Adds the index of the line item.
Declaration
public void AddLineItemIndex(int lineItemIndex, decimal quantity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | Index of the line item. |
System.Decimal | quantity | The quantity. |
AddLineItemIndex(String)
Adds the index of the line item.
Declaration
public void AddLineItemIndex(string lineItemIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | lineItemIndex | Index of the line item. |
AddOperationKeys(ILineItem, IEnumerable<String>)
Adds the inventory operation keys map.
Declaration
public void AddOperationKeys(ILineItem lineItem, IEnumerable<string> operationKeys)
Parameters
Type | Name | Description |
---|---|---|
ILineItem | lineItem | The line item. |
System.Collections.Generic.IEnumerable<System.String> | operationKeys | A collection of operation keys. |
ClearOperationKeys()
Clears all inventory operation keys map.
Declaration
public void ClearOperationKeys()
ContainsOperationKeyFor(ILineItem)
Verifies inventory operation keys map with a line item.
Declaration
public bool ContainsOperationKeyFor(ILineItem lineItem)
Parameters
Type | Name | Description |
---|---|---|
ILineItem | lineItem |
Returns
Type | Description |
---|---|
System.Boolean |
DeepCloneImplementation()
Extends base implementation by handling LineItems and OperationKeysMap (resetting the collections to be rebuilt).
Declaration
protected override object DeepCloneImplementation()
Returns
Type | Description |
---|---|
System.Object | A new object that is a deep copy of the current instance. |
Overrides
Delete()
Deletes this instance.
Declaration
public override void Delete()
Overrides
GetClonedLineItemsForShipment(Shipment)
Gets the shipment line items with the correct quantities assigned for this shipment.
Declaration
public static List<LineItem> GetClonedLineItemsForShipment(Shipment shipment)
Parameters
Type | Name | Description |
---|---|---|
Shipment | shipment | The shipment. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<LineItem> |
Remarks
The lineitems were cloned. Setting their quantities does not change the actually quantities in the shipment.
GetInventoryOperationKey(Int32)
Gets operation keys by line item index.
Declaration
public IEnumerable<string> GetInventoryOperationKey(int lineItemIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | The line item index |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | A collection of operation keys corresponded with the line item index, empty list if no key found. |
GetLineItemQuantity(Shipment, Int32)
Gets the shipment line items.
Declaration
public static decimal GetLineItemQuantity(Shipment shipment, int lineItemId)
Parameters
Type | Name | Description |
---|---|---|
Shipment | shipment | The shipment. |
System.Int32 | lineItemId | The line item id. |
Returns
Type | Description |
---|---|
System.Decimal |
GetObjectData(SerializationInfo, StreamingContext)
Gets the object data.
Declaration
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The info. |
System.Runtime.Serialization.StreamingContext | context | The context. |
Overrides
GetOperationKeys(ILineItem)
Gets inventory operation keys by line item.
Declaration
public IEnumerable<string> GetOperationKeys(ILineItem lineItem)
Parameters
Type | Name | Description |
---|---|---|
ILineItem | lineItem | The line item. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | A collection of operation keys corresponded with the line item, empty list if no key found. |
GetShipmentLineItems(Shipment)
Gets the shipment line items.
Declaration
[Obsolete("This method is no longer used, as it might return the incorrect lineitem quantities. Use GetClonedLineItemsForShipment(shipment, lineItemId) which returns the correct quantities instead. Will remain at least until April 2019.")]
public static List<LineItem> GetShipmentLineItems(Shipment shipment)
Parameters
Type | Name | Description |
---|---|---|
Shipment | shipment | The shipment. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<LineItem> | LineItems in the specified shipment. Warning: LineItems' quantities returned by this method are incorrect. Need to call GetLineItemQuantity(Shipment, Int32) for every line item to get actual quantity. |
InsertOperationKeys(ILineItem, IEnumerable<String>)
Inserts inventory operation keys map with a line item.
Declaration
public bool InsertOperationKeys(ILineItem lineItem, IEnumerable<string> operationKeys)
Parameters
Type | Name | Description |
---|---|---|
ILineItem | lineItem | The line item. |
System.Collections.Generic.IEnumerable<System.String> | operationKeys | The collection of operation keys. |
Returns
Type | Description |
---|---|
System.Boolean |
InsertOperationKeys(Int32, IEnumerable<String>)
Inserts operation keys mapping with a line item index.
Declaration
public bool InsertOperationKeys(int lineItemIndex, IEnumerable<string> operationKeys)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | The line item index. |
System.Collections.Generic.IEnumerable<System.String> | operationKeys | The collection of operation keys. |
Returns
Type | Description |
---|---|
System.Boolean |
PopulateCollections(DataTableCollection, String)
Populates collections within table. The tables used will be removed from the table collection. Override this method to populate your custom collection objects.
Declaration
protected override void PopulateCollections(DataTableCollection tables, string filter)
Parameters
Type | Name | Description |
---|---|---|
System.Data.DataTableCollection | tables | The tables. |
System.String | filter | The filter. |
Overrides
ReadXml(XmlReader)
Generates an object from its XML representation.
Declaration
public override void ReadXml(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | The System.Xml.XmlReader stream from which the object is deserialized. |
Overrides
RemoveLineItemIndex(Int32)
Removes the index of the line item.
Declaration
public void RemoveLineItemIndex(int lineItemIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | Index of the line item. |
RemoveLineItemIndex(Int32, Decimal)
Removes the index of the line item.
Declaration
public void RemoveLineItemIndex(int lineItemIndex, decimal quantity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | Index of the line item. |
System.Decimal | quantity | The quantity. |
RemoveLineItemIndex(String)
Removes the index of the line item.
Declaration
public void RemoveLineItemIndex(string lineItemIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | lineItemIndex | Index of the line item. |
RemoveOperationKey(ILineItem, String)
Removes an inventory operation key map with a line item.
Declaration
public bool RemoveOperationKey(ILineItem lineItem, string operationKey)
Parameters
Type | Name | Description |
---|---|---|
ILineItem | lineItem | The line item. |
System.String | operationKey | The operation key. |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveOperationKey(Int32, String)
Removes an operation key mapping with a line item index.
Declaration
public bool RemoveOperationKey(int lineItemIndex, string operationKey)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | The line item index. |
System.String | operationKey | The operation key. |
Returns
Type | Description |
---|---|
System.Boolean |
SetLineItemQuantity(Int32, Decimal)
Declaration
public void SetLineItemQuantity(int lineItemIndex, decimal quantity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineItemIndex | |
System.Decimal | quantity |
SetParent(Object)
Sets the parent.
Declaration
public override void SetParent(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | The parent. |
Overrides
WriteXml(XmlWriter)
Converts an object into its XML representation.
Declaration
public override void WriteXml(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | The System.Xml.XmlWriter stream to which the object is serialized |
Overrides
Explicit Interface Implementations
IShipmentCalculatedAmount.IsShippingCostUpToDate
Gets or sets the flag indicating whether the ShippingCost is up-to-date.
Declaration
bool IShipmentCalculatedAmount.IsShippingCostUpToDate { get; set; }
Returns
Type | Description |
---|---|
System.Boolean |
IShipmentCalculatedAmount.IsShippingTaxUpToDate
Gets or sets the flag indicating whether the ShippingTax is up-to-date.
Declaration
bool IShipmentCalculatedAmount.IsShippingTaxUpToDate { get; set; }
Returns
Type | Description |
---|---|
System.Boolean |
IShipmentCalculatedAmount.ShippingCost
Gets or sets the shipping cost.
Declaration
decimal IShipmentCalculatedAmount.ShippingCost { get; set; }
Returns
Type | Description |
---|---|
System.Decimal |
IShipmentCalculatedAmount.ShippingTax
Gets or sets the shipping tax.
Declaration
decimal IShipmentCalculatedAmount.ShippingTax { get; set; }
Returns
Type | Description |
---|---|
System.Decimal |
IShipment.OrderShipmentStatus
Gets or sets the order shipment status.
Declaration
OrderShipmentStatus IShipment.OrderShipmentStatus { get; set; }
Returns
Type | Description |
---|---|
OrderShipmentStatus |
IShipment.ShippingAddress
Declaration
IOrderAddress IShipment.ShippingAddress { get; set; }
Returns
Type | Description |
---|---|
IOrderAddress |
IShipmentDiscountAmount.ShipmentDiscount
Gets or sets the shipment discount.
Declaration
decimal IShipmentDiscountAmount.ShipmentDiscount { get; set; }
Returns
Type | Description |
---|---|
System.Decimal |
IExtendedProperties.Properties
Gets the property bag for dealing with custom meta fields.
Declaration
Hashtable IExtendedProperties.Properties { get; }
Returns
Type | Description |
---|---|
System.Collections.Hashtable |