private void CreateDto(BaseCriterion criterion) { if (criterion.Committee != null) { IdCommittee = criterion.Committee.Id; if (criterion.Committee.UseDss) { MethodSettings = dtoItemMethodSettings.Create(criterion.Committee.MethodSettings, criterion.Committee.MethodSettings.UseManualWeights); } } Deleted = criterion.Deleted; Description = criterion.Description; CommentType = criterion.CommentType; Type = criterion.Type; if (criterion.UseDss) { WeightSettings = dtoItemWeightSettings.Create(criterion.WeightSettings, criterion.Committee.MethodSettings.UseManualWeights); } UseDss = criterion.UseDss; switch (criterion.Type) { case CriterionType.IntegerRange: case CriterionType.DecimalRange: DecimalMinValue = ((NumericRangeCriterion)criterion).DecimalMinValue; DecimalMaxValue = ((NumericRangeCriterion)criterion).DecimalMaxValue; break; case CriterionType.StringRange: MaxOption = ((StringRangeCriterion)criterion).MaxOption; MinOption = ((StringRangeCriterion)criterion).MinOption; Options = ((StringRangeCriterion)criterion).Options.Where(o => o.Deleted == BaseStatusDeleted.None).OrderBy(o => o.DisplayOrder).ThenBy(o => o.Name).Select(o => new dtoCriterionOption(o)).ToList(); break; case CriterionType.Textual: var curType = criterion.GetType().ToString(); MaxLength = ((TextualCriterion)criterion).MaxLength; break; case CriterionType.RatingScale: IsFuzzy = ((DssCriterion)criterion).IsFuzzy; IdRatingSet = ((DssCriterion)criterion).IdRatingSet; Options = ((DssCriterion)criterion).Options.Where(o => o.Deleted == BaseStatusDeleted.None).OrderBy(o => o.DisplayOrder).ThenBy(o => o.Name).Select(o => new dtoCriterionOption(o)).ToList(); break; case CriterionType.RatingScaleFuzzy: IsFuzzy = ((DssCriterion)criterion).IsFuzzy; IdRatingSet = ((DssCriterion)criterion).IdRatingSet; Options = ((DssCriterion)criterion).Options.Where(o => o.Deleted == BaseStatusDeleted.None).OrderBy(o => o.DisplayOrder).ThenBy(o => o.Name).Select(o => new dtoCriterionOption(o)).ToList(); break; } CommentMaxLength = criterion.CommentMaxLength; }
public dtoCriterionSummaryItem(BaseCriterion criterion) : base(criterion) { DisplayAs = displayAs.item; Evaluations = new List<dtoCriterionValueSummaryItem>(); }
public dtoCriterion(BaseCriterion criterion) : this(criterion.Id, criterion.Name, criterion.DisplayOrder) { CreateDto(criterion); }