Ejemplo n.º 1
0
        protected override void Handle(UserLoginCommand command)
        {
            UserCredential.CreateCredential(command.UserName, command.UserPassword);

            Account account = AccountFactory.CreateAccount();

            account.Login();

            UserCredential.RememberUserName();

            User user = UserRepository.Load(command.UserName);

            UserRepository.UpdateLoginStatus(user.ID, LoginStatus.Login);

            SystemUser.CreateSystemUser(user.ID, user.FirstName, user.LastName, user.UserRole);

            Mediator.Publish(new UserLoggedEvent());
        }