public static PrivacySetting GetPrivacySettingFromPrivacySettingId(int privacySettingId)
{
PrivacySetting toReturn;
using (SqlConnection connection = ConnectionManager.GetConnection())
{
var data = new ActivEarthDataProvidersDataContext(connection);
toReturn = (from p in data.PrivacySettingDataProviders
where p.id == privacySettingId
select
new PrivacySetting
{
ID = p.id,
Email = p.email,
Gender = p.gender,
Age = p.age,
Height = p.height,
Weight = p.weight,
Group = p.groups,
ProfileVisibility = p.profile_visibility,
UserID = p.user_id
}).FirstOrDefault();
}
if (toReturn != null)
{
toReturn.User = UserDAO.GetUserFromUserId(toReturn.UserID);
}
return toReturn;
}