2010-03-02 17:56:21 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Contracts
|
|
|
|
|
{
|
2011-06-23 12:47:48 +00:00
|
|
|
|
public enum BillItemType
|
|
|
|
|
{
|
|
|
|
|
Product,
|
2012-12-01 09:49:33 +00:00
|
|
|
|
Kot,
|
|
|
|
|
Information,
|
|
|
|
|
Total
|
2011-06-23 12:47:48 +00:00
|
|
|
|
}
|
2010-03-02 17:56:21 +00:00
|
|
|
|
public class BillItemKey
|
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
private BillItemKey(Guid productID, Guid kotID, BillItemType billItemType)
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-06-23 12:47:48 +00:00
|
|
|
|
BillItemType = billItemType;
|
|
|
|
|
ProductID = productID;
|
|
|
|
|
KotID = kotID;
|
|
|
|
|
}
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public BillItemKey(Guid kotID)
|
|
|
|
|
: this(Guid.Empty, kotID, BillItemType.Kot)
|
2011-06-23 12:47:48 +00:00
|
|
|
|
{ }
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public BillItemKey(Guid productID, Guid kotID)
|
2011-06-23 12:47:48 +00:00
|
|
|
|
: this(productID, kotID, BillItemType.Product)
|
|
|
|
|
{ }
|
|
|
|
|
|
2014-10-12 09:41:45 +00:00
|
|
|
|
private Guid _productID;
|
|
|
|
|
public Guid ProductID
|
2011-06-23 12:47:48 +00:00
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
get { return BillItemType == BillItemType.Product ? _productID : Guid.Empty; }
|
|
|
|
|
private set { _productID = BillItemType == BillItemType.Product ? value : Guid.Empty; }
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public Guid KotID { get; private set; }
|
2011-02-18 16:54:48 +00:00
|
|
|
|
|
2011-06-23 12:47:48 +00:00
|
|
|
|
public BillItemType BillItemType { get; private set; }
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|