Goods.cs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. using System;
  2. namespace Muchinfo.MTPClient.Data.Model
  3. {
  4. /// <summary>
  5. /// Goods类
  6. /// </summary>
  7. public class Goods : GoodsBase
  8. {
  9. #region Fields
  10. /// <summary>
  11. /// 公司代码
  12. /// </summary>
  13. private string _companyCode;
  14. /// <summary>
  15. /// 报价小数位数
  16. /// </summary>
  17. private int _decimalPlaces;
  18. /// <summary>
  19. /// 上市日期
  20. /// </summary>
  21. private string _listingDate;
  22. /// <summary>
  23. /// 上市状态
  24. /// </summary>
  25. private string _listingStatus;
  26. /// <summary>
  27. /// 每手单位
  28. /// </summary>
  29. private int _lotUnit;
  30. /// <summary>
  31. /// 商品名称
  32. /// </summary>
  33. private string _name;
  34. /// <summary>
  35. /// 官方行业代码
  36. /// </summary>
  37. private string _officialSector;
  38. /// <summary>
  39. /// 报价货币
  40. /// </summary>
  41. private string _quoteCurrency;
  42. /// <summary>
  43. /// 报价单位
  44. /// </summary>
  45. private string _quoteUnit;
  46. /// <summary>
  47. /// 关联代码
  48. /// </summary>
  49. private string _relevanceCode;
  50. /// <summary>
  51. /// 商品行业编号
  52. /// </summary>
  53. private string _sectorCode;
  54. /// <summary>
  55. /// 商品类型
  56. /// </summary>
  57. private string _sort;
  58. #endregion Fields
  59. #region Constructors
  60. /// <summary>
  61. /// 实例化一个商品
  62. /// </summary>
  63. /// <param name="exchangeCode">交易所代码</param>
  64. /// <param name="goodscode">商品代码</param>
  65. /// <param name="goodsHqCode">商品行情代码</param>
  66. public Goods(string exchangeCode, string goodscode, string goodsHqCode)
  67. : base(exchangeCode, goodscode, goodsHqCode)
  68. {
  69. }
  70. #endregion Constructors
  71. #region Properties
  72. #region Public Properties
  73. /// <summary>
  74. /// 获取或设置公司代码
  75. /// </summary>
  76. public string CompanyCode
  77. {
  78. get
  79. {
  80. return _companyCode;
  81. }
  82. set
  83. {
  84. Set(() => CompanyCode, ref _companyCode, value);
  85. }
  86. }
  87. /// <summary>
  88. /// 获取或设置报价小数位数
  89. /// </summary>
  90. public int DecimalPlaces
  91. {
  92. get { return _decimalPlaces; }
  93. set { Set(() => DecimalPlaces, ref _decimalPlaces, value); }
  94. }
  95. /// <summary>
  96. /// 获取或设置上市日期
  97. /// </summary>
  98. public string ListingDate
  99. {
  100. get
  101. {
  102. return _listingDate;
  103. }
  104. set
  105. {
  106. Set(() => ListingDate, ref _listingDate, value);
  107. }
  108. }
  109. /// <summary>
  110. /// 获取或设置上市状态
  111. /// </summary>
  112. public string ListingStatus
  113. {
  114. get
  115. {
  116. return _listingStatus;
  117. }
  118. set
  119. {
  120. Set(() => ListingStatus, ref _listingStatus, value);
  121. }
  122. }
  123. /// <summary>
  124. /// 获取或设置每手数量(单位)
  125. /// </summary>
  126. public int LotUnit
  127. {
  128. get { return _lotUnit; }
  129. set { Set(() => LotUnit, ref _lotUnit, value); }
  130. }
  131. /// <summary>
  132. /// 获取或设置商品名称
  133. /// </summary>
  134. public string Name
  135. {
  136. get
  137. {
  138. return _name;
  139. }
  140. set
  141. {
  142. Set(() => Name, ref _name, value);
  143. }
  144. }
  145. /// <summary>
  146. /// 获取或设置官方行业代码
  147. /// </summary>
  148. public string OfficialSector
  149. {
  150. get { return _officialSector; }
  151. set { Set(() => OfficialSector, ref _officialSector, value); }
  152. }
  153. /// <summary>
  154. /// 获取或设置报价货币
  155. /// </summary>
  156. public string QuoteCurrency
  157. {
  158. get
  159. {
  160. return StringDisplay(_quoteCurrency);
  161. }
  162. set
  163. {
  164. Set(() => QuoteCurrency, ref _quoteCurrency, value);
  165. }
  166. }
  167. /// <summary>
  168. /// 获取或设置报价单位 比如每斤猪肉多少钱
  169. /// </summary>
  170. public string QuoteUnit
  171. {
  172. get
  173. {
  174. return StringDisplay(_quoteUnit);
  175. }
  176. set
  177. {
  178. Set(() => QuoteUnit, ref _quoteUnit, value);
  179. }
  180. }
  181. /// <summary>
  182. /// 获取或设置关联代码
  183. /// </summary>
  184. public string RelevanceCode
  185. {
  186. get
  187. {
  188. return _relevanceCode;
  189. }
  190. set
  191. {
  192. Set(() => RelevanceCode, ref _relevanceCode, value);
  193. }
  194. }
  195. /// <summary>
  196. /// 获取或设置商品行业编号
  197. /// </summary>
  198. public string SectorCode
  199. {
  200. get { return _sectorCode; }
  201. set { Set(() => SectorCode, ref _sectorCode, value); }
  202. }
  203. /// <summary>
  204. /// 获取或设置商品类型
  205. /// </summary>
  206. public string Sort
  207. {
  208. get
  209. {
  210. return _sort;
  211. }
  212. set
  213. {
  214. Set(() => Sort, ref _sort, value);
  215. }
  216. }
  217. #endregion Public Properties
  218. #region 行情数据
  219. /// <summary>
  220. /// 最后修改时间
  221. /// </summary>
  222. public DateTime LastModifyTime { get; set; }
  223. /// <summary>
  224. /// 基准价格
  225. /// </summary>
  226. public decimal BasePrice { get; set; }
  227. /// <summary>
  228. /// 交易保证金
  229. /// </summary>
  230. public decimal MarginRate { get; set; }
  231. /// <summary>
  232. /// 市场代码
  233. /// </summary>
  234. public string MarketCode { get; set; }
  235. /// <summary>
  236. /// 市场ID、NEW
  237. /// </summary>
  238. public uint MarketID { get; set; }
  239. public decimal MinFluctuation { get; set; }
  240. #endregion
  241. #endregion Properties
  242. #region Methods
  243. #region Public Methods
  244. /// <summary>
  245. /// 商品字符串表示,通常出现在自选股界面中
  246. /// </summary>
  247. /// <returns></returns>
  248. public override string ToString()
  249. {
  250. return _name;
  251. }
  252. #endregion Public Methods
  253. /// <summary>
  254. /// The default string
  255. /// </summary>
  256. protected static readonly string DefaultString = "-";
  257. /// <summary>
  258. /// Strings the display.
  259. /// </summary>
  260. /// <param name="value">The value.</param>
  261. /// <returns>System.String.</returns>
  262. protected string StringDisplay(string value)
  263. {
  264. if (string.IsNullOrWhiteSpace(value))
  265. {
  266. return DefaultString;
  267. }
  268. return value;
  269. }
  270. #endregion Methods
  271. #region Other
  272. //private int m_SubType;
  273. ///// <summary>
  274. ///// 获取或设置商品子类型
  275. ///// </summary>
  276. //public int Sort2
  277. //{
  278. // get { return m_SubType; }
  279. // set
  280. // {
  281. // if (!value.Equals(m_SubType))
  282. // {
  283. // m_SubType = value;
  284. // }
  285. // }
  286. //}
  287. //private decimal m_MinimumFluctuation;
  288. ///// <summary>
  289. ///// 获取或设置最小变动价位(最低价格波幅)
  290. ///// </summary>
  291. ///// <remarks>
  292. ///// 最低价格波幅,指买卖商品在交易过程中价格波动的最小范围,这通常和报价小数有关
  293. ///// </remarks>
  294. //public decimal MinimumFluctuation
  295. //{
  296. // get { return m_MinimumFluctuation; }
  297. // set { m_MinimumFluctuation = value; }
  298. //}
  299. #endregion Other
  300. }
  301. }