コード例 #1
0
 public void DeleteUserAccount(Guid id)
 {
     if (UserAccounts.ContainsKey(id))
     {
         UserAccounts.Remove(id);
     }
 }
コード例 #2
0
        public List <AwardItem> GetAwardsForUser(Guid userAccountId)
        {
            if (!UserAccounts.ContainsKey(userAccountId))
            {
                return(new List <AwardItem>());
            }

            return(UserAccounts[userAccountId].Profiles.SelectMany(up => up.Awards).ToList());
        }
コード例 #3
0
        public void DeleteProfile(Guid profileId, Guid userAccountId)
        {
            if (!UserAccounts.ContainsKey(userAccountId))
            {
                return;
            }

            UserAccounts[userAccountId].DeleteProfile(profileId);
        }
コード例 #4
0
        public UserProfile AddNewUserProfileToAccount(Guid userAccountId, Guid clientId, string emailAddress, List <AwardItem> awards = null)
        {
            if (!UserAccounts.ContainsKey(userAccountId) || !ClientAccounts.ContainsKey(clientId))
            {
                return(null);
            }

            var clientAccount = ClientAccounts[clientId];
            var newProfile    = new UserProfile().CreateUserProfile(Guid.NewGuid(), emailAddress, clientAccount, awards);

            UserAccounts[userAccountId].AddProfile(newProfile);

            return(newProfile);
        }
コード例 #5
0
        public UserAccount UpdateUserAccount(Guid id, string firstName, string lastName, string username, string password = null)
        {
            if (!UserAccounts.ContainsKey(id))
            {
                return(null);
            }

            var updatedAccount = new UserAccount().CreateAccount(id, firstName, lastName, username, password);
            var userAccount    = UserAccounts[id];

            userAccount.UpdateAccount(updatedAccount, password);

            return(userAccount);
        }
コード例 #6
0
 public UserAccount GetUserAccountById(Guid id)
 {
     return(UserAccounts.ContainsKey(id) ? UserAccounts[id] : null);
 }