public long RegisterUser(UserAccount newUserAccount)
 {
     if (validateUniqueLogin(newUserAccount.Login) == false)
     {
         return(0);
     }
     newUserAccount.Password                = EncryptPassword(newUserAccount.Password);
     newUserAccount.AccountStatus           = UserAccount.Status.ACTIVE;
     newUserAccount.LastPasswordChangedDate = DateTime.Now;
     newUserAccount.ValidFrom               = DateTime.Now;
     newUserAccount.ValidTo = new DateTime(newUserAccount.ValidFrom.Year + 1, newUserAccount.ValidFrom.Month, newUserAccount.ValidFrom.Day);
     return(AuthorizationDao.RegisterUser(newUserAccount));
 }