public static PersonType GetPersonType(string personType)
{
if (personType == null)
throw new ArgumentNullException("personType");
if (String.IsNullOrWhiteSpace(personType))
throw new ArgumentOutOfRangeException("personType", personType, INVALID_PERSON_TYPE);
switch (personType.ToUpper())
{
case "C": return PersonType.Client;
case "E": return PersonType.Employee;
default:
throw new ArgumentOutOfRangeException("personType", personType, INVALID_PERSON_TYPE);
}
}