/*
         * ====================================================================================
         * if  Jennifer decides to choose percentiles ranging from 10-90 then switch to this one
         * ====================================================================================
         * 
                public string InPercentile0To100(TraitVM trait, decimal bullVal)
                {
                    // which percentile? - match column name on trait
                    string colName = (Enum.GetName(typeof (BullSaleViewNameEnum), trait.BullSaleView));

                    StrainPercentiles strainPercentile =
                        _percentiles.FirstOrDefault(x => x.ColName.Equals(colName, StringComparison.CurrentCultureIgnoreCase));
                    if (strainPercentile == null) return null;

                    int desiredPercentileVal = int.Parse(trait.ExactValue);

                    decimal pctVal = strainPercentile.Percentiles[desiredPercentileVal];
                    if ((desiredPercentileVal > 50) && (bullVal > pctVal))
                        return bullVal.ToString(CultureInfo.InvariantCulture);

                    if ((desiredPercentileVal <= 50) && (bullVal < pctVal))
                        return bullVal.ToString(CultureInfo.InvariantCulture);

                    return null;
                }
         */


        private StrainPercentiles LookupStrainPercentile(IEnumerable<StrainPercentiles> percentiles,
                                                         BullSaleViewNameEnum bullSaleViewNameEnum)
        {
            //var strainPercentile = _percentiles.FirstOrDefault(x => x.ColEnum == bullSaleViewNameEnum);
            string colName = Enum.GetName(typeof (BullSaleViewNameEnum), bullSaleViewNameEnum);
            StrainPercentiles strainPercentile = percentiles.FirstOrDefault(x => x.ColName == colName);
            if (strainPercentile == null)
                throw new Exception(string.Format("No strain percentiles found for column {0}", colName));
            return strainPercentile;
        }
 protected void SetViewValue(BullSaleViewNameEnum e, string val)
 {
     _DesiredValue = val;
     _DesiredTraits.Add(
         new TraitVM
             {
                 BullSaleView = e,
                 HasRange = false,
                 ExactValue = val
             }
         );
 }
 protected void SetViewRangeValues(BullSaleViewNameEnum e, string min, string max)
 {
     _MinDesiredValue = min;
     _MaxDesiredValue = max;
     _DesiredTraits.Add(
         new TraitVM
             {
                 BullSaleView = e,
                 HasRange = true,
                 RangeMinValue = _MinDesiredValue,
                 RangeMaxValue = _MaxDesiredValue
             }
         );
 }
 private StrainPercentiles GetOnePercentileView(string strain, int saleYear, BullSaleViewNameEnum e)
 {
     return _percentileRepository.Get(strain, saleYear, (Enum.GetName(typeof (BullSaleViewNameEnum), e)));
 }