using GalaSoft.MvvmLight; using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Data.Helper; namespace Muchinfo.MTPClient.Data.Model.Account { public class OrderBase : ObservableObject { /// /// 商品代码 /// private uint _goodId; /// /// 商品代码 /// [PropertyDisc("GoodsId")] public uint GoodsId { get { return _goodId; } set { Set(() => GoodsId, ref _goodId, value); } } /// /// 买卖 /// [PropertyDisc("BuyOrSell")] public Direction Direction { get; set; } /// /// 商品代码 /// private string _goodsCode; /// /// 商品代码 /// [PropertyDisc("GoodsCode")] public string GoodsCode { get { return _goodsCode; } set { Set(() => GoodsCode, ref _goodsCode, value); } } // 行情代码 private string _hqCode; /// /// 行情代码 /// public string HqCode { get { return _hqCode; } set { Set(() => HqCode, ref _hqCode, value); } } //商品名称 private string _goodsName; /// /// 商品名称 /// [PropertyDisc("GoodsName")] public string GoodsName { get { return _goodsName; } set { Set(() => GoodsName, ref _goodsName, value); } } /// /// 交易账号 /// public string TradeCode { get; set; } /// /// 单据商品 /// public QuoteGoods QuoteGoods { get; set; } /// /// 商品竞价模式 0:保证金交易 1:全额交易 /// public int BidPattern { get; set; } /// /// 订单类型 /// public eOrderType OrderType { get; set; } private TradeModeType _goodsTradeMode =TradeModeType.MarketGoods; /// /// 交易模式 /// public TradeModeType GoodsTradeMode { get { return _goodsTradeMode; } set { _goodsTradeMode= value; } } /// /// 价格格式化 /// public virtual string PriceFormat { get { // return "F2"; if (this.QuoteGoods != null) { return QuoteGoods.FormatPrice; } else { return "F0"; } } } /// /// 价格格式化(两位以上小数,报价小数位小于等于2位,持仓均价保留两位报价小数位大于2位,持仓均价小数位等于报价小数位) /// public virtual string PriceExpFormat { get { if (this.QuoteGoods == null || this.QuoteGoods.GoodsParameters == null) { // return "F0"; //} //if (this.QuoteGoods.GoodsParameters.HqExchFigures < 3) //{ return "F2"; } else { return QuoteGoods.FormatPrice; } } } /// /// Gets the direction display. /// /// The direction display. public string DirectionDisplay { get { return Direction.Discription(); } } /// /// 序号 /// /// The index. public int Index { get; set; } } }