Example #1
0
        public static long AddUser(string email, string password)
        {
            long userId;
            WNDataContext db = new WNDataContext();
            User user = new User();
            user.Email = email;
            user.Name = email.Split('@').Length>0?email.Split('@')[0]:"*";
            user.Password = EncDec.Encrypt(password, "webnote");
            UserRole uroles = new UserRole();
            uroles.User = user;
            uroles.RoleId = 1;
            db.UserRoles.InsertOnSubmit(uroles);
            db.SubmitChanges();

            userId = user.Id;

            return userId;
        }
Example #2
0
 partial void DeleteUserRole(UserRole instance);
Example #3
0
 partial void UpdateUserRole(UserRole instance);
Example #4
0
 partial void InsertUserRole(UserRole instance);
Example #5
0
		private void detach_UserRoles(UserRole entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
Example #6
0
		private void attach_UserRoles(UserRole entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}