using GalaSoft.MvvmLight; using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Resources; namespace Muchinfo.MTPClient.Data.Model { public class RiskControl : ObservableObject { // 摘要: // 账户状态 public eAccountStatus AccountStatus { get; set; } private string _date; /// /// 日期 /// public string Date { get { return _date; } set { Set(() => Date, ref _date, value); } } /// /// 账户名称 /// private string loginCode; public string LoginCode { get { return loginCode; } set { Set(() => LoginCode, ref loginCode, value); } } /// /// 会员代码 /// private string memberCode; public string MemberCode { get { return memberCode; } set { Set(() => MemberCode, ref memberCode, value); } } /// /// 会员名称 /// private string memberName; public string MemberName { get { return memberName; } set { Set(() => MemberName, ref memberName, value); } } /// /// 当前风险级别所设定的风险率 /// private double msgRate; public double MsgRate { get { return msgRate; } set { Set(() => MsgRate, ref msgRate, value); } } /// /// 实际风险率 /// private double realRate; public double RealRate { get { return realRate; } set { Set(() => RealRate, ref realRate, value); } } /// /// 当前风险级别(1提示, /// private int riskLevel; public int RiskLevel { get { return riskLevel; } set { Set(() => RiskLevel, ref riskLevel, value); } } /// /// 通知类型 /// public RiskMsgType RiskMsgType { get; set; } public string RiskLevelString { get { switch (RiskLevel) { case 0: return Client_Resource.MemberTradeServiceCallbackNoRisk; case 1: return Client_Resource.MemberTradeServiceCallbackWarningLevel; case 2: return Client_Resource.MemberTradeServiceCallbackAppendBail; case 3: return Client_Resource.MemberTradeServiceCallbackLiquidationLevel; case 4: return Client_Resource.MemberTradeServiceCallbackRecoverNormal; } return "--"; } } /// /// 账户代码 /// private string tradeCode; public string TradeCode { get { return tradeCode; } set { Set(() => TradeCode, ref tradeCode, value); } } /// /// 是否显示风险级别 /// public bool IsRiskLevelVisible { get { return RiskMsgType == RiskMsgType.StatusChange; } } /// /// 风控显示的标题 /// public string MessageTitle { get { return RiskMsgType == RiskMsgType.StatusChange ? Client_Resource.RateChangeNotify_Title :Client_Resource.BreakNotify_Title; } } } /// /// /// public enum RiskMsgType { /// /// 账号状态变化通知 /// StatusChange, /// /// 斩仓 /// BreakLevel, } }