using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Data.Helper; using Muchinfo.MTPClient.Resources; using System; namespace Muchinfo.MTPClient.Data.Model.Account { public class CompleteOrder : OrderBase, ICloneable { #region Members of CompleteOrder (13) /// /// 手续费 /// private decimal _charge; /// /// 成交日期 /// private DateTime _completeDate; /// /// 数量 /// private decimal _lot; /// /// 成交方向买卖 /// private Direction _completeDirection; /// /// 成交价 /// private decimal _completePrice; /// ///成交 订单号 /// private long _tradeId; /// /// 平仓盈亏 /// private decimal _closePL; /// /// 市场名称 /// private string _marketName; /// /// 成交金额 /// private decimal _tradeAmount; /// /// 委托单号 /// private long _orderID; /// /// 订单类型 /// private eOrderType _entrustOrderType; #endregion Members of CompleteOrder (13) #region Properties of CompleteOrder (20) /// /// 资金账户 /// [PropertyDisc("AccountID")] public ulong AccountId { get; set; } /// /// 获取或设置 成交日期 /// Changes to that property's value raise the PropertyChanged event. /// [PropertyDisc("TradeTime")] public DateTime CompleteDate { get { return _completeDate; } set { Set(() => CompleteDate, ref _completeDate, value); } } /// /// 买卖(报表使用) /// public string CompleteDirectionString { get; set; } /// /// 显示成交日期 /// public string DisplayCompleteDate { get { return _completeDate.ToString("yyyy-MM-dd HH:mm:ss"); } } /// /// 建平 /// [PropertyDisc("ChannelBuildType")] public eChannelBuildType BuildType { get; set; } public string BuildTypeDisplay { get { return BuildType.Discription(); } } /// /// 获取或设置 成交价 /// Changes to that property's value raise the PropertyChanged event. /// [PropertyDisc("TradePrice")] public decimal CompletePrice { get { return _completePrice; } set { Set(() => CompletePrice, ref _completePrice, value); } } public string DisplayCompletePrice { get { return CompletePrice.ToString(PriceExpFormat); } } /// /// Sets and 数量 /// Changes to that property's value raise the PropertyChanged event. /// [PropertyDisc("TradeQty")] public decimal Lot { get { return _lot; } set { Set(() => Lot, ref _lot, value); } } /// /// 成交金额 /// [PropertyDisc("TradeAmount")] public decimal TradeAmount { get { return _tradeAmount; } set { Set(() => TradeAmount, ref _tradeAmount, value); } } /// /// 委托单号 /// [PropertyDisc("OrderID")] public long OrderId { get { return _orderID; } set { Set(() => OrderId, ref _orderID, value); } } /// /// 需求需要将long显示为-- 哦mgd /// private string _OrderID; public string OrderID { get { return OrderId == 0 ? "--" : Convert.ToString(OrderId); } set { Set(() => OrderID, ref _OrderID, value); } } /// /// 获取或设置 订单号. /// Changes to that property's value raise the PropertyChanged event. /// [PropertyDisc("TradeID")] public long TradeId { get { return _tradeId; } set { Set(() => TradeId, ref _tradeId, value); } } /// /// 需求要我把long的0变为 -- /// private string _tradeID; public string TradeID { get { return TradeId == 0 ? "--" : Convert.ToString(TradeId); } set { Set(() => TradeID, ref _tradeID, value); } } /// /// 获取或设置 手续费 /// Changes to that property's value raise the PropertyChanged event. /// public decimal Charge { get { return OpenCharge + CloseCharge; } } [PropertyDisc("OpenCharge")] public decimal OpenCharge { get; set; } [PropertyDisc("CloseCharge")] public decimal CloseCharge { get; set; } /// /// 占用保证金 /// [PropertyDisc("UsedMargin")] public decimal UsedMargin { get; set; } /// /// 占用保证金[固定保留两位] /// public string UsedMarginDisplay { get { return UsedMargin.ToString("f2"); } } /// /// 市场名称 /// public string MarketName { get { return _marketName; } set { Set(() => MarketName, ref _marketName, value); } } /// /// 订单类型 /// [PropertyDisc("OrderType")] public eOrderType EntrustOrderType { get { return _entrustOrderType; } set { Set(() => EntrustOrderType, ref _entrustOrderType, value); } } /// /// 订单类型 /// public string OrderTypeDisc { get { return EntrustOrderType.Discription(); } } /// /// 开平(报表使用) /// public string OrderEnumString { get; set; } /// /// 操作类型 /// [PropertyDisc("Operatetype")] public eOrderOperateType Operatetype { get; set; } /// /// 显示成交方向 /// public string StrOpenDirection { get { return Direction.Discription(); } } public string StrOrderTypeDirection { get { return this.EntrustOrderType.Discription(); } } /// /// 所属机构 /// [PropertyDisc("AreaName")] public string AreaName { get; set; } /// /// 显示到表单中操作类型 /// public string OrderOperateDisplay { get { return Operatetype.Discription(); } } #endregion Properties of CompleteOrder (20) public object Clone() { return this.MemberwiseClone(); } } }