public ObservationTypeSchema(Models.TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType, List <CollectionMethodSectionViewModel> initialAssessmentObservations)
            {
                InitialAssessmentObservations             = initialAssessmentObservations;
                TreatmentBMPAssessmentObservationTypeID   = treatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeID;
                TreatmentBMPAssessmentObservationTypeName = treatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeName;
                ObservationTypeCollectionMethod           = treatmentBMPAssessmentObservationType.ObservationTypeSpecification.ObservationTypeCollectionMethod.ToEnum;

                switch (ObservationTypeCollectionMethod)
                {
                case ObservationTypeCollectionMethodEnum.DiscreteValue:
                    var discreteObservationTypeSchema = treatmentBMPAssessmentObservationType.GetDiscreteObservationTypeSchema();
                    PropertiesToObserve = discreteObservationTypeSchema.PropertiesToObserve
                                          .Select((x, index) => new SelectItemSimple(index, x)).ToList();
                    AssessmentDescription       = discreteObservationTypeSchema.AssessmentDescription;
                    MinimumNumberOfObservations = discreteObservationTypeSchema.MinimumNumberOfObservations;
                    MaximumNumberOfObservations = discreteObservationTypeSchema.MaximumNumberOfObservations ?? int.MaxValue;
                    MinimumValueOfObservations  = discreteObservationTypeSchema.MinimumValueOfObservations;
                    MaximumValueOfObservations  = discreteObservationTypeSchema.MaximumValueOfObservations ?? double.MaxValue;
                    MeasurementUnitLabelAndUnit = $"{discreteObservationTypeSchema.MeasurementUnitLabel} ({treatmentBMPAssessmentObservationType.BenchmarkMeasurementUnitType().LegendDisplayName})";
                    break;

                case ObservationTypeCollectionMethodEnum.PassFail:
                    var passFailObservationTypeSchema = treatmentBMPAssessmentObservationType.GetPassFailSchema();
                    PropertiesToObserve = passFailObservationTypeSchema.PropertiesToObserve
                                          .Select((x, index) => new SelectItemSimple(index, x)).ToList();
                    AssessmentDescription = passFailObservationTypeSchema.AssessmentDescription;
                    PassingScoreLabel     = passFailObservationTypeSchema.PassingScoreLabel;
                    FailingScoreLabel     = passFailObservationTypeSchema.FailingScoreLabel;
                    break;

                case ObservationTypeCollectionMethodEnum.Percentage:
                    var percentageObservationTypeSchema = treatmentBMPAssessmentObservationType.GetPercentageSchema();
                    PropertiesToObserve = percentageObservationTypeSchema.PropertiesToObserve
                                          .Select((x, index) => new SelectItemSimple(index, x)).ToList();
                    AssessmentDescription       = percentageObservationTypeSchema.AssessmentDescription;
                    MeasurementUnitLabelAndUnit = $"{treatmentBMPAssessmentObservationType.BenchmarkMeasurementUnitLabel()} ({treatmentBMPAssessmentObservationType.BenchmarkMeasurementUnitType().LegendDisplayName})";
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        public EditBenchmarkAndThresholdViewData(Person currentPerson, Models.TreatmentBMP treatmentBMP,
                                                 Models.TreatmentBMPAssessmentObservationType TreatmentBMPAssessmentObservationType)
            : base(currentPerson, treatmentBMP, TreatmentBMPAssessmentObservationType)
        {
            BenchmarkMeasurementUnitTypeDisplayName = TreatmentBMPAssessmentObservationType.BenchmarkMeasurementUnitType().MeasurementUnitTypeDisplayName;
            ThresholdMeasurementUnitTypeDisplayName = TreatmentBMPAssessmentObservationType.ThresholdMeasurementUnitType().MeasurementUnitTypeDisplayName;

            BenchmarkMeasurementUnitLabel = TreatmentBMPAssessmentObservationType.BenchmarkMeasurementUnitLabel();
            ThresholdMeasurementUnitLabel = TreatmentBMPAssessmentObservationType.ThresholdMeasurementUnitLabel();

            BenchmarkDescription = TreatmentBMPAssessmentObservationType.BenchmarkDescription();
            ThresholdDescription = TreatmentBMPAssessmentObservationType.ThresholdDescription();

            var TreatmentBMPTypeAssessmentObservationType = treatmentBMP.TreatmentBMPType.GetTreatmentBMPTypeObservationType(TreatmentBMPAssessmentObservationType);

            DefaultBenchmarkPlaceholder = TreatmentBMPTypeAssessmentObservationType.DefaultBenchmarkValue.HasValue ? "default is " + TreatmentBMPTypeAssessmentObservationType.DefaultBenchmarkValue.Value : string.Empty;
            DefaultBenchmarkText        = TreatmentBMPTypeAssessmentObservationType.DefaultBenchmarkValue.HasValue ? $"The default value is {TreatmentBMPTypeAssessmentObservationType.DefaultBenchmarkValue} {TreatmentBMPAssessmentObservationType.BenchmarkMeasurementUnitType().MeasurementUnitTypeDisplayName}." : string.Empty;

            DefaultThresholdPlaceholder = TreatmentBMPTypeAssessmentObservationType.DefaultThresholdValue.HasValue ? "default is " + TreatmentBMPTypeAssessmentObservationType.DefaultThresholdValue.Value : string.Empty;
            TargetIsSweetSpot           = TreatmentBMPAssessmentObservationType.GetTargetIsSweetSpot();
            var optionalPlusMinus = TreatmentBMPAssessmentObservationType.GetTargetIsSweetSpot() ? "+/-" : "";

            DefaultThresholdText = TreatmentBMPTypeAssessmentObservationType.DefaultThresholdValue.HasValue ? $"The default value is {optionalPlusMinus} {TreatmentBMPTypeAssessmentObservationType.DefaultThresholdValue} {TreatmentBMPAssessmentObservationType.ThresholdMeasurementUnitType().MeasurementUnitTypeDisplayName}." : string.Empty;
        }
 public PercentageCollectionMethodViewData(Models.TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType)
 {
     ViewDataForAngular          = new PercentageCollectionMethodViewDataForAngular(treatmentBMPAssessmentObservationType.GetPercentageSchema());
     MeasurementUnitLabelAndUnit = $"{treatmentBMPAssessmentObservationType.BenchmarkMeasurementUnitLabel()} ({treatmentBMPAssessmentObservationType.BenchmarkMeasurementUnitType().LegendDisplayName})";
     AssessmentDescription       = treatmentBMPAssessmentObservationType.GetPercentageSchema().AssessmentDescription;
 }