public static object GetPropertyValueByName(VSalesPerson entity, string propertyName)
{
switch (propertyName)
{
case "SalesPersonId":
return entity.SalesPersonId;
case "Title":
return entity.Title;
case "FirstName":
return entity.FirstName;
case "MiddleName":
return entity.MiddleName;
case "LastName":
return entity.LastName;
case "Suffix":
return entity.Suffix;
case "JobTitle":
return entity.JobTitle;
case "Phone":
return entity.Phone;
case "EmailAddress":
return entity.EmailAddress;
case "EmailPromotion":
return entity.EmailPromotion;
case "AddressLine1":
return entity.AddressLine1;
case "AddressLine2":
return entity.AddressLine2;
case "City":
return entity.City;
case "StateProvinceName":
return entity.StateProvinceName;
case "PostalCode":
return entity.PostalCode;
case "CountryRegionName":
return entity.CountryRegionName;
case "TerritoryName":
return entity.TerritoryName;
case "TerritoryGroup":
return entity.TerritoryGroup;
case "SalesQuota":
return entity.SalesQuota;
case "SalesYtd":
return entity.SalesYtd;
case "SalesLastYear":
return entity.SalesLastYear;
}
return null;
}