QuoteGoodsDTO.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056
  1. using GalaSoft.MvvmLight;
  2. using Muchinfo.MTPClient.Data.Helper;
  3. using Muchinfo.MTPClient.Data.Model;
  4. using Muchinfo.MTPClient.Resources;
  5. using System.Windows;
  6. using System.Windows.Media;
  7. namespace Muchinfo.MTPClient.Data.DTO
  8. {
  9. public class QuoteGoodsDTO : ObservableObject
  10. {
  11. #region Propertities
  12. /// <summary>
  13. /// 获取和设置标签(获取行情时用)
  14. /// </summary>
  15. public string Symbol
  16. {
  17. get
  18. {
  19. return _exchangeCode.PadLeft(3, ' ') + _goodsCode.PadLeft(6, ' ');
  20. }
  21. }
  22. /// <summary>
  23. /// ExchangeCode
  24. /// </summary>
  25. private string _exchangeCode;
  26. /// <summary>
  27. /// Sets and gets the ExchangeCode property.
  28. /// Changes to that property's value raise the PropertyChanged event.
  29. /// </summary>
  30. public string ExchHqCode
  31. {
  32. get
  33. {
  34. return _exchangeCode;
  35. }
  36. set
  37. {
  38. Set(() => ExchHqCode, ref _exchangeCode, value);
  39. }
  40. }
  41. /// <summary>
  42. /// GoodsCode
  43. /// </summary>
  44. private string _goodsCode;
  45. /// <summary>
  46. /// Sets and gets the GoodsCode property.
  47. /// Changes to that property's value raise the PropertyChanged event.
  48. /// </summary>
  49. public string GoodsCode
  50. {
  51. get
  52. {
  53. return _goodsCode;
  54. }
  55. set
  56. {
  57. Set(() => GoodsCode, ref _goodsCode, value);
  58. }
  59. }
  60. public string GoodsHqCode { get; set; }
  61. /// <summary>
  62. /// ShowIndex
  63. /// </summary>
  64. private int? _showIndex;
  65. /// <summary>
  66. /// Sets and gets the ShowIndex property.
  67. /// Changes to that property's value raise the PropertyChanged event.
  68. /// </summary>
  69. public int? ShowIndex
  70. {
  71. get
  72. {
  73. return _showIndex;
  74. }
  75. set
  76. {
  77. Set(() => ShowIndex, ref _showIndex, value);
  78. }
  79. }
  80. /// <summary>
  81. /// DateDisplay
  82. /// </summary>
  83. private string _dateDisplay;
  84. /// <summary>
  85. /// Sets and gets the DateDisplay property.
  86. /// Changes to that property's value raise the PropertyChanged event.
  87. /// </summary>
  88. public string DateDisplay
  89. {
  90. get
  91. {
  92. return _dateDisplay;
  93. }
  94. set
  95. {
  96. Set(() => DateDisplay, ref _dateDisplay, value);
  97. }
  98. }
  99. /// <summary>
  100. /// Name
  101. /// </summary>
  102. private string _name;
  103. /// <summary>
  104. /// Sets and gets the Name property.
  105. /// Changes to that property's value raise the PropertyChanged event.
  106. /// </summary>
  107. public string Name
  108. {
  109. get
  110. {
  111. // todo:商品字称最大长度
  112. //int MaxLen = 2;
  113. //if (_name.Length > MaxLen)
  114. //{
  115. // return _name.Substring(0, MaxLen) + "...";
  116. //}
  117. return _name;
  118. }
  119. set
  120. {
  121. Set(() => Name, ref _name, value);
  122. }
  123. }
  124. private string _AgreeUnitDisplay;
  125. /// <summary>
  126. /// 合约单位显示
  127. /// </summary>
  128. public string AgreeUnitDisplay
  129. {
  130. get { return _AgreeUnitDisplay; }
  131. set { _AgreeUnitDisplay = value; }
  132. }
  133. /// <summary>
  134. /// AskPriceDisplay
  135. /// </summary>
  136. private string _askPriceDisplay;
  137. /// <summary>
  138. /// Sets and gets the AskPriceDisplay property.
  139. /// Changes to that property's value raise the PropertyChanged event.
  140. /// </summary>
  141. public string AskPriceDisplay
  142. {
  143. get
  144. {
  145. return _askPriceDisplay;
  146. }
  147. set
  148. {
  149. Set(() => AskPriceDisplay, ref _askPriceDisplay, value);
  150. }
  151. }
  152. /// <summary>
  153. /// AskPriceColor
  154. /// </summary>
  155. private Brush _askPriceColor;
  156. /// <summary>
  157. /// Sets and gets the AskPriceColor property.
  158. /// Changes to that property's value raise the PropertyChanged event.
  159. /// </summary>
  160. public Brush AskPriceColor
  161. {
  162. get
  163. {
  164. return _askPriceColor;
  165. }
  166. set
  167. {
  168. Set(() => AskPriceColor, ref _askPriceColor, value);
  169. }
  170. }
  171. /// <summary>
  172. /// BidPriceDisplay
  173. /// </summary>
  174. private string _bidPriceDisplay;
  175. /// <summary>
  176. /// Sets and gets the BidPriceDisplay property.
  177. /// Changes to that property's value raise the PropertyChanged event.
  178. /// </summary>
  179. public string BidPriceDisplay
  180. {
  181. get
  182. {
  183. return _bidPriceDisplay;
  184. }
  185. set
  186. {
  187. Set(() => BidPriceDisplay, ref _bidPriceDisplay, value);
  188. }
  189. }
  190. private string _bidVolumeDisplay = string.Empty;
  191. /// <summary>
  192. /// 买量显示
  193. /// Changes to that property's value raise the PropertyChanged event.
  194. /// </summary>
  195. public string BidVolumeDisplay
  196. {
  197. get
  198. {
  199. return _bidVolumeDisplay;
  200. }
  201. set
  202. {
  203. Set(() => BidVolumeDisplay, ref _bidVolumeDisplay, value);
  204. }
  205. }
  206. private string _askVolumeDisplay = string.Empty;
  207. /// <summary>
  208. /// 卖量显示
  209. /// Changes to that property's value raise the PropertyChanged event.
  210. /// </summary>
  211. public string AskVolumeDisplay
  212. {
  213. get
  214. {
  215. return _askVolumeDisplay;
  216. }
  217. set
  218. {
  219. Set(() => AskVolumeDisplay, ref _askVolumeDisplay, value);
  220. }
  221. }
  222. /// <summary>
  223. /// BidPriceColor
  224. /// </summary>
  225. private Brush _bidPriceColor;
  226. /// <summary>
  227. /// Sets and gets the BidPriceColor property.
  228. /// Changes to that property's value raise the PropertyChanged event.
  229. /// </summary>
  230. public Brush BidPriceColor
  231. {
  232. get
  233. {
  234. return _bidPriceColor;
  235. }
  236. set
  237. {
  238. Set(() => BidPriceColor, ref _bidPriceColor, value);
  239. }
  240. }
  241. /// <summary>
  242. /// OpenDisplay
  243. /// </summary>
  244. private string _openDisplay;
  245. /// <summary>
  246. /// Sets and gets the OpenDisplay property.
  247. /// Changes to that property's value raise the PropertyChanged event.
  248. /// </summary>
  249. public string OpenDisplay
  250. {
  251. get
  252. {
  253. return _openDisplay;
  254. }
  255. set
  256. {
  257. Set(() => OpenDisplay, ref _openDisplay, value);
  258. }
  259. }
  260. /// <summary>
  261. /// OpenColor
  262. /// </summary>
  263. private Brush _openColor;
  264. /// <summary>
  265. /// Sets and gets the OpenColor property.
  266. /// Changes to that property's value raise the PropertyChanged event.
  267. /// </summary>
  268. public Brush OpenColor
  269. {
  270. get
  271. {
  272. return _openColor;
  273. }
  274. set
  275. {
  276. Set(() => OpenColor, ref _openColor, value);
  277. }
  278. }
  279. /// <summary>
  280. /// LastCloseDisplay
  281. /// </summary>
  282. private string _lastCloseDisplay;
  283. /// <summary>
  284. /// Sets and gets the LastCloseDisplay property.
  285. /// Changes to that property's value raise the PropertyChanged event.
  286. /// </summary>
  287. public string LastCloseDisplay
  288. {
  289. get
  290. {
  291. return _lastCloseDisplay;
  292. }
  293. set
  294. {
  295. Set(() => LastCloseDisplay, ref _lastCloseDisplay, value);
  296. }
  297. }
  298. /// <summary>
  299. /// LowDisplay
  300. /// </summary>
  301. private string _lowDisplay;
  302. /// <summary>
  303. /// Sets and gets the LowDisplay property.
  304. /// Changes to that property's value raise the PropertyChanged event.
  305. /// </summary>
  306. public string LowDisplay
  307. {
  308. get
  309. {
  310. return _lowDisplay;
  311. }
  312. set
  313. {
  314. Set(() => LowDisplay, ref _lowDisplay, value);
  315. }
  316. }
  317. /// <summary>
  318. /// LowColor
  319. /// </summary>
  320. private Brush _lowColor;
  321. /// <summary>
  322. /// Sets and gets the LowColor property.
  323. /// Changes to that property's value raise the PropertyChanged event.
  324. /// </summary>
  325. public Brush LowColor
  326. {
  327. get
  328. {
  329. return _lowColor;
  330. }
  331. set
  332. {
  333. Set(() => LowColor, ref _lowColor, value);
  334. }
  335. }
  336. /// <summary>
  337. /// HighDisplay
  338. /// </summary>
  339. private string _highDisplay;
  340. /// <summary>
  341. /// Sets and gets the HighDisplay property.
  342. /// Changes to that property's value raise the PropertyChanged event.
  343. /// </summary>
  344. public string HighDisplay
  345. {
  346. get
  347. {
  348. return _highDisplay;
  349. }
  350. set
  351. {
  352. Set(() => HighDisplay, ref _highDisplay, value);
  353. }
  354. }
  355. /// <summary>
  356. /// HighColor
  357. /// </summary>
  358. private Brush _highColor;
  359. /// <summary>
  360. /// Sets and gets the HighColor property.
  361. /// Changes to that property's value raise the PropertyChanged event.
  362. /// </summary>
  363. public Brush HighColor
  364. {
  365. get
  366. {
  367. return _highColor;
  368. }
  369. set
  370. {
  371. Set(() => HighColor, ref _highColor, value);
  372. }
  373. }
  374. /// <summary>
  375. /// IncreasePercentDisplay
  376. /// </summary>
  377. private string _increasePercentDisplay;
  378. /// <summary>
  379. /// Sets and gets the IncreasePercentDisplay property.
  380. /// Changes to that property's value raise the PropertyChanged event.
  381. /// </summary>
  382. public string IncreasePercentDisplay
  383. {
  384. get
  385. {
  386. return _increasePercentDisplay;
  387. }
  388. set
  389. {
  390. Set(() => IncreasePercentDisplay, ref _increasePercentDisplay, value);
  391. }
  392. }
  393. /// <summary>
  394. /// IncreasePercentColor
  395. /// </summary>
  396. private Brush _increasePercentColor;
  397. /// <summary>
  398. /// Sets and gets the IncreasePercentColor property.
  399. /// Changes to that property's value raise the PropertyChanged event.
  400. /// </summary>
  401. public Brush IncreasePercentColor
  402. {
  403. get
  404. {
  405. return _increasePercentColor;
  406. }
  407. set
  408. {
  409. Set(() => IncreasePercentColor, ref _increasePercentColor, value);
  410. }
  411. }
  412. /// <summary>
  413. /// IncreaseValueDisplay
  414. /// </summary>
  415. private string _increaseValueDisplay;
  416. /// <summary>
  417. /// Sets and gets the IncreaseValueDisplay property.
  418. /// Changes to that property's value raise the PropertyChanged event.
  419. /// </summary>
  420. public string IncreaseValueDisplay
  421. {
  422. get
  423. {
  424. return _increaseValueDisplay;
  425. }
  426. set
  427. {
  428. Set(() => IncreaseValueDisplay, ref _increaseValueDisplay, value);
  429. }
  430. }
  431. /// <summary>
  432. /// IncreaseValueColor
  433. /// </summary>
  434. private Brush _increaseValueColor;
  435. /// <summary>
  436. /// Sets and gets the IncreaseValueColor property.
  437. /// Changes to that property's value raise the PropertyChanged event.
  438. /// </summary>
  439. public Brush IncreaseValueColor
  440. {
  441. get
  442. {
  443. return _increaseValueColor;
  444. }
  445. set
  446. {
  447. Set(() => IncreaseValueColor, ref _increaseValueColor, value);
  448. }
  449. }
  450. private Brush _defaultColor;
  451. /// <summary>
  452. /// 默认颜色
  453. /// </summary>
  454. public Brush DefaultColor
  455. {
  456. get
  457. {
  458. return _defaultColor;
  459. }
  460. set { Set(() => DefaultColor, ref _defaultColor, value); }
  461. }
  462. private Brush _goodsCodeColor;
  463. /// <summary>
  464. /// 商品代码颜色
  465. /// </summary>
  466. public Brush GoodsCodeColor
  467. {
  468. get
  469. {
  470. return _goodsCodeColor;
  471. }
  472. set { Set(() => GoodsCodeColor, ref _goodsCodeColor, value); }
  473. }
  474. private Brush _nameColor;
  475. /// <summary>
  476. /// 商品名称颜色
  477. /// </summary>
  478. public Brush NameColor
  479. {
  480. get
  481. {
  482. return _nameColor;
  483. }
  484. set { Set(() => NameColor, ref _nameColor, value); }
  485. }
  486. private decimal _lot;
  487. /// <summary>
  488. /// 商品下单数量-大字报价牌用
  489. /// </summary>
  490. /// <value>The lot.</value>
  491. public decimal Lot
  492. {
  493. get
  494. {
  495. return _lot;
  496. }
  497. set
  498. {
  499. Set(() => Lot, ref _lot, value);
  500. }
  501. }
  502. private GoodsParameters _goodsParameters;
  503. /// <summary>
  504. /// 查询回来的商品参数
  505. /// </summary>
  506. public GoodsParameters GoodsParameters
  507. {
  508. get
  509. {
  510. return _goodsParameters;
  511. }
  512. set
  513. {
  514. _goodsParameters = value;
  515. }
  516. }
  517. /// <summary>
  518. /// CurrentPriceDisplay
  519. /// </summary>
  520. private string _currentPriceDisplay;
  521. /// <summary>
  522. /// Sets and gets the CurrentPriceDisplay property.
  523. /// Changes to that property's value raise the PropertyChanged event.
  524. /// </summary>
  525. public string CurrentPriceDisplay
  526. {
  527. get
  528. {
  529. return _currentPriceDisplay;
  530. }
  531. set
  532. {
  533. Set(() => CurrentPriceDisplay, ref _currentPriceDisplay, value);
  534. }
  535. }
  536. /// <summary>
  537. /// CurrentPriceColor
  538. /// </summary>
  539. private Brush _currentPriceColor;
  540. /// <summary>
  541. /// Sets and gets the CurrentPriceColor property.
  542. /// Changes to that property's value raise the PropertyChanged event.
  543. /// </summary>
  544. public Brush CurrentPriceColor
  545. {
  546. get
  547. {
  548. return _currentPriceColor;
  549. }
  550. set
  551. {
  552. Set(() => CurrentPriceColor, ref _currentPriceColor, value);
  553. }
  554. }
  555. /// <summary>
  556. /// VolumeDisplay
  557. /// </summary>
  558. private string _currentvolumeDisplay;
  559. /// <summary>
  560. /// Sets and gets the VolumeDisplay property.
  561. /// Changes to that property's value raise the PropertyChanged event.
  562. /// </summary>
  563. public string CurrentVolumeDisplay
  564. {
  565. get
  566. {
  567. return _currentvolumeDisplay;
  568. }
  569. set
  570. {
  571. Set(() => CurrentVolumeDisplay, ref _currentvolumeDisplay, value);
  572. }
  573. }
  574. /// <summary>
  575. /// RaisesPriceDisplay
  576. /// </summary>
  577. private string _raisesPriceDisplay;
  578. /// <summary>
  579. /// 涨停价-显示字符
  580. /// </summary>
  581. public string RaisesPriceDisplay
  582. {
  583. get
  584. {
  585. return _raisesPriceDisplay;
  586. }
  587. set
  588. {
  589. Set(() => RaisesPriceDisplay, ref _raisesPriceDisplay, value);
  590. }
  591. }
  592. /// <summary>
  593. /// 涨停价颜色
  594. /// </summary>
  595. private Brush _raisesPriceColor;
  596. /// <summary>
  597. /// 涨停价颜色
  598. /// </summary>
  599. /// <value>The color of the raises price.</value>
  600. public Brush RaisesPriceColor
  601. {
  602. get
  603. {
  604. return _raisesPriceColor;
  605. }
  606. set
  607. {
  608. Set(() => RaisesPriceColor, ref _raisesPriceColor, value);
  609. }
  610. }
  611. /// <summary>
  612. /// FallsPriceDisplay
  613. /// </summary>
  614. private string _fallsPriceDisplay;
  615. /// <summary>
  616. /// 跌停价-显示字符
  617. /// </summary>
  618. public string FallsPriceDisplay
  619. {
  620. get
  621. {
  622. return _fallsPriceDisplay;
  623. }
  624. set
  625. {
  626. Set(() => FallsPriceDisplay, ref _fallsPriceDisplay, value);
  627. }
  628. }
  629. private string _turnoverRateDisplay;
  630. public string TurnoverRateDisplay
  631. {
  632. get { return _turnoverRateDisplay; }
  633. set { Set(() => TurnoverRateDisplay, ref _turnoverRateDisplay, value); }
  634. }
  635. /// <summary>
  636. /// 跌停价颜色
  637. /// </summary>
  638. private Brush _fallsPriceColor;
  639. /// <summary>
  640. /// 跌停价颜色
  641. /// </summary>
  642. public Brush FallsPriceColor
  643. {
  644. get
  645. {
  646. return _fallsPriceColor;
  647. }
  648. set
  649. {
  650. Set(() => FallsPriceColor, ref _fallsPriceColor, value);
  651. }
  652. }
  653. /// <summary>
  654. /// IsAskPriceBorder
  655. /// </summary>
  656. private bool _isAskPriceBorder;
  657. /// <summary>
  658. /// Sets and gets the IsAskPriceBorder property.
  659. /// Changes to that property's value raise the PropertyChanged event.
  660. /// </summary>
  661. public bool IsAskPriceBorder
  662. {
  663. get
  664. {
  665. return _isAskPriceBorder;
  666. }
  667. set
  668. {
  669. Set(() => IsAskPriceBorder, ref _isAskPriceBorder, value);
  670. }
  671. }
  672. /// <summary>
  673. /// IsCurrentPriceBorder
  674. /// </summary>
  675. private bool _isCurrentPriceBorder;
  676. /// <summary>
  677. /// Sets and gets the IsCurrentPriceBorder property.
  678. /// Changes to that property's value raise the PropertyChanged event.
  679. /// </summary>
  680. public bool IsCurrentPriceBorder
  681. {
  682. get
  683. {
  684. return _isCurrentPriceBorder;
  685. }
  686. set
  687. {
  688. Set(() => IsCurrentPriceBorder, ref _isCurrentPriceBorder, value);
  689. }
  690. }
  691. /// <summary>
  692. /// IsBidPriceBorder
  693. /// </summary>
  694. private bool _isBidPriceBorder;
  695. /// <summary>
  696. /// Sets and gets the IsBidPriceBorder property.
  697. /// Changes to that property's value raise the PropertyChanged event.
  698. /// </summary>
  699. public bool IsBidPriceBorder
  700. {
  701. get
  702. {
  703. return _isBidPriceBorder;
  704. }
  705. set
  706. {
  707. Set(() => IsBidPriceBorder, ref _isBidPriceBorder, value);
  708. }
  709. }
  710. private decimal _increaseValue;
  711. /// <summary>
  712. /// 涨跌(现价-昨收)
  713. /// </summary>
  714. /// <value>The _increaseValue.</value>
  715. public decimal IncreaseValue
  716. {
  717. get
  718. {
  719. return _increaseValue;
  720. }
  721. set
  722. {
  723. Set(() => IncreaseValue, ref _increaseValue, value);
  724. }
  725. }
  726. /// <summary>
  727. /// 市场ID
  728. /// </summary>
  729. public long GoodsGroupId { get; set; }
  730. private decimal _minOpenNumber;
  731. /// <summary>
  732. /// 最小建仓数量
  733. /// </summary>
  734. public decimal MinOpenNumber
  735. {
  736. get
  737. {
  738. return _minOpenNumber;
  739. }
  740. set
  741. {
  742. Set(() => MinOpenNumber, ref _minOpenNumber, value);
  743. }
  744. }
  745. public uint GoodsId { get; set; }
  746. /// <summary>
  747. /// 交易端模式
  748. /// </summary>
  749. public eTradeMode TradeMode { get; set; }
  750. private Visibility _mySelectedFlagVisibility = Visibility.Collapsed;
  751. /// <summary>
  752. /// 我的自选标记是否显示
  753. /// </summary>
  754. /// <value>My selected flag visibility.</value>
  755. public Visibility MySelectedFlagVisibility
  756. {
  757. get
  758. {
  759. return _mySelectedFlagVisibility;
  760. }
  761. set
  762. {
  763. Set(() => MySelectedFlagVisibility, ref _mySelectedFlagVisibility, value);
  764. }
  765. }
  766. private string _totalVolumeDisplay;
  767. /// <summary>
  768. /// 总量
  769. /// </summary>
  770. public string TotalVolumeDisplay
  771. {
  772. get { return _totalVolumeDisplay; }
  773. set { Set(() => TotalVolumeDisplay, ref _totalVolumeDisplay, value); }
  774. }
  775. private string _totalTurnoverDisplay;
  776. /// <summary>
  777. /// 总额
  778. /// </summary>
  779. public string TotalTurnoverDisplay
  780. {
  781. get { return _totalTurnoverDisplay; }
  782. set { Set(() => TotalTurnoverDisplay, ref _totalTurnoverDisplay, value); }
  783. }
  784. private string _positionsDisplay;
  785. /// <summary>
  786. /// 持仓量
  787. /// </summary>
  788. public string PositionsDisplay
  789. {
  790. get { return _positionsDisplay; }
  791. set { Set(() => PositionsDisplay, ref _positionsDisplay, value); }
  792. }
  793. /// <summary>
  794. /// 显示代码名称
  795. /// </summary>
  796. //public string CodeNameDisplay
  797. //{
  798. // get
  799. // {
  800. // return string.Format("{0}:{1}", GoodsCode, Name);
  801. // }
  802. //}
  803. private string _lastPositions;
  804. /// <summary>
  805. /// 昨持仓量
  806. /// </summary>
  807. public string LastPositionsDisplay
  808. {
  809. get { return _lastPositions; }
  810. set { Set(() => LastPositionsDisplay, ref _lastPositions, value); }
  811. }
  812. private string _inventoryDisplay;
  813. /// <summary>
  814. /// 库存量
  815. /// </summary>
  816. public string InventoryDisplay
  817. {
  818. get { return _inventoryDisplay; }
  819. set { Set(() => InventoryDisplay, ref _inventoryDisplay, value); }
  820. }
  821. /// <summary>
  822. /// 显示代码名称
  823. /// </summary>
  824. public string CodeNameDisplay
  825. {
  826. get
  827. {
  828. return string.Format("{0}:{1}", GoodsCode, Name);
  829. }
  830. }
  831. #endregion
  832. #region Constructor
  833. /// <summary>
  834. /// Initializes a new instance of the <see cref="QuoteGoodsDTO"/> class.
  835. /// </summary>
  836. /// <param name="goods">The goods.</param>
  837. public QuoteGoodsDTO(QuoteGoods goods)
  838. {
  839. if (goods == null) return;
  840. UpdateFromQuoteGoods(goods, false);
  841. }
  842. #endregion
  843. #region Methods
  844. /// <summary>
  845. /// 根据QuoteGoods更新实例
  846. /// </summary>
  847. /// <param name="goods">The goods.</param>
  848. /// <param name="isUpdate">if set to <c>true</c> [is update].</param>
  849. /// <returns>QuoteGoodsDTO.</returns>
  850. public void UpdateFromQuoteGoods(QuoteGoods goods, bool isUpdate = true)
  851. {
  852. if (goods == null) return;
  853. if (!isUpdate)
  854. {
  855. ExchHqCode = goods.ExchHqCode;
  856. GoodsCode = goods.GoodsCode;
  857. GoodsHqCode = goods.GoodsHqCode;
  858. Name = goods.Name;
  859. ShowIndex = goods.ShowIndex;
  860. if (goods.GoodsParameters != null)
  861. {
  862. GoodsGroupId = goods.GoodsParameters.SortId;
  863. Lot = MinOpenNumber;
  864. TradeMode = goods.TradeMode;
  865. GoodsId = goods.GoodsId;
  866. }
  867. }
  868. DateDisplay = goods.DateDisplay;
  869. AskPriceDisplay = goods.AskPriceDisplay;
  870. AskVolumeDisplay = goods.AskVolumeDisplay;
  871. AskPriceColor = goods.AskPriceColor;
  872. BidPriceDisplay = goods.BidPriceDisplay;
  873. BidVolumeDisplay = goods.BidVolumeDisplay;
  874. BidPriceColor = goods.BidPriceColor;
  875. CurrentPriceColor = goods.CurrentPriceColor;
  876. CurrentPriceDisplay = goods.CurrentPriceDisplay;
  877. OpenDisplay = goods.OpenDisplay;
  878. OpenColor = goods.OpenColor;
  879. HighColor = goods.HighColor;
  880. HighDisplay = goods.HighDisplay;
  881. LowColor = goods.LowColor;
  882. LowDisplay = goods.LowDisplay;
  883. LastCloseDisplay = goods.LastCloseDisplay;
  884. IncreasePercentColor = goods.IncreasePercentColor;
  885. IncreasePercentDisplay = goods.IncreasePercentDisplay;
  886. IncreaseValueDisplay = goods.IncreaseValueDisplay;
  887. IncreaseValueColor = goods.IncreaseValueColor;
  888. DefaultColor = goods.DefaultColor;
  889. GoodsCodeColor = goods.GoodsCodeColor;
  890. NameColor = goods.NameColor;
  891. CurrentVolumeDisplay = goods.CurrentVolumeDisplay;
  892. RaisesPriceDisplay = goods.RaisesPriceDisplay;
  893. RaisesPriceColor = goods.RaisesPriceColor;
  894. FallsPriceDisplay = goods.FallsPriceDisplay;
  895. FallsPriceColor = goods.FallsPriceColor;
  896. // Lot = goods.Lot;
  897. //GoodsParameters = goods.GoodsParameters;
  898. AgreeUnitDisplay = goods.AgreeUnitDisplay;
  899. TotalVolumeDisplay = goods.TotalVolumeDisplay;
  900. TotalTurnoverDisplay = goods.TotalTurnoverDisplay;
  901. InventoryDisplay = goods.InventoryDisplay;
  902. PositionsDisplay = goods.PositionsDisplay;
  903. TurnoverRateDisplay = goods.TurnoverRateDisplay;
  904. IsAskPriceBorder = goods.IsAskPriceBorder;
  905. IsBidPriceBorder = goods.IsCurrentPriceBorder;
  906. IsCurrentPriceBorder = goods.IsCurrentPriceBorder;
  907. IncreaseValue = (goods.CurrentPrice == 0) ? 0 : goods.IncreaseValue;
  908. }
  909. #endregion
  910. #region "P+X分组属性"
  911. /// <summary>
  912. /// 交割商品名称(关联交易商品 存放交割商品名称)
  913. /// </summary>
  914. public string DeliveryGoodsName { get; set; }
  915. /// <summary>
  916. /// 仅用于P+X交割时表示P方还是X, X为主商品 true:X, false: P
  917. /// </summary>
  918. public bool IsMain { get; set; }
  919. /// <summary>
  920. /// 以P为主显示
  921. /// </summary>
  922. /// <value>The p and x display.</value>
  923. public string PAndXDisplay
  924. {
  925. get
  926. {
  927. if (IsMain) return Client_Resource.Delivery_PDisplay;
  928. return Client_Resource.Delivery_XDisplay;
  929. }
  930. }
  931. /// <summary>
  932. /// P,X的tooltip, 以P为主显示
  933. /// </summary>
  934. /// <value>The p and x tool tip.</value>
  935. public string PAndXToolTip
  936. {
  937. get
  938. {
  939. if (IsMain) return Client_Resource.Delivery_PDesc;
  940. return Client_Resource.Delivery_XDesc;
  941. }
  942. }
  943. /// <summary>
  944. /// 商品列表行背景色
  945. /// </summary>
  946. /// <value>The row background.</value>
  947. public SolidColorBrush RowBackground
  948. {
  949. get
  950. {
  951. if (IsMain) return ResourceHelper.GetFromResource<SolidColorBrush>("QuoteRowBackgroundBrushP");
  952. return new SolidColorBrush(Colors.Transparent);
  953. }
  954. }
  955. #endregion
  956. }
  957. }