public void DeleteClientAccount(Guid id) { if (ClientAccounts.ContainsKey(id)) { ClientAccounts.Remove(id); } }
public ClientAccount UpdateClientAccount(Guid id, string clientName) { if (!ClientAccounts.ContainsKey(id)) { return(null); } var clientAccount = ClientAccounts[id]; clientAccount.ClientName = clientName; return(clientAccount); }
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); }
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); }
public ClientAccount GetClientAccountById(Guid id) { return(ClientAccounts.ContainsKey(id) ? ClientAccounts[id] : null); }