Exemplo n.º 1
0
 public UserDeletedEvent(User user)
 {
     _user = user;
 }
Exemplo n.º 2
0
 public UserRolledBackEvent(User user)
 {
     _user = user;
 }
Exemplo n.º 3
0
 public UserUpdatedEvent(User user)
 {
     _user = user;
 }
Exemplo n.º 4
0
 public UserCreatedEvent(User user)
 {
     _user = user;
 }
Exemplo n.º 5
0
        public bool CreateNewAccountPassword(User _user)
        {
            string salt;
            string plainPassword;
            var password = GeneratePassword(out salt, out plainPassword);
            var success = userRepository.SavePassword(_user.ID, salt, password);

            if (success)
            {
                var replacements = new Dictionary<string, string>(4)
                    {
                        {"#forename#", _user.Forename},
                        {"#surname#", _user.Surname},
                        {"#username#", _user.Username},
                        {"#password#", plainPassword},
                      //  {"#sitename#", configurationService.SiteName()},
                       // {"#siteurl#", configurationService.SiteURL()},
                        {"#accounttype#", _user.Roles.HasContent() ? _user.Roles.First().Name : string.Empty},
                    };

                const string key = "AdminCreateAccount";

             /*   if (notificationService.SendMail(key, _user.EventDescription, replacements))
                {
                    notificationService.SendEmailLog(key, _user.Username);
                    return true;
                }*/

                return true;
            }
             //   MessageBusService.Log(string.Format("Account Manager: An error occured while trying to email the account details to  '{0}'", _user.Username));
            MessageBusService.AddError(string.Format("An error occured while trying to email the account details to '{0}'.", _user.Username));
            return false;
        }