SaleGoods.cs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. using GalaSoft.MvvmLight;
  2. using Muchinfo.MTPClient.Data.Enums;
  3. using Muchinfo.MTPClient.Data.Helper;
  4. using System;
  5. using System.Windows;
  6. using System.Windows.Media;
  7. namespace Muchinfo.MTPClient.Data.Model.Sale
  8. {
  9. public class SaleGoods : ObservableObject
  10. {
  11. #region Public Properties
  12. /// <summary>
  13. /// 序号
  14. /// </summary>
  15. public int OrderNumber { get; set; }
  16. /// <summary>
  17. /// 商品ID
  18. /// </summary>
  19. [PropertyDisc("GoodsId")]
  20. public uint GoodsId { get; set; }
  21. /// <summary>
  22. /// 市场ID
  23. /// </summary>
  24. public uint MarketId { get; set; }
  25. /// <summary>
  26. /// 商品代码
  27. /// </summary>
  28. public string GoodsCode { get; set; }
  29. /// <summary>
  30. /// 商品名称
  31. /// </summary>
  32. public string GoodsName { get; set; }
  33. /// <summary>
  34. /// 合约单位名称
  35. /// </summary>
  36. public string AgreeUnitString { get; set; }
  37. /// <summary>
  38. /// 合约单位名称枚举
  39. /// </summary>
  40. public string AgreeUnitType { get; set; }
  41. /// <summary>
  42. /// 合约单位
  43. /// </summary>
  44. public decimal AgreeUnit { get; set; }
  45. /// <summary>
  46. /// 交易模式,原(市场类型)
  47. /// </summary>
  48. public eTradeMode TradeMode { get; set; }
  49. /// <summary>
  50. /// 资金模式
  51. /// </summary>
  52. public eMoneyMode MoneyMode { get; set; }
  53. /// <summary>
  54. /// 发行价
  55. /// </summary>
  56. [PropertyDisc("ListingPrice")]
  57. public decimal SalePrice { get; set; }
  58. /// <summary>
  59. /// 发行数量
  60. /// </summary>
  61. [PropertyDisc("RemainQty")]
  62. public decimal Qty { get; set; }
  63. /// <summary>
  64. /// 发行数量
  65. /// </summary>
  66. public string QtyDisplay
  67. {
  68. get
  69. {
  70. if (Qty != decimal.Zero)
  71. {
  72. return Qty.ToString();
  73. }
  74. else
  75. {
  76. return "-";
  77. }
  78. }
  79. }
  80. /// <summary>
  81. /// 总发售数量
  82. /// </summary>
  83. [PropertyDisc("IssueTotal")]
  84. public decimal IssueTotal { get; set; }
  85. /// <summary>
  86. /// 计划发售数量=发行量
  87. /// </summary>
  88. public string IssueTotalDisplay
  89. {
  90. get
  91. {
  92. return Planissueqty.ToString();
  93. }
  94. }
  95. /// <summary>
  96. /// 计划发售数量=发行量
  97. /// </summary>
  98. [PropertyDisc("Planissueqty")]
  99. public decimal Planissueqty { get; set; }
  100. /// <summary>
  101. /// 申购开始时间
  102. /// </summary>
  103. [PropertyDisc("IssueStartTime")]
  104. public DateTime ApplyStartTime { get; set; }
  105. /// <summary>
  106. /// Gets the apply start time display.
  107. /// </summary>
  108. /// <value>The apply start time display.</value>
  109. public string ApplyStartTimeDisplay
  110. {
  111. get
  112. {
  113. if (ApplyStartTime == DateTime.MinValue || ApplyStartTime == DateTime.MaxValue) return "-";
  114. return ApplyStartTime.ToString("yyyy-MM-dd");
  115. }
  116. }
  117. /// <summary>
  118. /// 申购结束时间
  119. /// </summary>
  120. [PropertyDisc("IssueEndTime")]
  121. public DateTime ApplyEndTime { get; set; }
  122. public string ApplyEndTimeDisplay
  123. {
  124. get
  125. {
  126. if (ApplyEndTime == DateTime.MinValue || ApplyEndTime == DateTime.MaxValue) return "-";
  127. return ApplyEndTime.ToString("yyyy-MM-dd");
  128. }
  129. }
  130. /// <summary>
  131. /// 发售商品状态
  132. /// </summary>
  133. public string GoodsStatus { get; set; }
  134. /// <summary>
  135. /// 发售商品状态
  136. /// </summary>
  137. [PropertyDisc("RunPeriod")]
  138. public eGoodsStatus GoodsStatusType { get; set; }
  139. /// <summary>
  140. /// 申购手续费收取方式
  141. /// </summary>
  142. public ChargeModeType ChargeType { get; set; }
  143. /// <summary>
  144. /// 运行状态
  145. /// </summary>
  146. public eRunStep RunSteps { get; set; }
  147. /// <summary>
  148. /// Gets or sets the run steps display.
  149. /// </summary>
  150. /// <value>The run steps display.</value>
  151. public string RunStepsDisplay
  152. {
  153. get;
  154. set;
  155. }
  156. public string AgreeUnitDisplay
  157. {
  158. get
  159. {
  160. return AgreeUnit + AgreeUnitString;
  161. }
  162. }
  163. /// <summary>
  164. /// 申购手续费比例或数值
  165. /// </summary>
  166. public decimal ChargeNum { get; set; }
  167. /// <summary>
  168. /// 是否允许申购
  169. /// </summary>
  170. public bool IsSale
  171. {
  172. get
  173. {
  174. return false;
  175. }
  176. }
  177. /// <summary>
  178. /// 是否为浏览模式
  179. /// </summary>
  180. public bool IsBrownMode { get; set; }
  181. /// <summary>
  182. /// 当前账户申购数量
  183. /// </summary>
  184. public decimal SumQty { get; set; }
  185. /// <summary>
  186. /// 单笔最小申购数量
  187. /// </summary>
  188. [PropertyDisc("PerMinSubQty")]
  189. public decimal PerMinSubQty { get; set; }
  190. /// <summary>
  191. /// 单笔最大申购数量
  192. /// </summary>
  193. [PropertyDisc("PerMaxSubQty")]
  194. public decimal PerMaxSubQty { get; set; }
  195. private Visibility _mySelectedFlagVisibility = Visibility.Collapsed;
  196. /// <summary>
  197. /// 我的自选标记是否显示
  198. /// </summary>
  199. /// <value>My selected flag visibility.</value>
  200. public Visibility MySelectedFlagVisibility
  201. {
  202. get
  203. {
  204. return _mySelectedFlagVisibility;
  205. }
  206. set
  207. {
  208. Set(() => MySelectedFlagVisibility, ref _mySelectedFlagVisibility, value);
  209. }
  210. }
  211. /// <summary>
  212. /// 商品代码颜色
  213. /// </summary>
  214. /// <value>The color of the goods code.</value>
  215. public Brush GoodsCodeColor { get; set; }
  216. /// <summary>
  217. /// 商品名称颜色
  218. /// </summary>
  219. /// <value>The color of the goods name.</value>
  220. public Brush GoodsNameColor { get; set; }
  221. /// <summary>
  222. /// 默认字体颜色
  223. /// </summary>
  224. /// <value>The default color.</value>
  225. public Brush DefaultColor { get; set; }
  226. /// <summary>
  227. /// 申购价颜色
  228. /// </summary>
  229. /// <value>The color of the sale price.</value>
  230. public Brush SalePriceColor
  231. {
  232. get { return ResourceHelper.GetFromResource<SolidColorBrush>("QuoteAscBrush"); }
  233. }
  234. #endregion
  235. #region Constructors
  236. /// <summary>
  237. /// Initializes a new instance of the <see cref="SaleGoods"/> class.
  238. /// </summary>
  239. public SaleGoods()
  240. {
  241. }
  242. /// <summary>
  243. /// Initializes a new instance of the <see cref="SaleGoods" /> class.
  244. /// </summary>
  245. /// <param name="quoteGoods">The quote goods.</param>
  246. public SaleGoods(QuoteGoods quoteGoods)
  247. {
  248. if (quoteGoods == null) return;
  249. GoodsName = quoteGoods.Name;
  250. GoodsCode = quoteGoods.GoodsCode;
  251. AgreeUnit = quoteGoods.GoodsParameters.AgreeUnit;
  252. TradeMode = quoteGoods.TradeMode;
  253. MoneyMode = quoteGoods.GoodsParameters.MoneyMode;
  254. //AgreeUnitString = (quoteGoods.GoodsParameters.AgreeUnitType).Discription(),
  255. GoodsId = quoteGoods.GoodsId;
  256. SalePrice = quoteGoods.GoodsParameters.IssuePrice;
  257. RunSteps = quoteGoods.GoodsParameters.RunSteps;
  258. RunStepsDisplay = quoteGoods.GoodsParameters.RunSteps.Discription();
  259. GoodsCodeColor = quoteGoods.GoodsCodeColor;
  260. GoodsNameColor = quoteGoods.NameColor;
  261. DefaultColor = quoteGoods.DefaultColor;
  262. }
  263. #endregion
  264. }
  265. }