コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }