public static AgeBandInfo GetAgeBandFromEnum(AgeBand ageBandPassed) { int fromAge = GetFromAgeOfBand(ageBandPassed); int thruAge = GetThruAgeOfBand(ageBandPassed); AgeBandInfo newAgeBandInfo = new AgeBandInfo(ageBandPassed, fromAge, thruAge); return newAgeBandInfo; }
public static AgeBandInfo GetAgeBandFromName(string ageBandNamePassed) { AgeBandInfo newAgeBandInfo = new AgeBandInfo(); if (CheckIfAgeBandPassedValid(ageBandNamePassed)) { AgeBand newAgeBand = (AgeBand)Enum.Parse(typeof(AgeBand), ageBandNamePassed); newAgeBandInfo = GetAgeBandFromEnum(newAgeBand); } else { newAgeBandInfo.Errors.Add(new ErrorBase()); } return newAgeBandInfo; }