yavsc/yavscModel/WorkFlow/WFOrder.cs

46 lines
952 B
C#
Raw Normal View History

2014-07-16 20:35:03 +02:00
using System;
using SalesCatalog.Model;
using yavscModel.WorkFlow;
namespace yavscModel.WorkFlow
2014-07-16 20:35:03 +02:00
{
public class WFOrder : IWFOrder
2014-07-16 20:35:03 +02:00
{
private Product p;
private DateTime date;
private string catref;
private string id = null;
2014-07-16 20:35:03 +02:00
public WFOrder(Product prod,string catalogReference){
date = DateTime.Now;
catref=catalogReference;
p = prod;
id = Guid.NewGuid ().ToString();
2014-07-16 20:35:03 +02:00
}
public override string ToString ()
{
return string.Format ("[Commande date={0} prodref={1}, cat={2}]",date,p.Reference,catref);
}
public event EventHandler<OrderStatusChangedEventArgs> StatusChanged;
2014-07-16 20:35:03 +02:00
#region IWFCommand implementation
/// <summary>
/// Gets the catalog reference, a unique id for the catalog (not a product id).
/// </summary>
/// <value>The catalog reference.</value>
public string UniqueID {
2014-07-16 20:35:03 +02:00
get {
return id;
2014-07-16 20:35:03 +02:00
}
}
public DateTime OrderDate {
get {
return date;
}
}
#endregion
}
}