narsil/Tanshu.Accounts.Contracts/Data Contracts Display/BillItemKey.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2010-03-02 17:56:21 +00:00
using System;
namespace Tanshu.Accounts.Contracts
{
public enum BillItemType
{
Product,
Kot,
Information,
Total
}
2010-03-02 17:56:21 +00:00
public class BillItemKey
{
private BillItemKey(Guid productID, Guid kotID, BillItemType billItemType)
2010-03-02 17:56:21 +00:00
{
BillItemType = billItemType;
ProductID = productID;
KotID = kotID;
}
public BillItemKey(Guid kotID)
: this(Guid.Empty, kotID, BillItemType.Kot)
{ }
public BillItemKey(Guid productID, Guid kotID)
: this(productID, kotID, BillItemType.Product)
{ }
private Guid _productID;
public Guid ProductID
{
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
}
public Guid KotID { get; private set; }
public BillItemType BillItemType { get; private set; }
2010-03-02 17:56:21 +00:00
}
}