| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- using GalaSoft.MvvmLight;
- using Muchinfo.MTPClient.Data.Enums;
- using Muchinfo.MTPClient.Data.Helper;
- using System;
- using System.Windows;
- using System.Windows.Media;
- namespace Muchinfo.MTPClient.Data.Model.Sale
- {
- public class SaleGoods : ObservableObject
- {
- #region Public Properties
- /// <summary>
- /// 序号
- /// </summary>
- public int OrderNumber { get; set; }
- /// <summary>
- /// 商品ID
- /// </summary>
- [PropertyDisc("GoodsId")]
- public uint GoodsId { get; set; }
- /// <summary>
- /// 市场ID
- /// </summary>
- public uint MarketId { get; set; }
- /// <summary>
- /// 商品代码
- /// </summary>
- public string GoodsCode { get; set; }
- /// <summary>
- /// 商品名称
- /// </summary>
- public string GoodsName { get; set; }
- /// <summary>
- /// 合约单位名称
- /// </summary>
- public string AgreeUnitString { get; set; }
- /// <summary>
- /// 合约单位名称枚举
- /// </summary>
- public string AgreeUnitType { get; set; }
- /// <summary>
- /// 合约单位
- /// </summary>
- public decimal AgreeUnit { get; set; }
- /// <summary>
- /// 交易模式,原(市场类型)
- /// </summary>
- public eTradeMode TradeMode { get; set; }
- /// <summary>
- /// 资金模式
- /// </summary>
- public eMoneyMode MoneyMode { get; set; }
- /// <summary>
- /// 发行价
- /// </summary>
- [PropertyDisc("ListingPrice")]
- public decimal SalePrice { get; set; }
- /// <summary>
- /// 发行数量
- /// </summary>
- [PropertyDisc("RemainQty")]
- public decimal Qty { get; set; }
- /// <summary>
- /// 发行数量
- /// </summary>
- public string QtyDisplay
- {
- get
- {
- if (Qty != decimal.Zero)
- {
- return Qty.ToString();
- }
- else
- {
- return "-";
- }
- }
- }
- /// <summary>
- /// 总发售数量
- /// </summary>
- [PropertyDisc("IssueTotal")]
- public decimal IssueTotal { get; set; }
- /// <summary>
- /// 计划发售数量=发行量
- /// </summary>
- public string IssueTotalDisplay
- {
- get
- {
- return Planissueqty.ToString();
- }
- }
- /// <summary>
- /// 计划发售数量=发行量
- /// </summary>
- [PropertyDisc("Planissueqty")]
- public decimal Planissueqty { get; set; }
- /// <summary>
- /// 申购开始时间
- /// </summary>
- [PropertyDisc("IssueStartTime")]
- public DateTime ApplyStartTime { get; set; }
- /// <summary>
- /// Gets the apply start time display.
- /// </summary>
- /// <value>The apply start time display.</value>
- public string ApplyStartTimeDisplay
- {
- get
- {
- if (ApplyStartTime == DateTime.MinValue || ApplyStartTime == DateTime.MaxValue) return "-";
- return ApplyStartTime.ToString("yyyy-MM-dd");
- }
- }
- /// <summary>
- /// 申购结束时间
- /// </summary>
- [PropertyDisc("IssueEndTime")]
- public DateTime ApplyEndTime { get; set; }
- public string ApplyEndTimeDisplay
- {
- get
- {
- if (ApplyEndTime == DateTime.MinValue || ApplyEndTime == DateTime.MaxValue) return "-";
- return ApplyEndTime.ToString("yyyy-MM-dd");
- }
- }
- /// <summary>
- /// 发售商品状态
- /// </summary>
- public string GoodsStatus { get; set; }
- /// <summary>
- /// 发售商品状态
- /// </summary>
- [PropertyDisc("RunPeriod")]
- public eGoodsStatus GoodsStatusType { get; set; }
- /// <summary>
- /// 申购手续费收取方式
- /// </summary>
- public ChargeModeType ChargeType { get; set; }
- /// <summary>
- /// 运行状态
- /// </summary>
- public eRunStep RunSteps { get; set; }
- /// <summary>
- /// Gets or sets the run steps display.
- /// </summary>
- /// <value>The run steps display.</value>
- public string RunStepsDisplay
- {
- get;
- set;
- }
- public string AgreeUnitDisplay
- {
- get
- {
- return AgreeUnit + AgreeUnitString;
- }
- }
- /// <summary>
- /// 申购手续费比例或数值
- /// </summary>
- public decimal ChargeNum { get; set; }
- /// <summary>
- /// 是否允许申购
- /// </summary>
- public bool IsSale
- {
- get
- {
- return false;
- }
- }
- /// <summary>
- /// 是否为浏览模式
- /// </summary>
- public bool IsBrownMode { get; set; }
- /// <summary>
- /// 当前账户申购数量
- /// </summary>
- public decimal SumQty { get; set; }
- /// <summary>
- /// 单笔最小申购数量
- /// </summary>
- [PropertyDisc("PerMinSubQty")]
- public decimal PerMinSubQty { get; set; }
- /// <summary>
- /// 单笔最大申购数量
- /// </summary>
- [PropertyDisc("PerMaxSubQty")]
- public decimal PerMaxSubQty { get; set; }
- private Visibility _mySelectedFlagVisibility = Visibility.Collapsed;
- /// <summary>
- /// 我的自选标记是否显示
- /// </summary>
- /// <value>My selected flag visibility.</value>
- public Visibility MySelectedFlagVisibility
- {
- get
- {
- return _mySelectedFlagVisibility;
- }
- set
- {
- Set(() => MySelectedFlagVisibility, ref _mySelectedFlagVisibility, value);
- }
- }
- /// <summary>
- /// 商品代码颜色
- /// </summary>
- /// <value>The color of the goods code.</value>
- public Brush GoodsCodeColor { get; set; }
- /// <summary>
- /// 商品名称颜色
- /// </summary>
- /// <value>The color of the goods name.</value>
- public Brush GoodsNameColor { get; set; }
- /// <summary>
- /// 默认字体颜色
- /// </summary>
- /// <value>The default color.</value>
- public Brush DefaultColor { get; set; }
- /// <summary>
- /// 申购价颜色
- /// </summary>
- /// <value>The color of the sale price.</value>
- public Brush SalePriceColor
- {
- get { return ResourceHelper.GetFromResource<SolidColorBrush>("QuoteAscBrush"); }
- }
- #endregion
- #region Constructors
- /// <summary>
- /// Initializes a new instance of the <see cref="SaleGoods"/> class.
- /// </summary>
- public SaleGoods()
- {
- }
- /// <summary>
- /// Initializes a new instance of the <see cref="SaleGoods" /> class.
- /// </summary>
- /// <param name="quoteGoods">The quote goods.</param>
- public SaleGoods(QuoteGoods quoteGoods)
- {
- if (quoteGoods == null) return;
- GoodsName = quoteGoods.Name;
- GoodsCode = quoteGoods.GoodsCode;
- AgreeUnit = quoteGoods.GoodsParameters.AgreeUnit;
- TradeMode = quoteGoods.TradeMode;
- MoneyMode = quoteGoods.GoodsParameters.MoneyMode;
- //AgreeUnitString = (quoteGoods.GoodsParameters.AgreeUnitType).Discription(),
- GoodsId = quoteGoods.GoodsId;
- SalePrice = quoteGoods.GoodsParameters.IssuePrice;
- RunSteps = quoteGoods.GoodsParameters.RunSteps;
- RunStepsDisplay = quoteGoods.GoodsParameters.RunSteps.Discription();
- GoodsCodeColor = quoteGoods.GoodsCodeColor;
- GoodsNameColor = quoteGoods.NameColor;
- DefaultColor = quoteGoods.DefaultColor;
- }
- #endregion
- }
- }
|