public override void BatchSetWeight(WeightTypeEnum weightEnum) { this.Rules.ForEach(r => { r.Weight = weightEnum; }); }
public override void BatchSetWeight(WeightTypeEnum weightEnum) { this.Teachers.ForEach(t => { t.Weight = weightEnum; }); }
public override void BatchSetWeight(WeightTypeEnum weightEnum) { foreach (var r in this.Rules) { r.Weight = weightEnum; } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) { WeightTypeEnum enumType = (WeightTypeEnum)value; return(enumType.GetLocalDescription()); } else { return(value); } }
/// <summary> /// Initializes a new instance of the <see cref="UpsertReferencePortfolioConstituentsRequest" /> class. /// </summary> /// <param name="effectiveFrom">The first date from which the weights will apply (required).</param> /// <param name="weightType">The available values are: Static, Floating, Periodical (required).</param> /// <param name="periodType">The available values are: Daily, Weekly, Monthly, Quarterly, Annually.</param> /// <param name="periodCount">periodCount.</param> /// <param name="constituents">Set of constituents (instrument/weight pairings) (required).</param> public UpsertReferencePortfolioConstituentsRequest(DateTimeOrCutLabel effectiveFrom = default(DateTimeOrCutLabel), WeightTypeEnum weightType = default(WeightTypeEnum), PeriodTypeEnum?periodType = default(PeriodTypeEnum?), int?periodCount = default(int?), List <ReferencePortfolioConstituentRequest> constituents = default(List <ReferencePortfolioConstituentRequest>)) { // to ensure "effectiveFrom" is required (not null) if (effectiveFrom == null) { throw new InvalidDataException("effectiveFrom is a required property for UpsertReferencePortfolioConstituentsRequest and cannot be null"); } else { this.EffectiveFrom = effectiveFrom; } // to ensure "weightType" is required (not null) if (weightType == null) { throw new InvalidDataException("weightType is a required property for UpsertReferencePortfolioConstituentsRequest and cannot be null"); } else { this.WeightType = weightType; } this.PeriodType = periodType; this.PeriodCount = periodCount; // to ensure "constituents" is required (not null) if (constituents == null) { throw new InvalidDataException("constituents is a required property for UpsertReferencePortfolioConstituentsRequest and cannot be null"); } else { this.Constituents = constituents; } this.PeriodType = periodType; this.PeriodCount = periodCount; }
/// <summary> /// Initializes a new instance of the <see cref="GetReferencePortfolioConstituentsResponse" /> class. /// </summary> /// <param name="effectiveFrom">effectiveFrom (required).</param> /// <param name="weightType">The available values are: Static, Floating, Periodical (required).</param> /// <param name="periodType">The available values are: Daily, Weekly, Monthly, Quarterly, Annually.</param> /// <param name="periodCount">periodCount.</param> /// <param name="constituents">Set of constituents (instrument/weight pairings) (required).</param> /// <param name="href">The Uri that returns the same result as the original request, but may include resolved as at time(s)..</param> /// <param name="links">links.</param> public GetReferencePortfolioConstituentsResponse(DateTimeOffset?effectiveFrom = default(DateTimeOffset?), WeightTypeEnum weightType = default(WeightTypeEnum), PeriodTypeEnum?periodType = default(PeriodTypeEnum?), int?periodCount = default(int?), List <ReferencePortfolioConstituent> constituents = default(List <ReferencePortfolioConstituent>), string href = default(string), List <Link> links = default(List <Link>)) { // to ensure "effectiveFrom" is required (not null) if (effectiveFrom == null) { throw new InvalidDataException("effectiveFrom is a required property for GetReferencePortfolioConstituentsResponse and cannot be null"); } else { this.EffectiveFrom = effectiveFrom; } // to ensure "weightType" is required (not null) if (weightType == null) { throw new InvalidDataException("weightType is a required property for GetReferencePortfolioConstituentsResponse and cannot be null"); } else { this.WeightType = weightType; } this.PeriodType = periodType; this.PeriodCount = periodCount; // to ensure "constituents" is required (not null) if (constituents == null) { throw new InvalidDataException("constituents is a required property for GetReferencePortfolioConstituentsResponse and cannot be null"); } else { this.Constituents = constituents; } this.Href = href; this.Links = links; this.PeriodType = periodType; this.PeriodCount = periodCount; this.Href = href; this.Links = links; }
/// <summary> /// Initializes a new instance of the <see cref="GetReferencePortfolioConstituentsResponse" /> class. /// </summary> /// <param name="effectiveFrom">effectiveFrom (required).</param> /// <param name="weightType">The available values are: Static, Floating, Periodical (required).</param> /// <param name="periodType">The available values are: Daily, Weekly, Monthly, Quarterly, Annually.</param> /// <param name="periodCount">periodCount.</param> /// <param name="constituents">Set of constituents (instrument/weight pairings) (required).</param> /// <param name="href">The Uri that returns the same result as the original request, but may include resolved as at time(s)..</param> /// <param name="links">Collection of links..</param> public GetReferencePortfolioConstituentsResponse(DateTimeOffset effectiveFrom = default(DateTimeOffset), WeightTypeEnum weightType = default(WeightTypeEnum), PeriodTypeEnum?periodType = default(PeriodTypeEnum?), int?periodCount = default(int?), List <ReferencePortfolioConstituent> constituents = default(List <ReferencePortfolioConstituent>), string href = default(string), List <Link> links = default(List <Link>)) { this.EffectiveFrom = effectiveFrom; this.WeightType = weightType; // to ensure "constituents" is required (not null) this.Constituents = constituents ?? throw new ArgumentNullException("constituents is a required property for GetReferencePortfolioConstituentsResponse and cannot be null"); this.PeriodType = periodType; this.PeriodCount = periodCount; this.Href = href; this.Links = links; }
/// <summary> /// 批量设置权重 /// </summary> /// <param name="weightEnum"></param> public virtual void BatchSetWeight(WeightTypeEnum weightEnum) { }
/// <summary> /// Initializes a new instance of the <see cref="UpsertReferencePortfolioConstituentsRequest" /> class. /// </summary> /// <param name="effectiveFrom">The first date from which the weights will apply (required).</param> /// <param name="weightType">The available values are: Static, Floating, Periodical (required).</param> /// <param name="periodType">The available values are: Daily, Weekly, Monthly, Quarterly, Annually.</param> /// <param name="periodCount">periodCount.</param> /// <param name="constituents">Set of constituents (instrument/weight pairings) (required).</param> public UpsertReferencePortfolioConstituentsRequest(DateTimeOrCutLabel effectiveFrom = default(DateTimeOrCutLabel), WeightTypeEnum weightType = default(WeightTypeEnum), PeriodTypeEnum?periodType = default(PeriodTypeEnum?), int?periodCount = default(int?), List <ReferencePortfolioConstituentRequest> constituents = default(List <ReferencePortfolioConstituentRequest>)) { // to ensure "effectiveFrom" is required (not null) this.EffectiveFrom = effectiveFrom ?? throw new ArgumentNullException("effectiveFrom is a required property for UpsertReferencePortfolioConstituentsRequest and cannot be null"); this.WeightType = weightType; // to ensure "constituents" is required (not null) this.Constituents = constituents ?? throw new ArgumentNullException("constituents is a required property for UpsertReferencePortfolioConstituentsRequest and cannot be null"); this.PeriodType = periodType; this.PeriodCount = periodCount; }