public static bool CreateInitializationEntry(int challengeId, int userId, float value)
{
try
{
using (SqlConnection connection = ConnectionManager.GetConnection())
{
var data = new ActivEarthDataProvidersDataContext(connection);
var challengeData = new ChallengeInitializationDataProvider
{
challenge_id = challengeId,
user_id = userId,
value = value
};
data.ChallengeInitializationDataProviders.InsertOnSubmit(challengeData);
data.SubmitChanges();
return (challengeData.id > 0);
}
}
catch (Exception)
{
return false;
}
}