Esempio n. 1
0
 private Data.User CreateDefaultUser(string username)
 {
     Data.User user = new Data.User();
     user.Username = username;
     using (EMMDataContext db = Manager.GetContext)
     {
         user.Rank = db.Ranks.Single(rank => rank.Name == "Everyone");
         db.Users.InsertOnSubmit(user);
         db.SubmitChanges();
     }
     return user;
 }
 partial void DeleteUser(User instance);
 partial void UpdateUser(User instance);
 partial void InsertUser(User instance);
		private void detach_Users(User entity)
		{
			this.SendPropertyChanging();
			entity.Rank = null;
		}
		private void attach_Users(User entity)
		{
			this.SendPropertyChanging();
			entity.Rank = this;
		}
 public void SetUser(string username)
 {
     mUser = Manager.GetContext.Users.SingleOrDefault(u => u.Username == username);
 }