/// <summary> /// Tworzy nowego użytkownika i umieszcza rekord w bazie danych /// </summary> public static User createUser(String name, String surname, DateTime birthDate, UserRole role, SexEnum sex, String login, String pass) { User user = new User(); List<User> list = SessionFactory.GetNewSession().CreateQuery("from User u WHERE u.login = :login").SetParameter("login", login).List<User>().ToList<User>(); if (list.Count > 0) { throw new Exception("User with given login exists"); } user.vlogin = login; user.vpassword = EncodePassword(pass); user.vRole = role.vid; user.vsex = sex; user.vname = name; user.vSureName = surname; user.vDateOfBirth = birthDate; return user; }
public void SetRole(UserRole role) { throw new System.Exception("Not implemented"); }
public virtual void SetRole(UserRole _role) { this.role = _role.vid; }
public void SetRole(UserRole role) { this.role = role; }