Пример #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;
 }