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