AddNewUser() public method

public AddNewUser ( User user ) : User
user User
return User
Exemplo n.º 1
0
        public  void TestInitialize()
        {
            if (Membership.CurrentUser == null)
            {
                UserRepository repository = new UserRepository();
                User user = new User();
                user = repository.TryGetCurrentUser();
                if (user == null)
                {
                    user = new User();
                    user.Name = LoginViewModelTest.LOGIN;
                    user.Password = LoginViewModelTest.PASSWORD;
                    Server server = new Server();
                    server.Address = LoginViewModelTest.SERVER_PATH;
                    user.ID = 0;
                    user.Server = server;
                    user.IsCurrent = true;
                    repository.AddNewUser(user);
                }

                Membership.CheckUserData(user.Name, user.Password, user.Server.Address, this.OnUserAuthenticated);
            }
        }
Exemplo n.º 2
0
        private static void CheckUserDataCallback(AuthentificationCode result)
        {
            if (result == AuthentificationCode.LoginSuccessed)
            {
                using (var userRepository = new UserRepository())
                    _authUser = userRepository.AddNewUser(_authUser);
                SetCurrentUser(_authUser);
            }

            InvokeCallbackWithAuthCodeParameter(result);
        }