Exemplo n.º 1
0
 public void DeleteClientAccount(Guid id)
 {
     if (ClientAccounts.ContainsKey(id))
     {
         ClientAccounts.Remove(id);
     }
 }
Exemplo n.º 2
0
        public ClientAccount UpdateClientAccount(Guid id, string clientName)
        {
            if (!ClientAccounts.ContainsKey(id))
            {
                return(null);
            }

            var clientAccount = ClientAccounts[id];

            clientAccount.ClientName = clientName;

            return(clientAccount);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public UserProfile UpdateUserProfile(Guid profileId, Guid clientId, string emailAddress, List <AwardItem> awards = null)
        {
            if (!ClientAccounts.ContainsKey(clientId) || !UserProfiles.Any(up => up.Id == profileId))
            {
                return(null);
            }

            var clientAccount      = ClientAccounts[clientId];
            var updatedUserProfile = new UserProfile().CreateUserProfile(profileId, emailAddress, clientAccount, awards);
            var currentProfile     = UserProfiles.Single(up => up.Id == profileId);

            currentProfile.UpdateUserProfile(updatedUserProfile);

            return(currentProfile);
        }
Exemplo n.º 5
0
 public ClientAccount GetClientAccountById(Guid id)
 {
     return(ClientAccounts.ContainsKey(id) ? ClientAccounts[id] : null);
 }