示例#1
0
 /// <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;
 }
示例#2
0
 public void SetRole(UserRole role)
 {
     throw new System.Exception("Not implemented");
 }
示例#3
0
 public virtual void SetRole(UserRole _role)
 {
     this.role = _role.vid;
 }
示例#4
0
 public void SetRole(UserRole role)
 {
     this.role = role;
 }