| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- using System;
- namespace Muchinfo.MTPClient.Data.Model
- {
- /// <summary>
- /// Goods类
- /// </summary>
- public class Goods : GoodsBase
- {
- #region Fields
- /// <summary>
- /// 公司代码
- /// </summary>
- private string _companyCode;
- /// <summary>
- /// 报价小数位数
- /// </summary>
- private int _decimalPlaces;
- /// <summary>
- /// 上市日期
- /// </summary>
- private string _listingDate;
- /// <summary>
- /// 上市状态
- /// </summary>
- private string _listingStatus;
- /// <summary>
- /// 每手单位
- /// </summary>
- private int _lotUnit;
- /// <summary>
- /// 商品名称
- /// </summary>
- private string _name;
- /// <summary>
- /// 官方行业代码
- /// </summary>
- private string _officialSector;
- /// <summary>
- /// 报价货币
- /// </summary>
- private string _quoteCurrency;
- /// <summary>
- /// 报价单位
- /// </summary>
- private string _quoteUnit;
- /// <summary>
- /// 关联代码
- /// </summary>
- private string _relevanceCode;
- /// <summary>
- /// 商品行业编号
- /// </summary>
- private string _sectorCode;
- /// <summary>
- /// 商品类型
- /// </summary>
- private string _sort;
- #endregion Fields
- #region Constructors
- /// <summary>
- /// 实例化一个商品
- /// </summary>
- /// <param name="exchangeCode">交易所代码</param>
- /// <param name="goodscode">商品代码</param>
- /// <param name="goodsHqCode">商品行情代码</param>
- public Goods(string exchangeCode, string goodscode, string goodsHqCode)
- : base(exchangeCode, goodscode, goodsHqCode)
- {
- }
- #endregion Constructors
- #region Properties
- #region Public Properties
- /// <summary>
- /// 获取或设置公司代码
- /// </summary>
- public string CompanyCode
- {
- get
- {
- return _companyCode;
- }
- set
- {
- Set(() => CompanyCode, ref _companyCode, value);
- }
- }
- /// <summary>
- /// 获取或设置报价小数位数
- /// </summary>
- public int DecimalPlaces
- {
- get { return _decimalPlaces; }
- set { Set(() => DecimalPlaces, ref _decimalPlaces, value); }
- }
- /// <summary>
- /// 获取或设置上市日期
- /// </summary>
- public string ListingDate
- {
- get
- {
- return _listingDate;
- }
- set
- {
- Set(() => ListingDate, ref _listingDate, value);
- }
- }
- /// <summary>
- /// 获取或设置上市状态
- /// </summary>
- public string ListingStatus
- {
- get
- {
- return _listingStatus;
- }
- set
- {
- Set(() => ListingStatus, ref _listingStatus, value);
- }
- }
- /// <summary>
- /// 获取或设置每手数量(单位)
- /// </summary>
- public int LotUnit
- {
- get { return _lotUnit; }
- set { Set(() => LotUnit, ref _lotUnit, value); }
- }
- /// <summary>
- /// 获取或设置商品名称
- /// </summary>
- public string Name
- {
- get
- {
- return _name;
- }
- set
- {
- Set(() => Name, ref _name, value);
- }
- }
- /// <summary>
- /// 获取或设置官方行业代码
- /// </summary>
- public string OfficialSector
- {
- get { return _officialSector; }
- set { Set(() => OfficialSector, ref _officialSector, value); }
- }
- /// <summary>
- /// 获取或设置报价货币
- /// </summary>
- public string QuoteCurrency
- {
- get
- {
- return StringDisplay(_quoteCurrency);
- }
- set
- {
- Set(() => QuoteCurrency, ref _quoteCurrency, value);
- }
- }
- /// <summary>
- /// 获取或设置报价单位 比如每斤猪肉多少钱
- /// </summary>
- public string QuoteUnit
- {
- get
- {
- return StringDisplay(_quoteUnit);
- }
- set
- {
- Set(() => QuoteUnit, ref _quoteUnit, value);
- }
- }
- /// <summary>
- /// 获取或设置关联代码
- /// </summary>
- public string RelevanceCode
- {
- get
- {
- return _relevanceCode;
- }
- set
- {
- Set(() => RelevanceCode, ref _relevanceCode, value);
- }
- }
- /// <summary>
- /// 获取或设置商品行业编号
- /// </summary>
- public string SectorCode
- {
- get { return _sectorCode; }
- set { Set(() => SectorCode, ref _sectorCode, value); }
- }
- /// <summary>
- /// 获取或设置商品类型
- /// </summary>
- public string Sort
- {
- get
- {
- return _sort;
- }
- set
- {
- Set(() => Sort, ref _sort, value);
- }
- }
- #endregion Public Properties
- #region 行情数据
- /// <summary>
- /// 最后修改时间
- /// </summary>
- public DateTime LastModifyTime { get; set; }
- /// <summary>
- /// 基准价格
- /// </summary>
- public decimal BasePrice { get; set; }
- /// <summary>
- /// 交易保证金
- /// </summary>
- public decimal MarginRate { get; set; }
- /// <summary>
- /// 市场代码
- /// </summary>
- public string MarketCode { get; set; }
- /// <summary>
- /// 市场ID、NEW
- /// </summary>
- public uint MarketID { get; set; }
- public decimal MinFluctuation { get; set; }
- #endregion
- #endregion Properties
- #region Methods
- #region Public Methods
- /// <summary>
- /// 商品字符串表示,通常出现在自选股界面中
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return _name;
- }
- #endregion Public Methods
- /// <summary>
- /// The default string
- /// </summary>
- protected static readonly string DefaultString = "-";
- /// <summary>
- /// Strings the display.
- /// </summary>
- /// <param name="value">The value.</param>
- /// <returns>System.String.</returns>
- protected string StringDisplay(string value)
- {
- if (string.IsNullOrWhiteSpace(value))
- {
- return DefaultString;
- }
- return value;
- }
- #endregion Methods
- #region Other
- //private int m_SubType;
- ///// <summary>
- ///// 获取或设置商品子类型
- ///// </summary>
- //public int Sort2
- //{
- // get { return m_SubType; }
- // set
- // {
- // if (!value.Equals(m_SubType))
- // {
- // m_SubType = value;
- // }
- // }
- //}
- //private decimal m_MinimumFluctuation;
- ///// <summary>
- ///// 获取或设置最小变动价位(最低价格波幅)
- ///// </summary>
- ///// <remarks>
- ///// 最低价格波幅,指买卖商品在交易过程中价格波动的最小范围,这通常和报价小数有关
- ///// </remarks>
- //public decimal MinimumFluctuation
- //{
- // get { return m_MinimumFluctuation; }
- // set { m_MinimumFluctuation = value; }
- //}
- #endregion Other
- }
- }
|