Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
 partial void DeleteProfileDataProvider(ProfileDataProvider instance);
 partial void UpdateProfileDataProvider(ProfileDataProvider instance);
		private void detach_ProfileDataProviders(ProfileDataProvider entity)
		{
			this.SendPropertyChanging();
			entity.UserDataProvider = null;
		}
 partial void InsertProfileDataProvider(ProfileDataProvider instance);
Beispiel #5
0
 public static int CreateNewUser(User user, string password)
 {
     try
     {
         using (SqlConnection connection = ConnectionManager.GetConnection())
         {
             var data = new ActivEarthDataProvidersDataContext(connection);
             var userData = new UserDataProvider { password = password, user_name = user.UserName };
             data.UserDataProviders.InsertOnSubmit(userData);
             var profileData = new ProfileDataProvider { UserDataProvider = userData, age = -1, city = "", email = user.Email, gender = user.Gender, height = -1, first_name = user.FirstName, last_name = user.LastName, state = "", weight = -1, green_score = 0, activity_score_total = 0, activity_score_contests = 0, activity_score_challenges = 0, activity_score_badges = 0 };
             data.ProfileDataProviders.InsertOnSubmit(profileData);
             data.SubmitChanges();
             return userData.id;
         }
     }
     catch
     {
         return 0;
     }
 }