November Happy Hour will be moved to Thursday December 5th.

Class PurchaseOrder

Purchase Order is the actual recorded sale.

Inheritance
System.Object
PurchaseOrder
Implements
System.Xml.Serialization.IXmlSerializable
System.ICloneable
System.Runtime.Serialization.ISerializable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Orders
Assembly: Mediachase.Commerce.dll
Version: 12.17.2
Syntax
public class PurchaseOrder : OrderGroup, IXmlSerializable, IStorageObject, ICloneable, ISerializable, IOrderGroupCalculatedAmount, IPurchaseOrder, IOrderGroup, IExtendedProperties, IDeepCloneable

Constructors

PurchaseOrder()

Initializes a new instance of the PurchaseOrder class.

Declaration
protected PurchaseOrder()

PurchaseOrder(IDataReader)

Internal constructor required by collection implementation.

Declaration
public PurchaseOrder(IDataReader reader)
Parameters
Type Name Description
System.Data.IDataReader reader

The reader.

PurchaseOrder(Guid)

Initializes a new instance of the PurchaseOrder class.

Declaration
public PurchaseOrder(Guid customerId)
Parameters
Type Name Description
System.Guid customerId

The customer id.

PurchaseOrder(SerializationInfo, StreamingContext)

Initializes a new instance of the PurchaseOrder class.

Declaration
protected PurchaseOrder(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

The info.

System.Runtime.Serialization.StreamingContext context

The context.

Properties

ExchangeOrderNumberMethod

Declaration
public Func<OrderGroup, string> ExchangeOrderNumberMethod { get; set; }
Property Value
Type Description
System.Func<OrderGroup, System.String>

ExpirationDate

Gets or sets the expiration date. Expiration date can be used for subscription type of orders.

Declaration
public DateTime ExpirationDate { get; set; }
Property Value
Type Description
System.DateTime

The expiration date.

ParentOrderGroupId

Gets or sets the parent order group id. This can be used to relate purchase orders to a payment plan or other order.

Declaration
public int ParentOrderGroupId { get; set; }
Property Value
Type Description
System.Int32

The parent order group instance id.

ReturnOrderForms

Gets the rma request list.

Declaration
public OrderFormCollection ReturnOrderForms { get; }
Property Value
Type Description
OrderFormCollection

The rma request list.

TrackingNumber

Gets or sets the tracking number. Automatically generated or can be generated using provided function.

Declaration
public string TrackingNumber { get; set; }
Property Value
Type Description
System.String

The tracking number.

Methods

AcceptChanges()

Accepts the changes.

Declaration
public override void AcceptChanges()
Overrides

AddLineItemToFirstShipmentInOrder(Int32, Decimal)

Adds the line item to first shipment in order.

Declaration
[Obsolete("This method is no longer used. Use order abstraction APIs to manage lineitems and shipments. Will remain at least until December 2019.")]
public virtual void AddLineItemToFirstShipmentInOrder(int lineItemId, decimal quantity)
Parameters
Type Name Description
System.Int32 lineItemId

The line item id.

System.Decimal quantity

The quantity.

AddLineItemToShipment(Int32, Shipment, Decimal)

Adds the line item to shipment.

Declaration
[Obsolete("This method is no longer used. Use order abstraction APIs to manage lineitems and shipments. Will remain at least until December 2019.")]
public virtual void AddLineItemToShipment(int lineItemId, Shipment shipment, decimal quantity)
Parameters
Type Name Description
System.Int32 lineItemId

The line item id.

Shipment shipment

The shipment.

System.Decimal quantity

The quantity.

AddLineItemToShipmentDetectedByLineItemShipmentInfo(Int32, Decimal)

Adds the line item to shipment detected by line item shipment info.

Declaration
[Obsolete("This method is no longer used. Use order abstraction APIs to manage lineitems and shipments. Will remain at least until December 2019.")]
public virtual void AddLineItemToShipmentDetectedByLineItemShipmentInfo(int lineItemId, decimal quantity)
Parameters
Type Name Description
System.Int32 lineItemId

The line item id.

System.Decimal quantity

The quantity.

DeepCloneImplementation()

Extends base implementation with deep cloning of ReturnOrderForms.

Declaration
protected override object DeepCloneImplementation()
Returns
Type Description
System.Object

A new object that is a deep copy of the current instance.

Overrides

GetMostRecentPurchaseOrder(Guid)

Loads the purchase order by customer.

Declaration
[Obsolete("This method is no longer used. Will remain at least until December 2019.")]
public static PurchaseOrder GetMostRecentPurchaseOrder(Guid customerId)
Parameters
Type Name Description
System.Guid customerId

The customer id.

Returns
Type Description
PurchaseOrder

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

Initialize(Guid)

Declaration
protected override void Initialize(Guid customerId)
Parameters
Type Name Description
System.Guid customerId
Overrides

LoadByCustomer(Guid)

Loads the purchase order by customer.

Declaration
[Obsolete("This method is no longer used. Use OrderContext.LoadByCustomerId<PurchaseOrder>() instead. Will remain at least until December 2019.")]
public static MetaStorageCollectionBase<PurchaseOrder> LoadByCustomer(Guid customerId)
Parameters
Type Name Description
System.Guid customerId

The customer id.

Returns
Type Description
MetaStorageCollectionBase<PurchaseOrder>

LoadByOrderGroupId(Int32)

Loads the by order group identifier.

Declaration
[Obsolete("This method is no longer used. Use OrderContext.Get<PurchaseOrder>() instead. Will remain at least until December 2019.")]
public static PurchaseOrder LoadByOrderGroupId(int orderGroupId)
Parameters
Type Name Description
System.Int32 orderGroupId

The order group identifier.

Returns
Type Description
PurchaseOrder

MoveLineItemToShipment(Int32, Shipment, Shipment, Decimal)

Moves the line item to shipment.

Declaration
[Obsolete("This method is no longer used. Use order abstraction APIs to manage lineitems and shipments. Will remain at least until December 2019.")]
public virtual void MoveLineItemToShipment(int lineItemId, Shipment srcShipment, Shipment dstShipment, decimal quantity)
Parameters
Type Name Description
System.Int32 lineItemId

The line item id.

Shipment srcShipment

The SRC shipment.

Shipment dstShipment

The DST shipment.

System.Decimal quantity

The quantity.

PopulateCollections(DataTableCollection, String)

Loads RMA requests

Declaration
protected override void PopulateCollections(DataTableCollection tables, string filter)
Parameters
Type Name Description
System.Data.DataTableCollection tables
System.String filter
Overrides

PopulateFromCart(Cart)

Populates from cart.

Declaration
[Obsolete("This method is no longer used. Will remain at least until December 2019.")]
public virtual void PopulateFromCart(Cart cart)
Parameters
Type Name Description
Cart cart

The cart.

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

RemoveLineItemFromOrder(Int32)

Removes the line item from order.

Declaration
[Obsolete("This method is no longer used. Use order abstraction APIs to manage lineitems and shipments. Will remain at least until December 2019.")]
public virtual void RemoveLineItemFromOrder(int lineItemId)
Parameters
Type Name Description
System.Int32 lineItemId

The line item id.

RemoveLineItemFromShipment(Int32, Shipment, Decimal)

Removes the line item from shipment.

Declaration
[Obsolete("This method is no longer used. Use order abstraction APIs to manage lineitems and shipments. Will remain at least until December 2019.")]
public virtual void RemoveLineItemFromShipment(int lineItemId, Shipment shipment, decimal quantity)
Parameters
Type Name Description
System.Int32 lineItemId

The line item id.

Shipment shipment

The shipment.

System.Decimal quantity

The quantity.

Search(OrderSearch, out Int32)

Searches for Purchase Order.

Declaration
[Obsolete("This method is no longer used. Use OrderContext.Search<PurchaseOrder>() instead. Will remain at least until December 2019.")]
public static MetaStorageCollectionBase<PurchaseOrder> Search(OrderSearch search, out int totalRecords)
Parameters
Type Name Description
OrderSearch search

The search.

System.Int32 totalRecords

The total records.

Returns
Type Description
MetaStorageCollectionBase<PurchaseOrder>

UpdateShipmentLineItemQuantity(Int32, Shipment, Decimal)

Updates the shipment line item quantity.

Declaration
[Obsolete("This method is no longer used. Use order abstraction APIs to manage lineitems and shipments. Will remain at least until December 2019.")]
public virtual void UpdateShipmentLineItemQuantity(int lineItemId, Shipment shipment, decimal quantity)
Parameters
Type Name Description
System.Int32 lineItemId

The line item id.

Shipment shipment

The shipment.

System.Decimal quantity

The quantity.

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

IPurchaseOrder.ExpirationDate

Gets or sets the expiration date. Expiration date can be used for subscription type of orders

Declaration
DateTime? IPurchaseOrder.ExpirationDate { get; set; }
Returns
Type Description
System.Nullable<System.DateTime>

IPurchaseOrder.OrderNumber

Gets or sets the order number.

Declaration
string IPurchaseOrder.OrderNumber { get; set; }
Returns
Type Description
System.String

IPurchaseOrder.ReturnForms

Gets the return forms.

Declaration
ICollection<IReturnOrderForm> IPurchaseOrder.ReturnForms { get; }
Returns
Type Description
System.Collections.Generic.ICollection<IReturnOrderForm>

IDeepCloneable.DeepClone()

Creates a limited deep clone of this object.

Declaration
object IDeepCloneable.DeepClone()
Returns
Type Description
System.Object

A deep clone of this object.

Remarks

Some reference type properties will NOT be cloned by this method - the original and the clone will share the same instance of:

Implements

System.Xml.Serialization.IXmlSerializable
System.ICloneable
System.Runtime.Serialization.ISerializable

Extension Methods