CompleteOrder.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. using Muchinfo.MTPClient.Data.Enums;
  2. using Muchinfo.MTPClient.Data.Helper;
  3. using Muchinfo.MTPClient.Resources;
  4. using System;
  5. namespace Muchinfo.MTPClient.Data.Model.Account
  6. {
  7. public class CompleteOrder : OrderBase, ICloneable
  8. {
  9. #region Members of CompleteOrder (13)
  10. /// <summary>
  11. /// 手续费
  12. /// </summary>
  13. private decimal _charge;
  14. /// <summary>
  15. /// 成交日期
  16. /// </summary>
  17. private DateTime _completeDate;
  18. /// <summary>
  19. /// 数量
  20. /// </summary>
  21. private decimal _lot;
  22. /// <summary>
  23. /// 成交方向买卖
  24. /// </summary>
  25. private Direction _completeDirection;
  26. /// <summary>
  27. /// 成交价
  28. /// </summary>
  29. private decimal _completePrice;
  30. /// <summary>
  31. ///成交 订单号
  32. /// </summary>
  33. private long _tradeId;
  34. /// <summary>
  35. /// 平仓盈亏
  36. /// </summary>
  37. private decimal _closePL;
  38. /// <summary>
  39. /// 市场名称
  40. /// </summary>
  41. private string _marketName;
  42. /// <summary>
  43. /// 成交金额
  44. /// </summary>
  45. private decimal _tradeAmount;
  46. /// <summary>
  47. /// 委托单号
  48. /// </summary>
  49. private long _orderID;
  50. /// <summary>
  51. /// 订单类型
  52. /// </summary>
  53. private eOrderType _entrustOrderType;
  54. #endregion Members of CompleteOrder (13)
  55. #region Properties of CompleteOrder (20)
  56. /// <summary>
  57. /// 资金账户
  58. /// </summary>
  59. [PropertyDisc("AccountID")]
  60. public ulong AccountId { get; set; }
  61. /// <summary>
  62. /// 获取或设置 成交日期
  63. /// Changes to that property's value raise the PropertyChanged event.
  64. /// </summary>
  65. [PropertyDisc("TradeTime")]
  66. public DateTime CompleteDate
  67. {
  68. get { return _completeDate; }
  69. set { Set(() => CompleteDate, ref _completeDate, value); }
  70. }
  71. /// <summary>
  72. /// 买卖(报表使用)
  73. /// </summary>
  74. public string CompleteDirectionString { get; set; }
  75. /// <summary>
  76. /// 显示成交日期
  77. /// </summary>
  78. public string DisplayCompleteDate
  79. {
  80. get
  81. {
  82. return _completeDate.ToString("yyyy-MM-dd HH:mm:ss");
  83. }
  84. }
  85. /// <summary>
  86. /// 建平
  87. /// </summary>
  88. [PropertyDisc("ChannelBuildType")]
  89. public eChannelBuildType BuildType { get; set; }
  90. public string BuildTypeDisplay
  91. {
  92. get { return BuildType.Discription(); }
  93. }
  94. /// <summary>
  95. /// 获取或设置 成交价
  96. /// Changes to that property's value raise the PropertyChanged event.
  97. /// </summary>
  98. [PropertyDisc("TradePrice")]
  99. public decimal CompletePrice
  100. {
  101. get { return _completePrice; }
  102. set { Set(() => CompletePrice, ref _completePrice, value); }
  103. }
  104. public string DisplayCompletePrice
  105. {
  106. get { return CompletePrice.ToString(PriceExpFormat); }
  107. }
  108. /// <summary>
  109. /// Sets and 数量
  110. /// Changes to that property's value raise the PropertyChanged event.
  111. /// </summary>
  112. [PropertyDisc("TradeQty")]
  113. public decimal Lot
  114. {
  115. get { return _lot; }
  116. set { Set(() => Lot, ref _lot, value); }
  117. }
  118. /// <summary>
  119. /// 成交金额
  120. /// </summary>
  121. [PropertyDisc("TradeAmount")]
  122. public decimal TradeAmount
  123. {
  124. get { return _tradeAmount; }
  125. set { Set(() => TradeAmount, ref _tradeAmount, value); }
  126. }
  127. /// <summary>
  128. /// 委托单号
  129. /// </summary>
  130. [PropertyDisc("OrderID")]
  131. public long OrderId
  132. {
  133. get { return _orderID; }
  134. set { Set(() => OrderId, ref _orderID, value); }
  135. }
  136. /// <summary>
  137. /// 需求需要将long显示为-- 哦mgd
  138. /// </summary>
  139. private string _OrderID;
  140. public string OrderID
  141. {
  142. get { return OrderId == 0 ? "--" : Convert.ToString(OrderId); }
  143. set
  144. {
  145. Set(() => OrderID, ref _OrderID, value);
  146. }
  147. }
  148. /// <summary>
  149. /// 获取或设置 订单号.
  150. /// Changes to that property's value raise the PropertyChanged event.
  151. /// </summary>
  152. [PropertyDisc("TradeID")]
  153. public long TradeId
  154. {
  155. get { return _tradeId; }
  156. set { Set(() => TradeId, ref _tradeId, value); }
  157. }
  158. /// <summary>
  159. /// 需求要我把long的0变为 --
  160. /// </summary>
  161. private string _tradeID;
  162. public string TradeID
  163. {
  164. get
  165. {
  166. return TradeId == 0 ? "--" : Convert.ToString(TradeId);
  167. }
  168. set
  169. {
  170. Set(() => TradeID, ref _tradeID, value);
  171. }
  172. }
  173. /// <summary>
  174. /// 获取或设置 手续费
  175. /// Changes to that property's value raise the PropertyChanged event.
  176. /// </summary>
  177. public decimal Charge { get { return OpenCharge + CloseCharge; } }
  178. [PropertyDisc("OpenCharge")]
  179. public decimal OpenCharge { get; set; }
  180. [PropertyDisc("CloseCharge")]
  181. public decimal CloseCharge { get; set; }
  182. /// <summary>
  183. /// 占用保证金
  184. /// </summary>
  185. [PropertyDisc("UsedMargin")]
  186. public decimal UsedMargin { get; set; }
  187. /// <summary>
  188. /// 占用保证金[固定保留两位]
  189. /// </summary>
  190. public string UsedMarginDisplay
  191. {
  192. get
  193. {
  194. return UsedMargin.ToString("f2");
  195. }
  196. }
  197. /// <summary>
  198. /// 市场名称
  199. /// </summary>
  200. public string MarketName
  201. {
  202. get { return _marketName; }
  203. set { Set(() => MarketName, ref _marketName, value); }
  204. }
  205. /// <summary>
  206. /// 订单类型
  207. /// </summary>
  208. [PropertyDisc("OrderType")]
  209. public eOrderType EntrustOrderType
  210. {
  211. get { return _entrustOrderType; }
  212. set { Set(() => EntrustOrderType, ref _entrustOrderType, value); }
  213. }
  214. /// <summary>
  215. /// 订单类型
  216. /// </summary>
  217. public string OrderTypeDisc
  218. {
  219. get { return EntrustOrderType.Discription(); }
  220. }
  221. /// <summary>
  222. /// 开平(报表使用)
  223. /// </summary>
  224. public string OrderEnumString { get; set; }
  225. /// <summary>
  226. /// 操作类型
  227. /// </summary>
  228. [PropertyDisc("Operatetype")]
  229. public eOrderOperateType Operatetype { get; set; }
  230. /// <summary>
  231. /// 显示成交方向
  232. /// </summary>
  233. public string StrOpenDirection
  234. {
  235. get
  236. {
  237. return Direction.Discription();
  238. }
  239. }
  240. public string StrOrderTypeDirection
  241. {
  242. get
  243. {
  244. return this.EntrustOrderType.Discription();
  245. }
  246. }
  247. /// <summary>
  248. /// 所属机构
  249. /// </summary>
  250. [PropertyDisc("AreaName")]
  251. public string AreaName { get; set; }
  252. /// <summary>
  253. /// 显示到表单中操作类型
  254. /// </summary>
  255. public string OrderOperateDisplay
  256. {
  257. get
  258. {
  259. return Operatetype.Discription();
  260. }
  261. }
  262. #endregion Properties of CompleteOrder (20)
  263. public object Clone()
  264. {
  265. return this.MemberwiseClone();
  266. }
  267. }
  268. }