public UserStatisticSettings GetAccountSettings(int accountId) { var settings = new UserStatisticSettings(); var accountRepository = new AccountRepository(); var account = accountRepository.GetAccountById(accountId); if (account != null) { var userRepository = new UsersRepository(); var user = userRepository.GetUserById(account.UserId); settings = GetOrCreateUserSettings(user.LoweredUserName); } return settings; }
public string GetUserNameByAccountId(int accountId) { string userName = string.Empty; var accountRepository = new AccountRepository(); var account = accountRepository.GetAccountById(accountId); if (account != null) { var userRepository = new UsersRepository(); var user = userRepository.GetUserById(account.UserId); if (user != null) userName = user.UserName; } return userName; }