narsil/Tanshu.Accounts.Contracts/Data Contracts/SettleOption.cs

69 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tanshu.Accounts.Entities
{
public class SettleOption
{
public int SettleOptionID { get; set; }
public string Name { get; set; }
public override bool Equals(System.Object obj)
{
if (obj is SettleOption)
return (this == (SettleOption)obj);
else
return false;
}
public override int GetHashCode()
{
return SettleOptionID.GetHashCode() ^ Name.GetHashCode();
}
public static bool operator ==(SettleOption a, SettleOption b)
{
if (object.ReferenceEquals(null, a))
return object.ReferenceEquals(null, b);
if (!(a is SettleOption))
return false;
if (!(b is SettleOption))
return false;
return (a.SettleOptionID == b.SettleOptionID)
&& (a.Name == b.Name);
}
public static bool operator !=(SettleOption a, SettleOption b)
{
return !(a == b);
}
//public enum SettleOption
//{
// Unsettled = 0,
// Cash = 1,
// CreditCard = 2,
// NoCharge = 3,
// BillToCompany = 4,
// Staff = 5
//}
//public class SettleOption
//{
// public static readonly SettleOption Unsettled = new SettleOption(0);
// public static readonly SettleOption Cash = new SettleOption(1);
// public static readonly SettleOption CreditCard = new SettleOption(2);
// public static readonly SettleOption NoCharge = new SettleOption(3);
// public static readonly SettleOption BillToCompany = new SettleOption(4);
// public static readonly SettleOption Staff = new SettleOption(5);
// public int SettleOptionID { get; private set; }
// private SettleOption(int settleOption)
// {
// this.SettleOptionID = settleOption;
// }
//}
}
}