コード例 #1
0
        private void Login()
        {
            if (LoggedUser != null)
            {
                _view.ShowMessage("You are currently logged in!");
                _view.Sleep();
                return;
            }

            var user   = _view.GetUserData();
            var dbUser = _userRepository.GetUser(user.Login, user.Password);

            if (dbUser != null)
            {
                LoggedUser = dbUser;
            }
            else
            {
                throw new InvalidDataException("Incorrect login and/or password");
            }
        }