| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Muchinfo.MTPClient.Data.Model;
- namespace Muchinfo.MTPClient.Infrastructure.Utilities
- {
- public class SystemParamManager
- {
- /// <summary>
- /// 系统参数配置
- /// </summary>
- /// <value>The parameter configs.</value>
- public static List<ConfigInfoModel> ParamConfigs { get; set; }
- /// <summary>
- /// 风险率计算公式
- /// </summary>
- /// <value>The risk ratio calculate mode.</value>
- public static eRiskRateMode RiskRatioCalcMode
- {
- get
- {
- if (ParamConfigs == null) return eRiskRateMode.OCCUPYWORTH;
- var param = ParamConfigs.FirstOrDefault(z => z.ParamCode == "143");
- //默认使用占用/净值
- if( param == null || param.ParamValue == "0") return eRiskRateMode.OCCUPYWORTH;
- return eRiskRateMode.WORTHOCCUPY;
- }
- }
- /// <summary>
- /// 首次登录是否强制修改密码
- /// </summary>
- /// <value><c>true</c> if this instance is force modify; otherwise, <c>false</c>.</value>
- public static bool IsForceModify
- {
- get
- {
- if (ParamConfigs == null) return false;
- var param = ParamConfigs.FirstOrDefault(z => z.ParamCode == "976");
- //默认强制修改密码
- if (param == null || param.ParamValue == "1") return true;
- return false;
- }
- }
- /// <summary>
- /// 浮动盈利是否可用
- /// </summary>
- /// <value><c>true</c> if this instance is float pl avaliabled; otherwise, <c>false</c>.</value>
- public static bool IsFloatPLAvaliabled
- {
- get
- {
- if (ParamConfigs == null) return false;
- var param = ParamConfigs.FirstOrDefault(z => z.ParamCode == "113");
- if (param == null) return false;
- if (param.ParamValue == "1") return true;
- return false;
- }
- }
- /// <summary>
- /// 是否允许客户端下止损止盈
- /// </summary>
- /// <value><c>true</c> if this instance is SPSL avaliabled; otherwise, <c>false</c>.</value>
- public static bool IsCanSPSL
- {
- get
- {
- //if (ParamConfigs == null) return false;
- //var param = ParamConfigs.FirstOrDefault(z => z.ParamCode == "144");
- //if (param == null) return false;
- //if (param.ParamValue != "jkd") return true; // 交易所标识不是金口袋时可用
- return false;
- }
- }
- /// <summary>
- /// 是否允许客户端一键强平
- /// </summary>
- /// <value><c>true</c> if this instance is CanOneKeyAllClose avaliabled; otherwise, <c>false</c>.</value>
- public static bool IsCanOneKeyAllClose
- {
- get
- {
- if (ParamConfigs == null) return false;
- var param = ParamConfigs.FirstOrDefault(z => z.ParamCode == "144");
- if (param == null) return false;
- if (param.ParamValue != "jkd") return true;
- return false;
- }
- }
- public static double getChannelSuperPoint
- {
- get
- {
- if (ParamConfigs == null) return 1;
- var param = ParamConfigs.FirstOrDefault(i => i.ParamCode == "148");
- if (param == null) return 1;
- return Convert.ToDouble(param.ParamValue);
- }
- }
- public static string GetManageUrl
- {
- get
- {
- if (ParamConfigs == null) return "";
- var param = ParamConfigs.FirstOrDefault(i => i.ParamCode == "5035");
- if (param == null) return "";
- return Convert.ToString(param.ParamValue);
- }
- }
- }
- }
|