using Newtonsoft.Json; using System.ComponentModel; using System.ComponentModel.DataAnnotations.Schema; using YLErp.DBModels.Helpers; namespace YLErp.Model { public class TradeLinq : OtcTradeBase { /// /// 离交易到期日还有几天 /// [NotMapped] public int MaturityDay { get { if (ExerciseDate == null) { return 999999; } return ExerciseDate.Value.Subtract(DateTime.Now.Date).Days; } } /// /// 是否使用交易特定的波动率 /// [NotMapped] public bool UseTradeVol { get { return NumOfSmoothingDays.HasValue && TradeCloseVolatility.HasValue && TradeOpenVolatility.HasValue; } } [JsonIgnore] [NotMapped] [DisplayName("相对行权价")] public string StrikeRelative { get { return Strike == null ? "0" : Strike.Value.ToString("P"); } } [DisplayName("行权方式")] [NotMapped] public string ExerciseModeCn { get { return TradeType == "收益互换" ? "--" : TradeHelper.GetExerciseModeCn(ExerciseMode); } } [NotMapped] public string ApprovalRules { get; set; } public int? ProcessRoleId { get; set; } public string ProcessRoleName { get; set; } /// /// 验证当前审批角色是否有开仓(交易)复核权限 /// public bool HasCheckRight { get; set; } /// /// 验证当前审批角色是否有行权复核权限 /// public bool HasExerciseCheckRight { get; set; } /// /// 验证当前审批角色是否有平仓复核权限 /// public bool HasUnwindCheckRight { get; set; } /// /// 组合标的的公式信息 /// public string SyntheticUnderlyingTipsInfo { get; set; } [NotMapped] public IEnumerable SubTrades { get; set; } } }